apiVersion: v1
kind: Pod
metadata:
  name: kube-controller-manager
  namespace: kube-system
  labels:
    k8s-app: kube-controller-manager
    tier: control-plane
spec:
  hostNetwork: true
  priorityClassName: system-cluster-critical
  securityContext:
    runAsNonRoot: true
    runAsUser: 65534
    seccompProfile:
      type: RuntimeDefault
  containers:
  - name: kube-controller-manager
    image: ${kube_controller_manager_image}
    command:
    - kube-controller-manager
    - --allocate-node-cidrs=true
    - --cloud-provider=${cloud_provider}
    - --cluster-cidr=${pod_cidr}
    - --cluster-signing-cert-file=/etc/kubernetes/secrets/ca.crt
    - --cluster-signing-key-file=/etc/kubernetes/secrets/ca.key
    - --configure-cloud-routes=false
    - --experimental-cluster-signing-duration=72h
    - --flex-volume-plugin-dir=/var/lib/kubelet/volumeplugins
    - --kubeconfig=/etc/kubernetes/secrets/kubeconfig
    - --leader-elect=true
    - --pod-eviction-timeout=1m
    - --root-ca-file=/etc/kubernetes/secrets/ca.crt
    - --service-account-private-key-file=/etc/kubernetes/secrets/service-account.key
    - --service-cluster-ip-range=${service_cidr}
    - --use-service-account-credentials=true
    livenessProbe:
      httpGet:
        scheme: HTTPS
        host: 127.0.0.1
        path: /healthz
        port: 10257
      initialDelaySeconds: 15
      timeoutSeconds: 15
    resources:
      requests:
        cpu: 150m
    volumeMounts:
    - name: secrets
      mountPath: /etc/kubernetes/secrets
      readOnly: true
    - name: ssl-host
      mountPath: /etc/ssl/certs
      readOnly: true
  volumes:
  - name: secrets
    hostPath:
      path: /etc/kubernetes/bootstrap-secrets
  - name: ssl-host
    hostPath:
      path: ${trusted_certs_dir}
