blob: 296bc5075be86c5ec4b96a9ed333c2cfc39e8de8 [file] [log] [blame]
badhri854c028b32021-11-03 18:24:05 -05001{{/*
2# Copyright 2020-present Open Networking Foundation
3
4# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
5*/}}
6
7{{- if .Values.config.smf.deploy }}
8{{ tuple "smf" . | include "5g-control-plane.service_account" }}
9---
10apiVersion: apps/v1
11kind: Deployment
12metadata:
13 name: smf
14 labels:
15{{ tuple "smf" . | include "5g-control-plane.metadata_labels" | indent 4 }}
16spec:
17 replicas: 1
18 #serviceName: smf-headless
19 selector:
20 matchLabels:
21{{ tuple "smf" . | include "5g-control-plane.metadata_labels" | indent 6 }}
22 template:
23 metadata:
24 labels:
25{{ tuple "smf" . | include "5g-control-plane.metadata_labels" | indent 8 }}
26 {{- with .Values.config.smf.podAnnotations }}
27 annotations:
28 helm.sh/hook: pre-install
29 helm.sh/hook-weight: "5"
30 {{- toYaml . | nindent 8 }}
31 {{- end }}
32 spec:
33 serviceAccountName: smf
34 {{- if hasKey .Values.images "pullSecrets" }}
35 imagePullSecrets:
36{{ toYaml .Values.images.pullSecrets | indent 8 }}
37 {{- end }}
38 initContainers:
39 - name: wait-smf-module
40 image: {{ .Values.images.tags.init | quote }}
41 imagePullPolicy: {{ .Values.images.pullPolicy }}
42 command: ['sh', '-c', 'until nslookup smf; do echo waiting for smf; sleep 4; done;']
43 {{- if .Values.config.coreDump.enabled }}
44{{ tuple "smf" . | include "5g-control-plane.coredump_init" | indent 6 }}
45 {{- end }}
46 containers:
47 - name: smf
48 image: {{ .Values.images.tags.smf }}
49 imagePullPolicy: {{ .Values.images.pullPolicy }}
50 {{- if .Values.config.coreDump.enabled }}
51 securityContext:
52 runAsUser: 0
53 {{- end }}
54 stdin: true
55 tty: true
56 command: ["/free5gc/script/smf-run.sh"]
57 env:
58 - name: GRPC_GO_LOG_VERBOSITY_LEVEL
59 value: {{ .Values.config.grpc.golog_verbosity | quote }}
60 - name: GRPC_GO_LOG_SEVERITY_LEVEL
61 value: {{ .Values.config.grpc.severity | quote }}
62 - name: GRPC_TRACE
63 value: {{ .Values.config.grpc.trace | quote }}
64 - name: GRPC_VERBOSITY
65 value: {{ .Values.config.grpc.verbosity | quote }}
66 - name: POD_IP
67 valueFrom:
68 fieldRef:
69 fieldPath: status.podIP
70 {{- if .Values.config.managedByConfigPod.enabled }}
71 - name: MANAGED_BY_CONFIG_POD
72 value: "true"
73 {{- end }}
74 {{- if .Values.resources.enabled }}
75 resources:
76{{ toYaml .Values.resources.smf | indent 10 }}
77 {{- end }}
78 volumeMounts:
79 - name: run-script
80 mountPath: /free5gc/script/smf-run.sh
81 subPath: smf-run.sh
82 - name: nf-config
83 mountPath: /free5gc/uerouting
84 - name: nf-config
85 mountPath: /free5gc/config
86 {{- if .Values.config.coreDump.enabled }}
87 - name: coredump
88 mountPath: /tmp/coredump
89 {{- end }}
90 volumes:
91 - name: run-script
92 configMap:
93 name: smf
94 defaultMode: 493
95 - name: nf-config
96 configMap:
97 name: smf
98 defaultMode: 493
99 {{- if .Values.config.coreDump.enabled }}
100 - name: host-rootfs
101 hostPath:
102 path: /
103 - name: coredump
104 hostPath:
105 path: {{ .Values.config.coreDump.path }}
106 {{- end }}
107{{- end }}