Incomplete etcd TLS client certificate settings in kube-apiserver

Certificate authentication from the API server to etcd requires a valid client certificate and its private key.

Description

If etcd requires client certificates, set both --etcd-certfile and --etcd-keyfile on kube-apiserver. The API server uses the pair to prove its own identity and the CA in --etcd-cafile to verify the etcd server.

Potential impact

A mismatched pair can prevent the API server from reaching etcd and disrupt cluster requests. Keep authentication and server verification enabled while restoring connectivity.

Remediation

Mount a valid client certificate and its private key where the API server can read them, and restrict key access. Use HTTPS etcd endpoints and configure etcd to trust the CA that issued the client certificate. Check certificate expiry and test the authenticated connection from the API server.

Examples

These excerpts compare Kubernetes 1.6.0 API server arguments. Use a supported version and actual mount paths in production.

Before

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
      command: ["kube-apiserver"]
      args: ["--etcd-keyfile=/path/to/key/file.key"]

After

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
      command: ["kube-apiserver"]
      args: ["--etcd-keyfile=/path/to/key/file.key", "--etcd-certfile=/path/to/cert/file.crt"]

The first excerpt supplies only the private key. The second adds its matching client certificate.

References