kind: Deployment
apiVersion: apps/v1
metadata:
  labels:
    cluster: management
    component: vpn-server
  name: vpn-server
  namespace: __NPH_NAMESPACE
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      cluster: management
      component: vpn-server
  template:
    metadata:
      labels:
        cluster: management
        component: vpn-server
    spec:
      containers:
        - name: vpn-server
          image: __NPH_REGISTRY_NAMESPACE/vpn-server:__NPH_VERSION
          imagePullPolicy: Always
          args:
            - "run"
            - "--vpnServerAddress=localhost"
            - "--port=5666"
          securityContext:
            runAsUser: 0
            capabilities:
              add:
                - NET_ADMIN
                - SYS_ADMIN
          volumeMounts:
            - name: dev-net-tun
              readOnly: true
              mountPath: /dev/net/tun
            - name: vpn-server-data
              mountPath: /vpnserver
          ports:
            - containerPort: 5555
              name: vpn-port
              protocol: TCP
            - containerPort: 5666
              name: grpc-port
              protocol: TCP
      volumes:
        - name: dev-net-tun
          hostPath:
            path: /dev/net/tun
        - name: vpn-server-data
          persistentVolumeClaim:
            claimName: vpn-server-data
