apiVersion: v1
data:
  config.yaml: |
    {"cloud":"aws","configBase":"s3://clusters.dev.datasaker.io/dev.datasaker.io","server":{"Listen":":3988","provider":{"aws":{"nodesRoles":["nodes.dev.datasaker.io"],"Region":"ap-northeast-2"}},"serverKeyPath":"/etc/kubernetes/kops-controller/pki/kops-controller.key","serverCertificatePath":"/etc/kubernetes/kops-controller/pki/kops-controller.crt","caBasePath":"/etc/kubernetes/kops-controller/pki","signingCAs":["kubernetes-ca"],"certNames":["kubelet","kubelet-server","kube-proxy"],"useInstanceIDForNodeName":true}}
kind: ConfigMap
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: kops-controller.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    k8s-addon: kops-controller.addons.k8s.io
  name: kops-controller
  namespace: kube-system

---

apiVersion: apps/v1
kind: DaemonSet
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: kops-controller.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    k8s-addon: kops-controller.addons.k8s.io
    k8s-app: kops-controller
    version: v1.25.0
  name: kops-controller
  namespace: kube-system
spec:
  selector:
    matchLabels:
      k8s-app: kops-controller
  template:
    metadata:
      annotations:
        dns.alpha.kubernetes.io/internal: kops-controller.internal.dev.datasaker.io
      creationTimestamp: null
      labels:
        k8s-addon: kops-controller.addons.k8s.io
        k8s-app: kops-controller
        kops.k8s.io/managed-by: kops
        version: v1.25.0
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: node-role.kubernetes.io/control-plane
                operator: Exists
              - key: kops.k8s.io/kops-controller-pki
                operator: Exists
            - matchExpressions:
              - key: node-role.kubernetes.io/master
                operator: Exists
              - key: kops.k8s.io/kops-controller-pki
                operator: Exists
      containers:
      - args:
        - --v=2
        - --conf=/etc/kubernetes/kops-controller/config/config.yaml
        command: null
        env:
        - name: KUBERNETES_SERVICE_HOST
          value: 127.0.0.1
        image: registry.k8s.io/kops/kops-controller:1.25.0@sha256:ffca50fd02426835e9b3c51d950e0726774de27934d944457a0391d8ba64a5e6
        name: kops-controller
        resources:
          requests:
            cpu: 50m
            memory: 50Mi
        securityContext:
          runAsNonRoot: true
          runAsUser: 10011
        volumeMounts:
        - mountPath: /etc/kubernetes/kops-controller/config/
          name: kops-controller-config
        - mountPath: /etc/kubernetes/kops-controller/pki/
          name: kops-controller-pki
      dnsPolicy: Default
      hostNetwork: true
      nodeSelector: null
      priorityClassName: system-cluster-critical
      serviceAccount: kops-controller
      tolerations:
      - key: node.cloudprovider.kubernetes.io/uninitialized
        operator: Exists
      - key: node.kubernetes.io/not-ready
        operator: Exists
      - key: node-role.kubernetes.io/master
        operator: Exists
      - key: node-role.kubernetes.io/control-plane
        operator: Exists
      volumes:
      - configMap:
          name: kops-controller
        name: kops-controller-config
      - hostPath:
          path: /etc/kubernetes/kops-controller/
          type: Directory
        name: kops-controller-pki
  updateStrategy:
    type: OnDelete

---

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

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: kops-controller.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    k8s-addon: kops-controller.addons.k8s.io
  name: kops-controller
rules:
- apiGroups:
  - ""
  resources:
  - nodes
  verbs:
  - get
  - list
  - watch
  - patch

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: kops-controller.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    k8s-addon: kops-controller.addons.k8s.io
  name: kops-controller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: kops-controller
subjects:
- apiGroup: rbac.authorization.k8s.io
  kind: User
  name: system:serviceaccount:kube-system:kops-controller

---

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: kops-controller.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    k8s-addon: kops-controller.addons.k8s.io
  name: kops-controller
  namespace: kube-system
rules:
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - get
  - list
  - watch
  - create
- apiGroups:
  - ""
  - coordination.k8s.io
  resourceNames:
  - kops-controller-leader
  resources:
  - configmaps
  - leases
  verbs:
  - get
  - list
  - watch
  - patch
  - update
  - delete
- apiGroups:
  - ""
  - coordination.k8s.io
  resources:
  - configmaps
  - leases
  verbs:
  - create

---

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  creationTimestamp: null
  labels:
    addon.kops.k8s.io/name: kops-controller.addons.k8s.io
    app.kubernetes.io/managed-by: kops
    k8s-addon: kops-controller.addons.k8s.io
  name: kops-controller
  namespace: kube-system
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: kops-controller
subjects:
- apiGroup: rbac.authorization.k8s.io
  kind: User
  name: system:serviceaccount:kube-system:kops-controller