deployment.yaml 3.58 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-nrf.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.replicaCount }}
  selector:
    matchLabels:
      {{- include "oai-nrf.selectorLabels" . | nindent 6 }}
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        {{- include "oai-nrf.selectorLabels" . | nindent 8 }}
Sagar Arora's avatar
Sagar Arora committed
18
19
20
21
    {{- if .Values.multus.create }}
      annotations:
        k8s.v1.cni.cncf.io/networks: "{{ .Chart.Name }}-{{ .Values.namespace }}-net1"
    {{- 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
Sagar Arora's avatar
Sagar Arora committed
32
          - /usr/sbin/tcpdump -i any -w /pcap/{{ .Chart.Name }}_`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: nrf
Sagar Arora's avatar
Sagar Arora committed
44
        image: "{{ .Values.nfimage.repository }}:{{ .Values.nfimage.version }}"
Sagar Arora's avatar
Sagar Arora committed
45
46
47
48
49
50
51
52
53
        {{- 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
54
55
56
57
58
59
60
61
62
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
        securityContext:
          {{- toYaml .Values.securityContext | nindent 12 }}
        ports:
        - containerPort: {{ .Values.service.http1Port }}
          name: http1
          protocol: TCP
        - containerPort: {{ .Values.service.http2Port }}
          name: http2
          protocol: TCP
        env:
          - name: INSTANCE
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: instance
          - name: PID_DIRECTORY
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: pidDirectory
          - name: NRF_INTERFACE_NAME_FOR_SBI
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfInterfaceNameForSBI
          - name: NRF_INTERFACE_PORT_FOR_SBI
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfInterfacePortForSBI
          - name: NRF_INTERFACE_HTTP2_PORT_FOR_SBI
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfInterfaceHttp2PortForSBI
          - name: NRF_API_VERSION
            valueFrom:
              configMapKeyRef:
                name: {{ .Chart.Name }}-configmap
                key: nrfApiVersion
Sagar Arora's avatar
Sagar Arora committed
94
      {{- if .Values.persistence.sharedvolume}}
95
96
97
98
      volumes:
      - name: cn5g-pv
        persistentVolumeClaim:
          claimName: cn5g-pvc
Sagar Arora's avatar
Sagar Arora committed
99
      {{- end }}
Mohammed Ismail's avatar
Mohammed Ismail committed
100
101
102
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      serviceAccountName: {{ .Values.serviceAccount.name }}
Sagar Arora's avatar
Sagar Arora committed
103
104
105
106
107
108
109
      terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
      {{- if .Values.nodeSelector}}
      nodeSelector: {{- toYaml .Values.nodeSelector | nindent 4 }}
      {{- end }}
      {{- if .Values.nodeName}}
      nodeName: {{ .Values.nodeName }}
      {{- end }}
Mohammed Ismail's avatar
Mohammed Ismail committed
110