apiVersion: apps/v1
kind: Deployment
metadata:
  name: oai-mme
  labels:
    app: oai-mme
spec:
  replicas: 1
  selector:
    matchLabels:
      app: oai-mme
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: oai-mme
      annotations:
        k8s.v1.cni.cncf.io/networks: mme-net1, mme-net2
    spec:
      securityContext:
        runAsUser: 0
        runAsGroup: 0
      containers:
      - name: mme
        image: image-registry.openshift-image-registry.svc:5000/oai/oai-mme:develop-vco3
        imagePullPolicy: Always
        #command: ['sh', '-c', 'sleep 6000']
        securityContext:
          privileged: true
        volumeMounts:
        - name: certs
          mountPath: /opt/oai-mme/certs
        ports:
        - containerPort: 3870
          name: oai-mme
        - containerPort: 5870
          name: oai-mme-secure
        - containerPort: 2123
          name: s11
        env:
          # MME env vars
          - name: MME_SERVICE
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: mme_service
          - name: MME_REALM
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: mme_realm
          - name: MME_GID
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: mme_gid
          - name: MME_CODE
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: mme_code
          - name: NW_IF_S1C
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: nw_if_s1c
          - name: NW_IF_S11
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: nw_if_s11
          - name: NW_IF_S10
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: nw_if_s10
          - name: MCC
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: mcc
          - name: MNC
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: mnc
          - name: TAC
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: tac
          - name: MME_CIDR_S1C
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: mme_cidr_s1c
          - name: MME_CIDR_S11
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: mme_cidr_s11
          - name: MME_CIDR_S10
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: mme_cidr_s10
          - name: SGW_CIDR_S11
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: sgw_cidr_s11
          - name: HSS_SERVICE
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: hss_service
          - name: HSS_REALM
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: hss_realm
          - name: HSS_HOSTNAME
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: hss_hostname
          - name: HSS_IP
            valueFrom:
              configMapKeyRef:
                name: mme-config
                key: hss_ip
      - name: tcpdump
        image: corfr/tcpdump
        command:
          - /bin/sleep
          - infinity
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      serviceAccountName: mme-sa
      terminationGracePeriodSeconds: 30
      volumes:
      - name: certs
        secret:
          secretName: mme-tls-secret
