deployment.yaml 7.65 KB
Newer Older
Mohammed Ismail's avatar
Mohammed Ismail committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Chart.Name }}
  labels:
    {{- include "oai-smf.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      {{- include "oai-smf.selectorLabels" . | nindent 6 }}
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        {{- include "oai-smf.selectorLabels" . | nindent 8 }}
18
    {{- if .Values.multus.create }}
Mohammed Ismail's avatar
Mohammed Ismail committed
19
20
      annotations:
        k8s.v1.cni.cncf.io/networks: {{ .Chart.Name }}-{{ .Values.namespace }}-n4-net1
21
    {{- end }}
Mohammed Ismail's avatar
Mohammed Ismail committed
22
23
24
25
26
    spec:
      securityContext:
        {{- toYaml .Values.podSecurityContext | nindent 8 }}
      containers:
      - name: tcpdump
Sagar Arora's avatar
Sagar Arora committed
27
        image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}"
28
        {{- if .Values.start.tcpdump}}
Mohammed Ismail's avatar
Mohammed Ismail committed
29
        command:
30
31
          - /bin/sh
          - -c
32
          - /usr/sbin/tcpdump -i any -w /pcap/oai-smf_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
33
34
35
36
37
        {{- else}}
        command:
          - /bin/sleep
          - infinity
        {{- end}}
Sagar Arora's avatar
Sagar Arora committed
38
        {{- if .Values.persistence.sharedvolume}}
39
40
41
        volumeMounts:
        - mountPath: "/pcap"
          name: cn5g-pv
Sagar Arora's avatar
Sagar Arora committed
42
        {{- end}}
Mohammed Ismail's avatar
Mohammed Ismail committed
43
      - name: smf
Sagar Arora's avatar
Sagar Arora committed
44
        image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}"
Mohammed Ismail's avatar
Mohammed Ismail committed
45
46
        securityContext:
          {{- toYaml .Values.securityContext | nindent 12 }}
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
        volumeMounts:
        - mountPath: /scripts
          name: scripts
        {{- if .Values.readinessProbe}}
        readinessProbe:
          exec:
            command:
            - sh
            - /scripts/live-ready.sh
          initialDelaySeconds: 5
          periodSeconds: 5
        {{- end}}
        {{- if .Values.livenessProbe}}
        livenessProbe:
          exec:
            command:
            - sh
            - /scripts/live-ready.sh
          initialDelaySeconds: 5
          periodSeconds: 5
        {{- end}}
Mohammed Ismail's avatar
Mohammed Ismail committed
68
        ports:
Sagar Arora's avatar
Sagar Arora committed
69
        - containerPort: {{ .Values.service.n4Port }}
Mohammed Ismail's avatar
Mohammed Ismail committed
70
71
72
73
74
          name: oai-smf
        - containerPort: {{ .Values.service.http1Port }}
          name: http1
        - containerPort: {{ .Values.service.http2Port }}
          name: http2
Sagar Arora's avatar
Sagar Arora committed
75
76
77
78
79
80
81
82
        {{- if .Values.resources.define}}
        resources:
          requests:
            memory: {{ .Values.resources.requests.memory | quote }}
            cpu: {{ .Values.resources.requests.cpu | quote }}
          limits:
            memory: {{ .Values.resources.limits.memory | quote }}
            cpu: {{ .Values.resources.limits.cpu | quote }}
83
        {{- end}}
Mohammed Ismail's avatar
Mohammed Ismail committed
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
        env:
          - name: INSTANCE
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: instance
          - name: PID_DIRECTORY
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: pidDirectory
          - name: SMF_INTERFACE_NAME_FOR_N4
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfInterfaceNameForN4
          - name: SMF_INTERFACE_NAME_FOR_SBI
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfInterfaceNameForSBI
          - name: SMF_INTERFACE_PORT_FOR_SBI
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfInterfacePortForSBI
          - name: SMF_INTERFACE_HTTP2_PORT_FOR_SBI
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfInterfaceHttp2PortForSBI
          - name: SMF_API_VERSION
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfApiVersion
          - name: DEFAULT_DNS_IPV4_ADDRESS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: dnsIpv4Address
          - name: DEFAULT_DNS_SEC_IPV4_ADDRESS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: dnsSecIpv4Address
          - name: REGISTER_NRF
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: registerNrf
          - name: DISCOVER_UPF
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: discoverUpf
140
141
142
143
144
          - name: USE_FQDN_DNS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: useFqdnDns
Mohammed Ismail's avatar
Mohammed Ismail committed
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
          - name: AMF_IPV4_ADDRESS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: amfIpv4Address
          - name: AMF_PORT
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: amfPort
          - name: AMF_API_VERSION
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: amfApiVersion
160
161
162
163
164
          - name: AMF_FQDN
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: amfFqdn
Mohammed Ismail's avatar
Mohammed Ismail committed
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
          - name: UDM_IPV4_ADDRESS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: udmIpv4Address
          - name: UDM_PORT
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: udmPort
          - name: UDM_API_VERSION
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: udmApiVersion
180
181
182
183
184
          - name: UDM_FQDN
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: udmFqdn
Mohammed Ismail's avatar
Mohammed Ismail committed
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
          - name: NRF_IPV4_ADDRESS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfIpv4Address
          - name: NRF_PORT
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfPort
          - name: NRF_API_VERSION
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfApiVersion
200
201
202
203
204
          - name: NRF_FQDN
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfFqdn
Mohammed Ismail's avatar
Mohammed Ismail committed
205
206
207
208
209
          - name: UPF_IPV4_ADDRESS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: upfIpv4Address
210
211
212
213
214
215
216
217
218
219
220
          - name: UPF_FQDN_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: upfFqdn0
        {{- if .Values.start.smf}}
        {{- else}}
        command:
          - /bin/sleep
          - infinity
        {{- end}}
221
      volumes:
222
      {{- if .Values.persistence.sharedvolume}}
223
      - name: cn5g-pv
224
        persistenceVolumeClaim:
225
          claimName: cn5g-pvc
Sagar Arora's avatar
Sagar Arora committed
226
      {{- end }}
227
228
229
      - name: scripts
        configMap:
          name: health-cm
Mohammed Ismail's avatar
Mohammed Ismail committed
230
231
232
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      serviceAccountName: {{ .Values.serviceAccount.name }}
Sagar Arora's avatar
Sagar Arora committed
233
234
235
236
237
238
239
      terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
      {{- if .Values.nodeSelector}}
      nodeSelector: {{- toYaml .Values.nodeSelector | nindent 4 }}
      {{- end }}
      {{- if .Values.nodeName}}
      nodeName: {{ .Values.nodeName }}
      {{- end }}