Review Kubernetes control plane profiling settings

Disable unnecessary profiling and restrict access to diagnostic endpoints that are needed.

Description

Set --profiling=false on kube-apiserver or kube-controller-manager when you do not need performance profiles. If the flag is omitted, check the running version’s default and effective settings.

Potential impact

With profiling enabled, users who can reach and access the diagnostic endpoints can see internal execution details.

Remediation

For the scheduler, use enableProfiling: false in the supported KubeSchedulerConfiguration. When profiling is needed for diagnosis, restrict access through authentication, authorization and network controls. Restore and verify the previous setting afterward.

Examples

The Kubernetes 1.30.0 excerpts disable only API server profiling. Configure access to other endpoints separately.

Before

yaml
apiVersion: v1
kind: Pod
metadata:
  name: kube-apiserver
spec:
  containers:
    - name: kube-apiserver
      image: registry.k8s.io/kube-apiserver:v1.30.0
      command:
        - kube-apiserver
      args:
        - --profiling=true

After

yaml
apiVersion: v1
kind: Pod
metadata:
  name: kube-apiserver
spec:
  containers:
    - name: kube-apiserver
      image: registry.k8s.io/kube-apiserver:v1.30.0
      command:
        - kube-apiserver
      args:
        - --profiling=false

References