Disable API Server NodePort and Configure kube-scheduler Resource Requests
Scenario
You are managing a Kubernetes control plane node cplane-01. During a routine audit, two misconfigurations have been flagged — one is a security risk exposing the API server to the outside world, and the other is a resource management gap that could starve critical control plane components.
Your job is to identify and fix both issues before they impact the cluster.
Task
Two issues need to be resolved:
The Kubernetes API server is currently exposed via a NodePort on port 32222, making it reachable directly from outside the cluster. This is a security risk — the API server should only be reachable through its default ClusterIP Service inside the cluster.
Hint 1 — Disable API Server NodePort
The kube-apiserver is a static pod managed by the kubelet. Its configuration
is controlled entirely through flags in the manifest file. Look for the flag
that controls how the kubernetes Service is exposed, and consider what
happens to the Service after the flag is removed.
# where are static pod manifests located?
ls /etc/kubernetes/manifests/
# how do you inspect the kubernetes service?
kubectl get svc kubernetes -o yaml
Documentation