apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: controller-manager
  namespace: system
  labels:
    control-plane: controller-manager
spec:
  selector:
    matchLabels:
      control-plane: controller-manager
  template:
    metadata:
      labels:
        control-plane: controller-manager
    spec:
      tolerations:
        - key: node-role.kubernetes.io/master
          operator: "Exists"
          effect: NoSchedule
      containers:
      - command:
        - /manager
        image: controller:latest
        imagePullPolicy: IfNotPresent
        name: manager
        securityContext:
          privileged: true
        env:
          - name: K8S_NODE_NAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
          - name: K8S_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
        volumeMounts:
        - name: host
          mountPath: /host
      terminationGracePeriodSeconds: 10
      hostNetwork: true
      volumes:
        - name: host
          hostPath:
            path: /
