---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: network
    app.kubernetes.io/name: harvester-network-controller-manager
    app.kubernetes.io/version: 0.2.0
  name: harvester-network-controller-manager
  namespace: harvester-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/component: network
      app.kubernetes.io/name: harvester-network-controller-manager
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app.kubernetes.io/component: network
        app.kubernetes.io/name: harvester-network-controller-manager
        app.kubernetes.io/version: 0.2.0
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: beta.kubernetes.io/os
                    operator: In
                    values:
                      - linux
              - matchExpressions:
                  - key: kubernetes.io/os
                    operator: In
                    values:
                      - linux
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - podAffinityTerm:
                labelSelector:
                  matchExpressions:
                    - key: app.kubernetes.io/name
                      operator: In
                      values:
                        - harvester-network-controller-manager
                    - key: app.kubernetes.io/component
                      operator: In
                      values:
                        - network
                topologyKey: kubernetes.io/hostname
              weight: 1
      containers:
        - image: rancher/harvester-network-controller:master-head
          imagePullPolicy: IfNotPresent
          name: harvester-manager-network-controller
          command:
            - harvester-network-controller
          args:
            - manager
            - --enable-vip-controller
          env:
            - name: NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          resources:
            limits:
              cpu: 500m
              memory: 500Mi
            requests:
              cpu: 250m
              memory: 256Mi
          securityContext:
            capabilities:
              add:
                - NET_RAW
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      serviceAccountName: harvester-network-controller
      hostNetwork: true
