apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: sdn-controller
  namespace: kube-system
  labels:
    tier: sdn
    app: sdn-controller
spec:
  updateStrategy:
    type: RollingUpdate
  selector:
    matchLabels:
      tier: sdn
      app: sdn-controller
  template:
    metadata:
      name: sdn-controller
      labels:
        tier: sdn
        app: sdn-controller
    spec:
      tolerations:
      - effect: NoSchedule
        key: node.kubernetes.io/not-ready
        operator: Exists
      - effect: NoExecute
        key: node.kubernetes.io/not-ready
        operator: Exists
      priorityClassName: "system-node-critical"
      hostNetwork: true
      hostPID: true
      containers:
      - name: sdn-controller
        image: sdn-controller
        imagePullPolicy: IfNotPresent
        securityContext:
          privileged: true
        env:
        - name: BRIDGE_NAME
          value: "bridge0"
        - name: BRIDGE_ADDRESS
          value: "192.168.5.1/24"
        - name: NAT_INTERFACE
          value: "eth0"
        volumeMounts:
        - name: netns
          mountPath: /var/run/netns
          readOnly: false
      volumes:
      - name: netns
        hostPath:
          path: /var/run/netns
