deployment.yaml 11.8 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-amf.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      {{- include "oai-amf.selectorLabels" . | nindent 6 }}
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        {{- include "oai-amf.selectorLabels" . | nindent 8 }}
Sagar Arora's avatar
Sagar Arora committed
18
    {{- if .Values.multus.create }}
Mohammed Ismail's avatar
Mohammed Ismail committed
19
20
21
      annotations:
        k8s.v1.cni.cncf.io/networks: >-
          [{
Sagar Arora's avatar
Sagar Arora committed
22
23
                 "name": "{{ .Chart.Name }}-{{ .Values.namespace }}-n1-net1",
                 "default-route": ["{{ .Values.multus.n1Gateway }}"]
Mohammed Ismail's avatar
Mohammed Ismail committed
24
          }]
Sagar Arora's avatar
Sagar Arora committed
25
    {{- end }}
Mohammed Ismail's avatar
Mohammed Ismail committed
26
27
28
29
30
    spec:
      securityContext:
        {{- toYaml .Values.podSecurityContext | nindent 8 }}
      containers:
      - name: tcpdump
Sagar Arora's avatar
Sagar Arora committed
31
        image: "{{ .Values.tcpdumpimage.repository }}:{{ .Values.tcpdumpimage.version }}"
32
        {{- if .Values.start.tcpdump}}
Mohammed Ismail's avatar
Mohammed Ismail committed
33
        command:
34
35
          - /bin/sh
          - -c
Sagar Arora's avatar
Sagar Arora committed
36
          - /usr/sbin/tcpdump -i any -w /pcap/{{ .Chart.Name }}_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
37
38
39
40
41
        {{- else}}
        command:
          - /bin/sleep
          - infinity
        {{- end}}
Sagar Arora's avatar
Sagar Arora committed
42
        {{- if .Values.persistence.sharedvolume}}
43
44
45
        volumeMounts:
        - mountPath: "/pcap"
          name: cn5g-pv
Sagar Arora's avatar
Sagar Arora committed
46
        {{- end}}
Mohammed Ismail's avatar
Mohammed Ismail committed
47
      - name: amf
Sagar Arora's avatar
Sagar Arora committed
48
        image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}"
Sagar Arora's avatar
Sagar Arora committed
49
50
51
52
53
54
55
56
57
        {{- 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 }}
        {{- end}}
Mohammed Ismail's avatar
Mohammed Ismail committed
58
59
        securityContext:
          {{- toYaml .Values.securityContext | nindent 12 }}
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
        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
81
        ports:
Sagar Arora's avatar
Sagar Arora committed
82
        - containerPort: {{ .Values.service.sctpPort }}
Mohammed Ismail's avatar
Mohammed Ismail committed
83
84
85
86
87
88
89
90
          name: oai-amf
          protocol: SCTP
        - containerPort: {{ .Values.service.http1Port }}
          name: http1
          protocol: TCP
        - containerPort: {{ .Values.service.http2Port }}
          name: http2
          protocol: TCP
91
92
93
94
95
96
        {{- if .Values.start.amf}}
        {{- else}}
        command:
          - /bin/sleep
          - infinity
        {{- end}}
Mohammed Ismail's avatar
Mohammed Ismail committed
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
        env:
          - name: INSTANCE
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: instance
          - name: PID_DIRECTORY
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: pidDirectory
          - name: MCC
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: mcc
          - name: MNC
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: mnc
          - name: REGION_ID
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: regionId
          - name: AMF_SET_ID
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: amfsetId
          - name: SERVED_GUAMI_MCC_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: servedGuamiMcc0
          - name: SERVED_GUAMI_MNC_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: servedGuamiMnc0
          - name: SERVED_GUAMI_REGION_ID_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: servedGuamiRegionId0
          - name: SERVED_GUAMI_AMF_SET_ID_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: servedGuamiAmfSetId0
          - name: SERVED_GUAMI_MCC_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: servedGuamiMcc1
          - name: SERVED_GUAMI_MNC_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: servedGuamiMnc1
          - name: SERVED_GUAMI_REGION_ID_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: servedGuamiRegionId1
          - name: SERVED_GUAMI_AMF_SET_ID_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: servedGuamiAmfSetId1
          - name: PLMN_SUPPORT_MCC
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: plmnSupportMcc
          - name: PLMN_SUPPORT_MNC
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: plmnSupportMnc
          - name: PLMN_SUPPORT_TAC
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: plmnSupportTac
          - name: SST_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: sst0
          - name: SD_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: sd0
          - name: SST_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: sst1
          - name: SD_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: sd1
          - name: AMF_INTERFACE_NAME_FOR_NGAP
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: amfInterfaceNameForNGAP
          - name: AMF_INTERFACE_NAME_FOR_N11
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: amfInterfaceNameForN11
          - name: SMF_INSTANCE_ID_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfInstanceId0
          - name: SMF_IPV4_ADDR_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfIpv4Addr0
          - name: SMF_HTTP_VERSION_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfHttpVersion0
