kube-apiserver secure-port is set to zero

Check the kube-apiserver HTTPS listener and its actual TLS, authentication and authorization configuration.

Description

--secure-port selects the kube-apiserver HTTPS port. Historical servers allowed 0 to disable the listener. Current servers require a valid port.

Potential impact

An unavailable HTTPS endpoint can interrupt control-plane traffic and cluster administration. An old HTTP listener, if still enabled, leaves an unprotected route.

Remediation

Choose a port such as 6443, configure a trusted certificate for the API address, and set authentication, authorization and network access. Prepare clients and load balancers before changing ports. Verify that required connections succeed and unauthorized requests are denied.

Examples

In the Kubernetes 1.6 excerpts, --secure-port=0 disables HTTPS and --secure-port=6443 selects port 6443. Use a supported version for deployment.

Before

yaml
apiVersion: v1
kind: Pod
metadata:
  name: api-server
spec:
  containers:
    - name: kube-apiserver
      image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
      command:
        - "kube-apiserver"
      args:
        - "--secure-port=0"

After

yaml
apiVersion: v1
kind: Pod
metadata:
  name: api-server
spec:
  containers:
    - name: kube-apiserver
      image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
      command:
        - "kube-apiserver"
        - "--secure-port=6443"

References