apiVersion: apps/v1
kind: Deployment
metadata:
  name: vsr
spec:
  replicas: 1
  selector:
    matchLabels:
      role: vsr
  template:
    metadata:
      labels:
        role: vsr
      annotations:
         k8s.v1.cni.cncf.io/networks: multus-intel-sriov-nic-vsr1,multus-intel-sriov-nic-vsr2
         container.apparmor.security.beta.kubernetes.io/vsr: unconfined
    spec:
      restartPolicy: Always
      securityContext:
        sysctls:
        - name: net.ipv4.conf.default.disable_policy
          value: "1"
        - name: net.ipv4.ip_local_port_range
          value: "30000 40000"
        - name: net.ipv4.ip_forward
          value: "1"
        - name: net.ipv6.conf.all.forwarding
          value: "1"
      containers:
      - image: download.6wind.com/vsr/x86_64-ce/3.8:3.8.12
        imagePullPolicy: IfNotPresent
        name: vsr
        resources:
          limits:
            cpu: "4"
            memory: "2Gi"
            hugepages-1Gi: 8Gi
            intel.com/intel_sriov_nic_vsr1: '1'
            intel.com/intel_sriov_nic_vsr2: '1'
            smarter-devices/ppp: 1
          requests:
            cpu: "4"
            memory: "2Gi"
            hugepages-1Gi: 8Gi
            intel.com/intel_sriov_nic_vsr1: '1'
            intel.com/intel_sriov_nic_vsr2: '1'
            smarter-devices/ppp: 1
        env:
        securityContext:
          capabilities:
            add: ["NET_ADMIN", "NET_RAW", "SYS_ADMIN", "SYS_NICE", "IPC_LOCK", "NET_BROADCAST", "SYSLOG"]
        volumeMounts:
        - mountPath: /dev/hugepages
          name: hugepage
        - mountPath: /dev/shm
          name: shm
        - mountPath: /dev/net/tun
          name: net
        - mountPath: /tmp
          name: tmp
        - mountPath: /run
          name: run
        - mountPath: /run/lock
          name: run-lock
        stdin: true
        tty: true
      imagePullSecrets:
      - name: regcred
      volumes:
      - emptyDir:
          medium: HugePages
          sizeLimit: 8Gi
        name: hugepage
      - name: shm
        emptyDir:
          sizeLimit: "512Mi"
          medium: "Memory"
      - hostPath:
          path: /dev/net/tun
          type: ""
        name: net
      - emptyDir:
          sizeLimit: "200Mi"
          medium: "Memory"
        name: tmp
      - emptyDir:
          sizeLimit: "200Mi"
          medium: "Memory"
        name: run
      - emptyDir:
          sizeLimit: "200Mi"
          medium: "Memory"
        name: run-lock
