Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 1 | {{/* |
| 2 | # Copyright 2022-present Open Networking Foundation |
| 3 | |
| 4 | # SPDX-License-Identifier: Apache-2.0 |
| 5 | */}} |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 6 | {{- if .Values.config.metricfunc.deploy }} |
| 7 | {{ tuple "metricfunc" . | include "5g-control-plane.service_account" }} |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 8 | --- |
| 9 | apiVersion: apps/v1 |
| 10 | kind: Deployment |
| 11 | metadata: |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 12 | name: metricfunc |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 13 | labels: |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 14 | {{ tuple "metricfunc" . | include "5g-control-plane.metadata_labels" | indent 4 }} |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 15 | spec: |
| 16 | replicas: 1 |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 17 | #serviceName: metricfunc-headless |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 18 | selector: |
| 19 | matchLabels: |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 20 | {{ tuple "metricfunc" . | include "5g-control-plane.metadata_labels" | indent 6 }} |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 21 | template: |
| 22 | metadata: |
| 23 | labels: |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 24 | {{ tuple "metricfunc" . | include "5g-control-plane.metadata_labels" | indent 8 }} |
| 25 | {{- with .Values.config.metricfunc.podAnnotations }} |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 26 | annotations: |
| 27 | {{- toYaml . | nindent 8 }} |
| 28 | {{- end }} |
| 29 | spec: |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 30 | serviceAccountName: metricfunc |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 31 | {{- if hasKey .Values.images "pullSecrets" }} |
| 32 | imagePullSecrets: |
| 33 | {{ toYaml .Values.images.pullSecrets | indent 8 }} |
| 34 | {{- end }} |
| 35 | containers: |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 36 | - name: metricfunc |
| 37 | image: {{ .Values.images.tags.metricfunc }} |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 38 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 39 | {{- if .Values.config.coreDump.enabled }} |
| 40 | securityContext: |
| 41 | runAsUser: 0 |
| 42 | {{- end }} |
| 43 | stdin: true |
| 44 | tty: true |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 45 | command: [ "/metricfunc/script/metricfunc-run.sh" ] |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 46 | env: |
| 47 | - name: POD_IP |
| 48 | valueFrom: |
| 49 | fieldRef: |
| 50 | fieldPath: status.podIP |
| 51 | {{- if .Values.resources.enabled }} |
| 52 | resources: |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 53 | {{ toYaml .Values.resources.metricfunc | indent 10 }} |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 54 | {{- end }} |
| 55 | volumeMounts: |
| 56 | - name: run-script |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 57 | mountPath: /metricfunc/script/metricfunc-run.sh |
| 58 | subPath: metricfunc-run.sh |
| 59 | - name: metricfunc-config |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 60 | mountPath: /metricfunc/config |
| 61 | {{- if .Values.config.coreDump.enabled }} |
| 62 | - name: coredump |
| 63 | mountPath: /tmp/coredump |
| 64 | {{- end }} |
| 65 | volumes: |
| 66 | - name: run-script |
| 67 | configMap: |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 68 | name: metricfunc |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 69 | defaultMode: 493 |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 70 | - name: metricfunc-config |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 71 | configMap: |
Ajay Lotan Thakur | a2e2adb | 2022-06-06 13:46:30 -0600 | [diff] [blame] | 72 | name: metricfunc |
Ajay Lotan Thakur | 491ed5a | 2022-05-31 17:33:00 -0600 | [diff] [blame] | 73 | defaultMode: 493 |
| 74 | {{- if .Values.config.coreDump.enabled }} |
| 75 | - name: host-rootfs |
| 76 | hostPath: |
| 77 | path: / |
| 78 | - name: coredump |
| 79 | hostPath: |
| 80 | path: {{ .Values.config.coreDump.path }} |
| 81 | {{- end }} |
| 82 | {{- end }} |