apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: vultr-ccm
  labels:
    app: vultr-ccm
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app: vultr-ccm
  template:
    metadata:
      labels:
        app: vultr-ccm
    spec:
      serviceAccountName: vultr-ccm
      nodeSelector:
        "node-role.kubernetes.io/master": ""
      tolerations:
        - key: "node-role.kubernetes.io/master"
          effect: NoSchedule
        - key: "CriticalAddonsOnly"
          operator: "Exists"
        - key: "node.cloudprovider.kubernetes.io/uninitialized"
          value: "true"
          effect: "NoSchedule"
        - key: node.kubernetes.io/not-ready
          operator: Exists
          effect: NoSchedule
        - key: node.kubernetes.io/unreachable
          operator: Exists
          effect: NoSchedule
      hostNetwork: true
      containers:
        - image: vultr/vultr-cloud-controller-manager:{{ .Values.vultrCCMRelease }}
          name: vultr-cloud-controller-manager
          command:
            - "/vultr-cloud-controller-manager"
            - "--cloud-provider=vultr"
            - "--allow-untagged-cloud=true"
            - "--authentication-skip-lookup=true"
            - "--v=3"
          env:
            - name: VULTR_API_KEY
              valueFrom:
                secretKeyRef:
                  name: vultr-helm-secret
                  key: api-key