apiVersion: apps/v1
kind: Deployment
metadata:
  name: cds-cloud-controller-manager
  namespace: kube-system
spec:
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: cds-cloud-controller-manager
  template:
    metadata:
      labels:
        app: cds-cloud-controller-manager
      annotations:
        scheduler.alpha.kubernetes.io/critical-pod: ''
    spec:
      dnsPolicy: Default
      hostNetwork: true
      serviceAccountName: cloud-controller-manager
      tolerations:
      # this taint is set by all kubelets running `--cloud-provider=external`
      # so we should tolerate it to schedule the digitalocean ccm
      - key: "node.cloudprovider.kubernetes.io/uninitialized"
        value: "true"
        effect: "NoSchedule"
      - key: "CriticalAddonsOnly"
        operator: "Exists"
      # cloud controller manages should be able to run on masters
      - key: "node-role.kubernetes.io/master"
        effect: NoSchedule
      containers:
      - image: registry-bj.capitalonline.net/cck/cdscloud-controller-manager:v1.0.3
        name: cds-cloud-controller-manager
        imagePullPolicy: Always
        args:
        - "--leader-elect=false"
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        env:
        - name: CDS_ACCESS_KEY_ID
          valueFrom:
            secretKeyRef:
              name: cck-secrets
              key: access_key_id
        - name: CDS_ACCESS_KEY_SECRET
          valueFrom:
            secretKeyRef:
              name: cck-secrets
              key: access_key_secret
        - name: CDS_CLUSTER_ID
          valueFrom:
            configMapKeyRef:
              name: cds-properties
              key: k8s_cluster_id
        - name: CDS_CLUSTER_REGION_ID
          valueFrom:
            configMapKeyRef:
              name: cds-properties
              key: site_id
        - name: CDS_OVERSEA
          valueFrom:
            configMapKeyRef:
              name: cds-properties
              key: oversea
