Review controller API server CA trust settings

Verify that the CA bundle distributed to workloads validates the actual API server certificate.

Description

The kube-controller-manager flag --root-ca-file selects the PEM CA bundle workloads use to verify the API server. On current clusters, the default service-account volume gets its CA from the namespace’s kube-root-ca.crt ConfigMap. Legacy service-account token Secrets can also carry the CA. A separate private key signs tokens.

Potential impact

An outdated or incorrect CA can prevent workloads from connecting to the API server. Skipping verification can lead them to trust the wrong server.

Remediation

Check which CA your version distributes. Some recent versions use the CA from the controller’s client configuration when the flag is omitted. If you specify a file, mount it where the controller can read it. Test that workloads can verify the API server with the distributed CA, including after certificate renewal.

Examples

These excerpts compare Kubernetes 1.6.0 arguments. Use a supported version and your control plane’s actual configuration in production.

Before

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: gcr.io/google_containers/kube-controller-manager-amd64:v1.6.0
      command: ["kube-controller-manager"]
      args: []

After

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: gcr.io/google_containers/kube-controller-manager-amd64:v1.6.0
      command: ["kube-controller-manager"]
      args: ["--root-ca-file=/path/to/ca/file.pem"]

The first excerpt omits the CA path. In the second, replace /path/to/ca/file.pem with the mount path of the actual PEM bundle.

References