Kubelet client certificate or key is not configured

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

Description

If kubelet requires client certificates, configure --kubelet-client-certificate and --kubelet-client-key on kube-apiserver. The API server presents this client identity when it connects to kubelet.

Potential impact

A missing or mismatched pair can prevent log retrieval or attachment to running containers. Allowing anonymous access to work around a failure can expose node-management functions.

Remediation

Mount a valid certificate and its matching private key on the API server and restrict key access. Configure kubelet to trust the issuing CA and authorize the required operations. Configure the API server to verify the kubelet serving certificate, then test an operation such as retrieving logs.

Examples

Only the second Kubernetes 1.6.0 excerpt supplies the client certificate and key. Use the authentication method and file paths for your deployment version.

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"]

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",
          "--kubelet-client-certificate=/path/to/any/file.pem",
          "--kubelet-client-key=/path/to/any/file2.pem"
        ]

References