diff --git a/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/deployment.yaml b/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/deployment.yaml deleted file mode 100644 index aa50011eaec00aeff1843c1e9de3681d24242577..0000000000000000000000000000000000000000 --- a/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/deployment.yaml +++ /dev/null @@ -1,64 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "snmpexporter.fullname" . }} - labels: - vnf: {{ .Values.global.osm.vnf_id | lower}} -spec: - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: - {{- include "snmpexporter.selectorLabels" . | nindent 6 }} - template: - metadata: - labels: - {{- include "snmpexporter.selectorLabels" . | nindent 8 }} - spec: - affinity: - podAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: vnf - operator: In - values: - - {{ .Values.global.osm.vnf_id | lower}} - topologyKey: "kubernetes.io/hostname" - 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-{{ .Release.Name }}" - diff --git a/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/service.yaml b/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/service.yaml index 6ec5fb4fb4153956026d8bbb77439ca1cf6234aa..ea31091de1db82811ee19436beca01ab3329abf9 100644 --- a/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/service.yaml +++ b/snmp_ee_vnf/helm-charts/eechart/charts/snmpexporter/templates/service.yaml @@ -12,4 +12,5 @@ spec: protocol: TCP name: snmp selector: - {{- include "snmpexporter.selectorLabels" . | nindent 4 }} \ No newline at end of file + app.kubernetes.io/name: {{ include "eechart.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml b/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml index 9b84df10a7815ab19d5df16c880bdda28847215a..0c81f8e1dc73854c4dead8505087a8f8598dcb20 100755 --- a/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml +++ b/snmp_ee_vnf/helm-charts/eechart/templates/statefulset.yaml @@ -21,7 +21,34 @@ spec: serviceAccountName: {{ template "eechart.serviceAccountName" . }} 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: snmp-config-volume + mountPath: /etc/snmp_exporter + - name: init-config-volume + mountPath: /etc/snmp_exporter_init containers: + - name: snmpexporter + image: "{{ .Values.snmp.image.repository }}:{{ .Values.snmp.image.version }}" + imagePullPolicy: {{ .Values.snmp.image.pullPolicy }} + ports: + - containerPort: 9116 + protocol: TCP + volumeMounts: + - name: snmp-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.snmp.resources | nindent 12 }} - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} @@ -47,8 +74,10 @@ spec: configMap: name: {{ include "eechart.fullname" . }} - name: snmp-config-volume - hostPath: - path: "/var/lib/osm/snmp_exporter/{{ .Values.global.osm.vnf_id | lower }}/" + emptyDir: {} + - name: init-config-volume + configMap: + name: "snmp-init-config-{{ .Release.Name }}" - name: vnf-mibs configMap: name: "vnf-snmp-mibs-{{ .Release.Name }}" @@ -56,5 +85,4 @@ spec: configMap: name: "vnf-snmp-generator-{{ .Release.Name }}" - name: osm-ee - hostPath: - path: /var/lib/osm/osm/osm_osm_packages/_data + emptyDir: {} diff --git a/snmp_ee_vnf/helm-charts/eechart/values.yaml b/snmp_ee_vnf/helm-charts/eechart/values.yaml index 7006b5df1ac6ad4972e7f9a535f26ebff21176ae..432c60b8cb387c9c488021d7fc343808cc4e77ad 100755 --- a/snmp_ee_vnf/helm-charts/eechart/values.yaml +++ b/snmp_ee_vnf/helm-charts/eechart/values.yaml @@ -9,9 +9,16 @@ global: replicaCount: 1 image: - repository: illoret/grpcee + repository: opensourcemano/api-fe tag: latest pullPolicy: IfNotPresent + +snmp: + image: + repository: prom/snmp-exporter + version: v0.17.0 + pullPolicy: IfNotPresent + resources: {} imagePullSecrets: [] nameOverride: ""