What is the main purpose of a kubeconfig file in Kubernetes?
A kubeconfig file stores cluster user and context information so kubectl can connect to the correct cluster without typing certificates keys and server details on every command.
What are the three main sections inside a kubeconfig file?
The three main sections are clusters users and contexts.
What does a context represent in a kubeconfig file?
A context links one user to one cluster and can also include a default namespace.
What file does kubectl use by default for kubeconfig if you do not specify one?
By default kubectl uses the file named config under the .kube directory in the users home folder.
What field in kubeconfig decides which context kubectl uses by default?
The current-context field decides which context kubectl uses by default.
Which kubectl command shows the kubeconfig that is currently being used?
kubectl config view
Which kubectl command changes the active context?
kubectl config use-context followed by the context name
How can you tell kubectl to use a different kubeconfig file for a command?
Use the –kubeconfig option followed by the path to the file.
How can a context help with namespaces during the CKAD exam?
A context can include a namespace so switching contexts can also place you into the correct namespace automatically and save time during tasks.
What certificate related fields might appear in kubeconfig and what is useful to remember for the exam?
You may see file path fields like client-certificate client-key and certificate-authority or inline base64 data fields like client-certificate-data client-key-data and certificate-authority-data and both approaches are valid.
What is an important CKAD tip related to namespaces and kubeconfig?
If a task uses one namespace repeatedly it is often faster to set the namespace in the current context than to keep typing -n on every command.
Which kubectl command is especially useful for quickly checking all configured contexts during the CKAD exam?
kubectl config get-contexts