Commit 085374dd authored by lavado's avatar lavado
Browse files

Merge branch 'feat/magma_snmp' into 'master'

feat(magma snmp): a few modifications to EEChart and SNMP and adding them to Magma

See merge request !83
parents f45052ac d7b304af
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
apiVersion: v1
appVersion: "1.0"
description: OSM EE helm chart
name: eechart
version: 0.1.0
dependencies:
- name: snmpexporter
condition: snmpexporter.enabled
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
\ No newline at end of file
apiVersion: v1
name: snmpexporter
description: SNMP Exporter for OSM VNF
type: application
version: 1.0.0
appVersion: 1.0.0
dependencies:
- name: snmp-exporter
version: "0.17.0"
repository: "https://hub.docker.com/r/prom/snmp-exporter"
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "snmpexporter.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "snmpexporter.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "snmpexporter.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "snmpexporter.labels" -}}
helm.sh/chart: {{ include "snmpexporter.chart" . }}
{{ include "snmpexporter.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "snmpexporter.selectorLabels" -}}
app.kubernetes.io/name: {{ include "snmpexporter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{/*
Create the name of the service account to use
*/}}
{{- define "snmpexporter.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "snmpexporter.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
\ No newline at end of file
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "snmpexporter.fullname" . }}
labels:
{{- include "snmpexporter.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "snmpexporter.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "snmpexporter.selectorLabels" . | nindent 8 }}
spec:
securityContext:
runAsUser: 0
initContainers:
- name: init-config
image: busybox:1.28
command: ['sh', '-c', 'if [ ! -f "/etc/snmp_exporter/snmp.yml" ]; then cp /etc/snmp_exporter_init/snmp.yml /etc/snmp_exporter; fi']
volumeMounts:
- name: config-volume
mountPath: /etc/snmp_exporter
- name: init-config-volume
mountPath: /etc/snmp_exporter_init
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 9116
protocol: TCP
volumeMounts:
- name: config-volume
mountPath: /etc/snmp_exporter
livenessProbe:
exec:
command:
- /bin/sh
- -c
- if [ ! -f "/etc/snmp_exporter/generator.yml" ]; then exit 0; else rm -f /etc/snmp_exporter/generator.yml && exit 1; fi
failureThreshold: 1
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: config-volume
hostPath:
path: "/var/lib/osm/snmp_exporter/{{ .Values.global.osm.vnf_id | lower }}/"
- name: init-config-volume
configMap:
name: "snmp-init-config-{{ .Values.global.osm.vnf_id | lower }}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment