deployment.yaml 7 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: corfr/tcpdump:latest
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
44
45
46
47
      - name: smf
        image: "{{ .Values.image.repository }}:{{ .Values.image.version }}"
        securityContext:
          {{- toYaml .Values.securityContext | nindent 12 }}
        ports:
Sagar Arora's avatar
Sagar Arora committed
48
        - containerPort: {{ .Values.service.n4Port }}
Mohammed Ismail's avatar
Mohammed Ismail committed
49
50
51
52
53
          name: oai-smf
        - containerPort: {{ .Values.service.http1Port }}
          name: http1
        - containerPort: {{ .Values.service.http2Port }}
          name: http2
Sagar Arora's avatar
Sagar Arora committed
54
55
56
57
58
59
60
61
        {{- 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 }}
62
        {{- end}}
Mohammed Ismail's avatar
Mohammed Ismail committed
63
64
65
66
67
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
        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
119
120
121
122
123
          - name: USE_FQDN_DNS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: useFqdnDns
Mohammed Ismail's avatar
Mohammed Ismail committed
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
          - 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
139
140
141
142
143
          - name: AMF_FQDN
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: amfFqdn
Mohammed Ismail's avatar
Mohammed Ismail committed
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
          - 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
159
160
161
162
163
          - name: UDM_FQDN
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: udmFqdn
Mohammed Ismail's avatar
Mohammed Ismail committed
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
          - 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
179
180
181
182
183
          - name: NRF_FQDN
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfFqdn
Mohammed Ismail's avatar
Mohammed Ismail committed
184
185
186
187
188
          - name: UPF_IPV4_ADDRESS
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: upfIpv4Address
189
190
191
192
193
194
195
196
197
198
199
          - name: UPF_FQDN_0
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: upfFqdn0
        {{- if .Values.start.smf}}
        {{- else}}
        command:
          - /bin/sleep
          - infinity
        {{- end}}
Sagar Arora's avatar
Sagar Arora committed
200
      {{- if .Values.persistence.sharedvolume}}
201
202
203
204
      volumes:
      - name: cn5g-pv
        persistentVolumeClaim:
          claimName: cn5g-pvc
Sagar Arora's avatar
Sagar Arora committed
205
      {{- end }}
Mohammed Ismail's avatar
Mohammed Ismail committed
206
207
208
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      serviceAccountName: {{ .Values.serviceAccount.name }}
Sagar Arora's avatar
Sagar Arora committed
209
210
211
212
213
214
215
      terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
      {{- if .Values.nodeSelector}}
      nodeSelector: {{- toYaml .Values.nodeSelector | nindent 4 }}
      {{- end }}
      {{- if .Values.nodeName}}
      nodeName: {{ .Values.nodeName }}
      {{- end }}