ConfigMaps in Kube System
Most of the ConfigMaps (cm) you see in kube-system are not created manually but generated automatically during cluster bootstrapping (via kubeadm, add-ons, or the control plane components themselves). Letโs break them down one by one so you can see how theyโre formed and what files/configs contributed:
๐ Breakdown of ConfigMaps in kube-system¶
-
canal-config -
Created by: Calico/Canal CNI plugin when deployed.
- Source: The YAML manifest you applied for Canal includes a
ConfigMapdefining network settings (like CNI conf, Felix, etc.). -
Example: It usually contains CNI network settings (pod CIDR, backend type, etc.).
-
coredns -
Created by: The CoreDNS add-on deployed by kubeadm.
- Source: From the CoreDNS YAML manifest (
/etc/kubernetes/addons/coredns.yamlor downloaded fromk8s.gcr.io). -
Contents: The CoreDNS Corefile, which defines DNS server configuration.
-
extension-apiserver-authentication -
Created by: kube-apiserver.
- Source: kube-apiserver writes it automatically when it starts.
-
Contents: Authentication-related config (client CA, request header settings) used by aggregated API servers (like metrics-server).
-
kube-apiserver-legacy-service-account-token-tracking -
Created by: kube-apiserver.
- Purpose: Helps track usage of legacy service account tokens.
-
Source: Internal kube-apiserver process, not from a manifest.
-
kube-proxy -
Created by: kubeadm when deploying the kube-proxy DaemonSet.
- Source: Generated from
kubeadm-configduringkubeadm init. -
Contents: Proxy mode, cluster CIDR, iptables/ipvs config, etc.
-
kube-root-ca.crt -
Created by: The Controller Manager.
- Source: Automatically injected into every namespace so pods can talk to the API server securely.
- Contents: Cluster root CA certificate.
-
cat /etc/kubernetes/pki/ca.crt -
kubeadm-config -
Created by: kubeadm during
kubeadm init. - Source: Whatever you passed in your
kubeadm initconfig file (likeClusterConfiguration,InitConfiguration). -
Contents: Cluster-wide settings (API server, networking, certificates directory, etc.).
-
kubelet-config -
Created by: kubeadm.
- Source: Derived from your kubeadm init configuration.
- Contents: The Kubeletโs configuration (cgroup driver, TLS settings, cluster DNS, etc.).
- Used by the
kubelet-config-x.yConfigMap, which kubeadm uses for upgrading kubelet configs. cat /var/lib/kubelet/config.yaml
โ๏ธ So, how are they formed?¶
- kubeadm init generates some (
kubeadm-config,kubelet-config,kube-proxy). - Add-ons you applied (like Canal, CoreDNS) create their own ConfigMaps from YAML manifests.
- Control plane components (
kube-apiserver,controller-manager) create and maintain some automatically (extension-apiserver-authentication,kube-root-ca.crt, etc.).
๐ So yes, youโre right โ some came from files you (or kubeadm) applied, others are generated dynamically by the control plane.
๐ ConfigMaps in kube-system (CKA Prep)¶
| ConfigMap | Who Creates It | Source Type | Where Values Come From / File Path | What You Might Need It For in CKA |
|---|---|---|---|---|
| canal-config | Canal (CNI) add-on | Literal YAML (inline) | Part of canal.yaml manifest (downloaded/applied) | Check Pod CIDR, CNI backend configs |
| coredns | CoreDNS add-on | Literal YAML (inline) | From the coredns.yaml addon manifest (applied by kubeadm) | Confirm cluster DNS IP (.spec.dnsPolicy, stubDomains, etc.) |
| extension-apiserver-authentication | kube-apiserver | Files | From /etc/kubernetes/pki/ca.crt, /etc/kubernetes/pki/front-proxy-ca.crt, request-header args | Needed if troubleshooting auth for metrics-server / API aggregation |
| kube-apiserver-legacy-service-account-token-tracking | kube-apiserver | Internal (runtime state) | Generated internally by API server | Rarely needed; can be ignored in CKA |
| kube-proxy | kubeadm | Literal (generated) | Derived from ClusterConfiguration in kubeadm โ applied as ConfigMap | Check mode (iptables/ipvs), cluster CIDR, proxy settings |
| kube-root-ca.crt | kube-controller-manager | File | From /etc/kubernetes/pki/ca.crt (cluster CA) | Verify cluster CA being injected into pods; cert troubleshooting |
| kubeadm-config | kubeadm | Literal (or file if you passed one) | - If you gave kubeadm a config file โ itโs stored here. - If not โ kubeadmโs defaults are written here. | Useful to check podSubnet, serviceSubnet, image repo, etc. |
| kubelet-config | kubeadm | Literal (generated) | kubeadm renders kubelet defaults into ConfigMap (kubelet-config-x.y) | Inspect kubelet params: cgroupDriver, cluster DNS, TLS, etc. |
๐ฏ Exam Angle (CKA)¶
-
If the question asks you to confirm Pod CIDR / Service CIDR โ ๐
kubectl get cm kubeadm-config -n kube-system -o yaml -
If you need DNS cluster IP or DNS config โ ๐
kubectl get cm coredns -n kube-system -o yaml -
If troubleshooting CNI networking โ ๐
kubectl get cm canal-config -n kube-system -o yaml -
If checking kubelet configuration โ ๐
kubectl get cm kubelet-config -n kube-system -o yaml -
If dealing with API aggregation / metrics-server errors โ ๐
kubectl get cm extension-apiserver-authentication -n kube-system -o yaml
โก So the shortcut for CKA is:
- Cluster networking values โ
kubeadm-config,canal-config - Cluster DNS values โ
coredns - Kubelet params โ
kubelet-config - Certs/aggregation โ
extension-apiserver-authentication,kube-root-ca.crt
๐ kube-proxy Config Summary (CKA Prep)¶
-
Where does the config come from?
-
kube-proxyuses a ConfigMap in thekube-systemnamespace calledkube-proxy. -
This ConfigMap has two keys:
config.confโKubeProxyConfiguration(mode: iptables/ipvs, clusterCIDR, etc.)kubeconfig.confโ kubeconfig for talking to the API server.
-
Are these real files on the host?
-
โ No.
- On the host node,
/var/lib/kube-proxy/does not exist. -
These keys are mounted as virtual files only inside the kube-proxy Pod container.
-
Where do they appear?
-
Inside each kube-proxy Pod at:
* Mounted by the DaemonSet from the/var/lib/kube-proxy/config.conf /var/lib/kube-proxy/kubeconfig.confkube-proxyConfigMap. * Thatโs why the containerโs--configflag points to/var/lib/kube-proxy/config.conf. -
How to inspect them?
-
From the cluster (fastest):
* From inside a Pod (runtime view):kubectl -n kube-system get cm kube-proxy -o yamlkubectl -n kube-system exec -it <kube-proxy-pod> -- cat /var/lib/kube-proxy/config.conf -
CKA exam angle:
-
If asked about proxy mode, clusterCIDR, or how kube-proxy connects to the API server โ check the
kube-proxyConfigMap. - Donโt waste time searching
/etc/kubernetes/or/var/lib/on the host โ these files only live in the kube-proxy Pod.
โ
Final takeaway: config.conf and kubeconfig.conf are not host files. They are keys in the kube-proxy ConfigMap, which Kubernetes mounts into the kube-proxy Pods at /var/lib/kube-proxy/. To check them in the exam, read the ConfigMap (kubectl get cm) or exec into a kube-proxy Pod โ not on the host.