0
0
Kubernetesdevops~5 mins

kubectl CLI installation and configuration in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is kubectl in Kubernetes?

kubectl is a command-line tool used to interact with Kubernetes clusters. It lets you create, update, delete, and manage Kubernetes resources.

Click to reveal answer
beginner
How do you install kubectl on a Linux system using curl?

Run these commands:<br>curl -LO https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl<br>chmod +x kubectl<br>sudo mv kubectl /usr/local/bin/

Click to reveal answer
intermediate
What is the purpose of the kubectl config command?

kubectl config manages the configuration file that stores cluster, user, and context information. It helps kubectl know which cluster to talk to and with what credentials.

Click to reveal answer
beginner
What file does kubectl use by default to store cluster connection info?

By default, kubectl uses the ~/.kube/config file to store cluster, user, and context details.

Click to reveal answer
beginner
How do you check the current context (cluster and user) kubectl is using?

Run kubectl config current-context. It shows the active cluster and user setting.

Click to reveal answer
Which command installs kubectl on Linux using curl?
Acurl -LO https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl
Bapt-get install kubectl
Cyum install kubectl
Dcurl https://kubectl.io/install.sh
Where does kubectl store its default configuration file?
A/etc/kubernetes/config
B~/.kube/config
C/usr/local/bin/kubectl.conf
D/var/lib/kube/config
What does the command kubectl config current-context show?
AThe current Kubernetes cluster and user context
BThe version of kubectl installed
CThe list of all pods in the cluster
DThe status of the Kubernetes nodes
Which of these is NOT a valid way to configure kubectl?
ARunning <code>kubectl config use-context</code>
BEditing the <code>~/.kube/config</code> file manually
CRunning <code>kubectl install config</code>
DUsing <code>kubectl config set-context</code>
After downloading the kubectl binary, what is the next step to make it executable on Linux?
ARun <code>kubectl config set</code>
BRun <code>kubectl install</code>
CRun <code>sudo apt-get update</code>
DRun <code>chmod +x kubectl</code>
Explain the steps to install and configure kubectl on a new Linux machine.
Think about downloading, permissions, placement, and configuration.
You got /5 concepts.
    Describe how kubectl knows which Kubernetes cluster to connect to.
    Focus on the config file and context concept.
    You got /4 concepts.