deployment.yaml 10.5 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: corfr/tcpdump:latest
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.persistent.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
48
      - name: amf
        image: "{{ .Values.image.repository }}:{{ .Values.image.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
60
        securityContext:
          {{- toYaml .Values.securityContext | nindent 12 }}
        ports:
Sagar Arora's avatar
Sagar Arora committed
61
        - containerPort: {{ .Values.service.n1Port }}
Mohammed Ismail's avatar
Mohammed Ismail committed
62
63
64
65
66
67
68
69
          name: oai-amf
          protocol: SCTP
        - containerPort: {{ .Values.service.http1Port }}
          name: http1
          protocol: TCP
        - containerPort: {{ .Values.service.http2Port }}
          name: http2
          protocol: TCP
70
71
72
73
74
75
        {{- if .Values.start.amf}}
        {{- else}}
        command:
          - /bin/sleep
          - infinity
        {{- end}}
Mohammed Ismail's avatar
Mohammed Ismail committed
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
199
200
201
202
203
204
205
206
        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
207
208
209
210
211
          - name: SMF_FQDN_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfFqdn0
Mohammed Ismail's avatar
Mohammed Ismail committed
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
          - 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
227
228
229
230
231
          - name: SMF_FQDN_1
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: smfFqdn1
Mohammed Ismail's avatar
Mohammed Ismail committed
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
          - 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
247
248
249
250
251
          - name: NRF_FQDN
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfFqdn
Mohammed Ismail's avatar
Mohammed Ismail committed
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
          - 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
277
278
279
280
281
          - name: USE_FQDN_DNS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: useFqdnDns
Mohammed Ismail's avatar
Mohammed Ismail committed
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
          - 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
Sagar Arora's avatar
Sagar Arora committed
307
      {{- if .Values.persistent.sharedvolume}}
308
309
310
311
      volumes:
      - name: cn5g-pv
        persistentVolumeClaim:
          claimName: cn5g-pvc
Sagar Arora's avatar
Sagar Arora committed
312
      {{- end }}
Mohammed Ismail's avatar
Mohammed Ismail committed
313
314
315
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      serviceAccountName: {{ .Values.serviceAccount.name }}
Sagar Arora's avatar
Sagar Arora committed
316
317
318
319
320
321
322
      terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
      {{- if .Values.nodeSelector}}
      nodeSelector: {{- toYaml .Values.nodeSelector | nindent 4 }}
      {{- end }}
      {{- if .Values.nodeName}}
      nodeName: {{ .Values.nodeName }}
      {{- end }}