Metric function helm chart changes
Change-Id: I0122c765e4bc664ae4c68f796ed6cf4d6db84b4a
diff --git a/5g-control-plane/templates/deployment-metrics.yaml b/5g-control-plane/templates/deployment-metrics.yaml
new file mode 100644
index 0000000..b19f9c4
--- /dev/null
+++ b/5g-control-plane/templates/deployment-metrics.yaml
@@ -0,0 +1,82 @@
+{{/*
+# Copyright 2022-present Open Networking Foundation
+
+# SPDX-License-Identifier: Apache-2.0
+*/}}
+{{- if .Values.config.metrics.deploy }}
+{{ tuple "metrics" . | include "5g-control-plane.service_account" }}
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: metrics
+ labels:
+{{ tuple "metrics" . | include "5g-control-plane.metadata_labels" | indent 4 }}
+spec:
+ replicas: 1
+ #serviceName: metrics-headless
+ selector:
+ matchLabels:
+{{ tuple "metrics" . | include "5g-control-plane.metadata_labels" | indent 6 }}
+ template:
+ metadata:
+ labels:
+{{ tuple "metrics" . | include "5g-control-plane.metadata_labels" | indent 8 }}
+ {{- with .Values.config.metrics.podAnnotations }}
+ annotations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ spec:
+ serviceAccountName: metrics
+ {{- if hasKey .Values.images "pullSecrets" }}
+ imagePullSecrets:
+{{ toYaml .Values.images.pullSecrets | indent 8 }}
+ {{- end }}
+ containers:
+ - name: metrics
+ image: {{ .Values.images.tags.metrics }}
+ imagePullPolicy: {{ .Values.images.pullPolicy }}
+ {{- if .Values.config.coreDump.enabled }}
+ securityContext:
+ runAsUser: 0
+ {{- end }}
+ stdin: true
+ tty: true
+ command: [ "/metricfunc/script/metrics-run.sh" ]
+ env:
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ {{- if .Values.resources.enabled }}
+ resources:
+{{ toYaml .Values.resources.metrics | indent 10 }}
+ {{- end }}
+ volumeMounts:
+ - name: run-script
+ mountPath: /metricfunc/script/metrics-run.sh
+ subPath: metrics-run.sh
+ - name: metrics-config
+ mountPath: /metricfunc/config
+ {{- if .Values.config.coreDump.enabled }}
+ - name: coredump
+ mountPath: /tmp/coredump
+ {{- end }}
+ volumes:
+ - name: run-script
+ configMap:
+ name: metrics
+ defaultMode: 493
+ - name: metrics-config
+ configMap:
+ name: metrics
+ defaultMode: 493
+ {{- if .Values.config.coreDump.enabled }}
+ - name: host-rootfs
+ hostPath:
+ path: /
+ - name: coredump
+ hostPath:
+ path: {{ .Values.config.coreDump.path }}
+ {{- end }}
+{{- end }}