apiVersion: apps/v1
kind: DaemonSet
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-cloud-controller.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    k8s-addon: aws-cloud-controller.addons.k8s.io
    k8s-app: aws-cloud-controller-manager
  name: aws-cloud-controller-manager
  namespace: kube-system
spec:
  selector:
    matchLabels:
      k8s-app: aws-cloud-controller-manager
  template:
    metadata:
      creationTimestamp: null
      labels:
        k8s-app: aws-cloud-controller-manager
        kops.k8s.io/managed-by: kops
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: node-role.kubernetes.io/control-plane
                operator: Exists
            - matchExpressions:
              - key: node-role.kubernetes.io/master
                operator: Exists
      containers:
      - args:
        - --allocate-node-cidrs=true
        - --cluster-cidr=100.64.0.0/10
        - --cluster-name=dev.datasaker.io
        - --configure-cloud-routes=false
        - --leader-elect=true
        - --v=2
        - --cloud-provider=aws
        - --use-service-account-credentials=true
        - --cloud-config=/etc/kubernetes/cloud.config
        env:
        - name: KUBERNETES_SERVICE_HOST
          value: 127.0.0.1
        image: registry.k8s.io/provider-aws/cloud-controller-manager:v1.25.0@sha256:d12285173cb301d08ce1a56256782478ec2ec334f3af345b9f753b8de2598aad
        imagePullPolicy: IfNotPresent
        name: aws-cloud-controller-manager
        resources:
          requests:
            cpu: 200m
        volumeMounts:
        - mountPath: /etc/kubernetes/cloud.config
          name: cloudconfig
          readOnly: true
      hostNetwork: true
      nodeSelector: null
      priorityClassName: system-cluster-critical
      serviceAccountName: aws-cloud-controller-manager
      tolerations:
      - effect: NoSchedule
        key: node.cloudprovider.kubernetes.io/uninitialized
        value: "true"
      - effect: NoSchedule
        key: node.kubernetes.io/not-ready
      - effect: NoSchedule
        key: node-role.kubernetes.io/control-plane
      - effect: NoSchedule
        key: node-role.kubernetes.io/master
      volumes:
      - hostPath:
          path: /etc/kubernetes/cloud.config
          type: ""
        name: cloudconfig
  updateStrategy:
    type: RollingUpdate

---

apiVersion: v1
kind: ServiceAccount
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-cloud-controller.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    k8s-addon: aws-cloud-controller.addons.k8s.io
  name: aws-cloud-controller-manager
  namespace: kube-system

---

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-cloud-controller.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    k8s-addon: aws-cloud-controller.addons.k8s.io
  name: cloud-controller-manager:apiserver-authentication-reader
  namespace: kube-system
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: extension-apiserver-authentication-reader
subjects:
- apiGroup: ""
  kind: ServiceAccount
  name: aws-cloud-controller-manager
  namespace: kube-system

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-cloud-controller.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    k8s-addon: aws-cloud-controller.addons.k8s.io
  name: system:cloud-controller-manager
rules:
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create
  - patch
  - update
- apiGroups:
  - ""
  resources:
  - nodes
  verbs:
  - '*'
- apiGroups:
  - ""
  resources:
  - nodes/status
  verbs:
  - patch
- apiGroups:
  - ""
  resources:
  - services
  verbs:
  - list
  - patch
  - update
  - watch
- apiGroups:
  - ""
  resources:
  - services/status
  verbs:
  - list
  - patch
  - update
  - watch
- apiGroups:
  - ""
  resources:
  - serviceaccounts
  verbs:
  - create
  - get
- apiGroups:
  - ""
  resources:
  - persistentvolumes
  verbs:
  - get
  - list
  - update
  - watch
- apiGroups:
  - ""
  resources:
  - endpoints
  verbs:
  - create
  - get
  - list
  - watch
  - update
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - create
  - get
  - list
  - watch
  - update
- apiGroups:
  - ""
  resources:
  - secrets
  verbs:
  - list
  - watch
- apiGroups:
  - ""
  resourceNames:
  - node-controller
  - service-controller
  - route-controller
  resources:
  - serviceaccounts/token
  verbs:
  - create

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: aws-cloud-controller.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    k8s-addon: aws-cloud-controller.addons.k8s.io
  name: system:cloud-controller-manager
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: system:cloud-controller-manager
subjects:
- apiGroup: ""
  kind: ServiceAccount
  name: aws-cloud-controller-manager
  namespace: kube-system