A Kubernetes administrator is hardening a cluster and wants to ensure that the kubelet only accepts certificates from clients that have been signed by the cluster's certificate authority. The administrator has already configured the kubelet with --client-ca-file pointing to the correct CA bundle. Which additional kubelet configuration parameter must be set to enforce certificate-based authentication and reject anonymous requests?
--anonymous-auth=false disables anonymous access to the kubelet API, forcing all requests to be authenticated. When combined with --client-ca-file, the kubelet will require clients to present a valid client certificate signed by the specified CA. This ensures that only authenticated clients can interact with the kubelet, which is a critical security hardening step. Without this, anonymous requests might still be allowed even if client certificates are configured.
Why this answer
To enforce certificate-based authentication and reject anonymous requests, the kubelet must have --anonymous-auth set to false. This setting ensures that any request without valid credentials is denied. When --client-ca-file is also configured, the kubelet will validate client certificates against the specified CA.
Together, these settings ensure that only clients with certificates signed by the cluster CA can access the kubelet API, significantly reducing the attack surface.
Exam trap
The trap here is assuming that configuring --client-ca-file alone is sufficient to require client certificates, when anonymous authentication must also be explicitly disabled.