0
0
Azurecloud~5 mins

Kubectl for cluster management in Azure - Cheat Sheet & Quick Revision

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

kubectl is a command-line tool that lets you communicate with and manage Kubernetes clusters. It helps you deploy applications, inspect and manage cluster resources, and view logs.

Click to reveal answer
beginner
How do you configure kubectl to connect to an Azure Kubernetes Service (AKS) cluster?

You use the Azure CLI command az aks get-credentials --resource-group <group> --name <cluster-name> to download and merge the cluster's access credentials into your local kubeconfig file. Then kubectl uses this config to connect.

Click to reveal answer
beginner
What does the command kubectl get pods do?

This command lists all the pods running in the current namespace of your Kubernetes cluster. Pods are the smallest deployable units that hold your containers.

Click to reveal answer
intermediate
Explain the purpose of kubectl apply -f <file>.

This command applies the configuration in the specified file to the cluster. It creates or updates resources like deployments or services based on the file's content.

Click to reveal answer
beginner
How can you check the logs of a pod using kubectl?

Use kubectl logs <pod-name> to see the logs of a specific pod. This helps you understand what is happening inside the containers.

Click to reveal answer
Which command downloads AKS cluster credentials for kubectl?
Aaz login
Bkubectl config use-context
Caz aks get-credentials
Dkubectl create cluster
What does kubectl get nodes show?
AList of cluster nodes
BList of pods
CList of services
DList of deployments
How do you update a deployment using kubectl?
Akubectl apply -f deployment.yaml
Bkubectl delete deployment
Ckubectl get deployment
Dkubectl logs deployment
Which kubectl command shows detailed info about a pod?
Akubectl exec &lt;pod-name&gt;
Bkubectl get pods
Ckubectl logs &lt;pod-name&gt;
Dkubectl describe pod &lt;pod-name&gt;
What is the default namespace kubectl commands operate in if none is specified?
Aadmin
Bdefault
Cproduction
Dkube-system
Describe the steps to connect kubectl to an Azure Kubernetes Service cluster.
Think about how kubectl knows which cluster to talk to.
You got /4 concepts.
    Explain how kubectl helps you manage pods in a Kubernetes cluster.
    Focus on commands related to pods.
    You got /4 concepts.