apiVersion: apps/v1 
kind: Deployment
metadata:
  name: open5gs-udr-deployment
spec:
  selector:
    matchLabels:
      app: open5gs-udr
  replicas: 1
  template:
    metadata:
      labels:
        app: open5gs-udr
    spec:
      containers:      
      - name: myapp-container
        image: free5gmano/open5gs:v2.1.7
        imagePullPolicy: IfNotPresent
        command: ["/bin/sh"]
        args: ["-c", "./bin/open5gs-udrd"]
        volumeMounts:
        - name: open5gs-udrcfg
          mountPath: /open5gs/install/etc/open5gs/udr.yaml
          subPath: udr.yaml
      initContainers:
      - name: init-network-client
        image: sdnvortex/network-controller:v0.4.9
        command: ["/go/bin/client"]
        args: ["-s=unix:///tmp/vortex.sock", "-b=br0", "-n=eth1", "-i=192.168.2.16/23", "-g=192.168.3.254"]
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: POD_UUID
          valueFrom:
            fieldRef:
              fieldPath: metadata.uid
        volumeMounts:
        - mountPath: /tmp/
          name: grpc-sock
      volumes:
      - name: grpc-sock
        hostPath:
          path: /tmp/vortex/
      - name: open5gs-udrcfg
        configMap:
          name: open5gs-configmap
          items: 
          - key: udr.yaml
            path: udr.yaml