228
229
230
231
232
          - name: SMF_FQDN_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfFqdn0
Mohammed Ismail's avatar
Mohammed Ismail committed
233
234
235
236
237
          - name: SELECTED_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: selected0
Mohammed Ismail's avatar
Mohammed Ismail committed
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
          - name: SMF_INSTANCE_ID_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfInstanceId1
          - name: SMF_IPV4_ADDR_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfIpv4Addr1
          - name: SMF_HTTP_VERSION_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfHttpVersion1
253
254
255
256
257
          - name: SMF_FQDN_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfFqdn1
Mohammed Ismail's avatar
Mohammed Ismail committed
258
259
260
261
262
          - name: SELECTED_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: selected1
Mohammed Ismail's avatar
Mohammed Ismail committed
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
          - name: NRF_IPV4_ADDRESS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfIpv4Addr
          - name: NRF_PORT
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfPort
          - name: NRF_API_VERSION
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfApiVersion
278
279
280
281
282
          - name: NRF_FQDN
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfFqdn
Mohammed Ismail's avatar
Mohammed Ismail committed
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
          - name: AUSF_IPV4_ADDRESS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: ausfIpv4Addr
          - name: AUSF_PORT
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: ausfPort
          - name: AUSF_API_VERSION
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: ausfApiVersion
Mohammed Ismail's avatar
Mohammed Ismail committed
298
299
300
301
302
          - name: AUSF_FQDN
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: ausfFqdn
Mohammed Ismail's avatar
Mohammed Ismail committed
303
304
305
306
307
308
309
310
311
312
          - name: NF_REGISTRATION
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nfRegistration
          - name: SMF_SELECTION
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfSelection
313
314
315
316
317
          - name: USE_FQDN_DNS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: useFqdnDns
Mohammed Ismail's avatar
Mohammed Ismail committed
318
319
320
321
322
          - name: EXTERNAL_AUSF
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: externalAusf
Mohammed Ismail's avatar
Mohammed Ismail committed
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
          - name: MYSQL_SERVER
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: mySqlServer
          - name: MYSQL_USER
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: mySqlUser
          - name: MYSQL_PASS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: mySqlPass
          - name: MYSQL_DB
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: mySqlDb
          - name: OPERATOR_KEY
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: operatorKey
348
      volumes:
349
      {{- if .Values.persistence.sharedvolume}}
350
      - name: cn5g-pv
Sagar Arora's avatar
Sagar Arora committed
351
        persistenceVolumeClaim:
352
          claimName: cn5g-pvc
Sagar Arora's avatar
Sagar Arora committed
353
      {{- end }}
354
355
      - name: scripts
        configMap:
Sagar Arora's avatar
Sagar Arora committed
356
          name: {{ .Chart.Name }}-health-cm
Mohammed Ismail's avatar
Mohammed Ismail committed
357
358
359
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      serviceAccountName: {{ .Values.serviceAccount.name }}
Sagar Arora's avatar
Sagar Arora committed
360
361
362
363
364
365
      terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
      {{- if .Values.nodeSelector}}
      nodeSelector: {{- toYaml .Values.nodeSelector | nindent 4 }}
      {{- end }}
      {{- if .Values.nodeName}}
      nodeName: {{ .Values.nodeName }}
Mohammed Ismail's avatar
Mohammed Ismail committed
366
      {{- end }}