blob: 271b2825e32966470cb73047353ba4166a81497e [file] [log] [blame]
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -06001{{/*
2# Copyright 2022-present Open Networking Foundation
3
4# SPDX-License-Identifier: Apache-2.0
5*/}}
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -06006{{- if .Values.config.metricfunc.deploy }}
7{{ tuple "metricfunc" . | include "5g-control-plane.service_account" }}
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -06008---
9apiVersion: apps/v1
10kind: Deployment
11metadata:
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -060012 name: metricfunc
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060013 labels:
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -060014{{ tuple "metricfunc" . | include "5g-control-plane.metadata_labels" | indent 4 }}
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060015spec:
16 replicas: 1
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -060017 #serviceName: metricfunc-headless
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060018 selector:
19 matchLabels:
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -060020{{ tuple "metricfunc" . | include "5g-control-plane.metadata_labels" | indent 6 }}
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060021 template:
22 metadata:
23 labels:
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -060024{{ tuple "metricfunc" . | include "5g-control-plane.metadata_labels" | indent 8 }}
25 {{- with .Values.config.metricfunc.podAnnotations }}
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060026 annotations:
27 {{- toYaml . | nindent 8 }}
28 {{- end }}
29 spec:
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -060030 serviceAccountName: metricfunc
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060031 {{- if hasKey .Values.images "pullSecrets" }}
32 imagePullSecrets:
33{{ toYaml .Values.images.pullSecrets | indent 8 }}
34 {{- end }}
35 containers:
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -060036 - name: metricfunc
37 image: {{ .Values.images.tags.metricfunc }}
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060038 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 Thakura2e2adb2022-06-06 13:46:30 -060045 command: [ "/metricfunc/script/metricfunc-run.sh" ]
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060046 env:
47 - name: POD_IP
48 valueFrom:
49 fieldRef:
50 fieldPath: status.podIP
51 {{- if .Values.resources.enabled }}
52 resources:
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -060053{{ toYaml .Values.resources.metricfunc | indent 10 }}
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060054 {{- end }}
55 volumeMounts:
56 - name: run-script
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -060057 mountPath: /metricfunc/script/metricfunc-run.sh
58 subPath: metricfunc-run.sh
59 - name: metricfunc-config
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060060 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 Thakura2e2adb2022-06-06 13:46:30 -060068 name: metricfunc
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060069 defaultMode: 493
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -060070 - name: metricfunc-config
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060071 configMap:
Ajay Lotan Thakura2e2adb2022-06-06 13:46:30 -060072 name: metricfunc
Ajay Lotan Thakur491ed5a2022-05-31 17:33:00 -060073 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 }}