apiVersion: apps/v1
kind: Deployment
metadata:
  name: ueransim-ue-deployment
  labels:
    app: ueransim-ue
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ueransim-ue
  template:
    metadata:
      labels:
        app: ueransim-ue
    spec:
      containers:
      - name: ueransim-ue
        imagePullPolicy: IfNotPresent
        image: free5gmano/ueransim:v3.0.2
        securityContext:
          privileged: true
        command: ["/bin/bash", "-c"]
        args: ["./build/nr-ue -c ./config/free5gc-ue.yaml"]
        volumeMounts:
        - mountPath: /dev/net/tun
          name: tun-volume
        - name: ue-conf
          mountPath: /UERANSIM/config/free5gc-ue.yaml
          subPath: free5gc-ue.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.172/23"]
        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: tun-volume
        hostPath:
          path: /dev/net/tun
      - name: ue-conf
        configMap:
          name: ueransim-configmap
          items: 
          - key: free5gc-ue.yaml
            path: free5gc-ue.yaml
