deployment.yaml 10.3 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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 }}
      annotations:
        k8s.v1.cni.cncf.io/networks: >-
          [{
                 "name": "{{ .Chart.Name }}-{{ .Values.namespace }}-ngap-net1",
                 "default-route": ["{{ .Values.multus.ngapGateway }}"]
          }]
    spec:
      securityContext:
        {{- toYaml .Values.podSecurityContext | nindent 8 }}
    {{- if .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
    {{- end }}
      containers:
      - name: tcpdump
        image: image-registry.openshift-image-registry.svc:5000/oai/tcpdump-internal:latest
34
        {{- if .Values.start.tcpdump}}
Mohammed Ismail's avatar
Mohammed Ismail committed
35
        command:
36
37
          - /bin/sh
          - -c
38
          - /usr/sbin/tcpdump -i any -w /pcap/oai-amf_`date +%Y-%m-%d_%H_%M-%S-%Z`.pcap
39
40
41
42
43
        {{- else}}
        command:
          - /bin/sleep
          - infinity
        {{- end}}
44
45
46
        volumeMounts:
        - mountPath: "/pcap"
          name: cn5g-pv
Mohammed Ismail's avatar
Mohammed Ismail committed
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
      - name: amf
        image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
        imagePullPolicy: {{ .Values.image.pullPolicy }}
        securityContext:
          {{- toYaml .Values.securityContext | nindent 12 }}
        ports:
        - containerPort: {{ .Values.service.sctpPort }}
          name: oai-amf
          protocol: SCTP
        - containerPort: {{ .Values.service.http1Port }}
          name: http1
          protocol: TCP
        - containerPort: {{ .Values.service.http2Port }}
          name: http2
          protocol: TCP
62
63
64
65
66
67
        {{- if .Values.start.amf}}
        {{- else}}
        command:
          - /bin/sleep
          - infinity
        {{- end}}
Mohammed Ismail's avatar
Mohammed Ismail committed
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
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
        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
199
200
201
202
203
204
205
206
207
208
          - name: SMF_FQDN_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfFqdn0
          - name: SELECTED_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: selected0
Mohammed Ismail's avatar
Mohammed Ismail committed
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
          - 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
224
225
226
227
228
229
230
231
232
233
          - name: SMF_FQDN_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfFqdn1
          - name: SELECTED_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: selected1
Mohammed Ismail's avatar
Mohammed Ismail committed
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
          - 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
249
250
251
252
253
          - name: NRF_FQDN
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfFqdn
Mohammed Ismail's avatar
Mohammed Ismail committed
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
          - 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
          - name: NF_REGISTRATION
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nfRegistration
          - name: SMF_SELECTION
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfSelection
279
280
281
282
283
          - name: USE_FQDN_DNS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: useFqdnDns
Mohammed Ismail's avatar
Mohammed Ismail committed
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
          - 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
309
310
311
312
      volumes:
      - name: cn5g-pv
        persistentVolumeClaim:
          claimName: cn5g-pvc
Mohammed Ismail's avatar
Mohammed Ismail committed
313
314
315
316
317
318
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      serviceAccountName: {{ .Values.serviceAccount.name }}
      terminationGracePeriodSeconds: 15