blob: b19f9c4e1d7bec4542ded18945148181d7f9e04d [file] [log] [blame]
{{/*
# 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 }}