2024/2025
which command do you run on k8s to display details about the cluster? - ANSWERSkubectl cluster-info
which command do you use to list all nodes? - ANSWERSkubectl get nodes
kubectl version - ANSWERS
How do you feed a config file to K8s cluster - ANSWERSkubectl apply -f <name of a config yml>
get status of all pods - ANSWERSkubectl get pods
Simplest way to use kubectl to create a nginx pod and run it - ANSWERSkubectl run nginx --image nginx
how can you see the status of your pods - ANSWERSkubectl get pods
What is the version of Kubernetes running on the nodes ? - ANSWERSkubectl version
read out the git version
How many nodes are running on the cluster? - ANSWERSkubectl get nodes
What is the flavor and version of Operating System on which the Kubernetes nodes are running? -
ANSWERSkubectl get nodes -o wide and look at the Operating System.
which are the top 4 properties in every kubernetes yaml? - ANSWERSapiVersion, kind, metadata, spec
which apiVersion should be used for Pods? - ANSWERSv1
, which apiVersion should be used for a Service? - ANSWERSv1
which apiVersion should be used for a ReplicaSet? - ANSWERSapps/v1
which apiVersion should be used for a deployment? - ANSWERSapps/v1
what belongs in the spec of a Pod? - ANSWERScontainers: a list of objects with name and image
properties
what is the command to display detailed pod information? - ANSWERSkubectl describe pod <podname>
what image was used to create this pod? - ANSWERSkubectl describe pod <podname>
which node is this pod paced on? - ANSWERSkubectl describe pod <podname>
how many containers are part of this pod? - ANSWERSkubectl describe pod <podname>
How do you remove a pod from the cluster? - ANSWERSkubectl delete pod <podname>
Create a new pod with the nginx image. - ANSWERSkubectl run nginx --image=nginx
How can you create a pod from an image in a oneline command? - ANSWERSkubectl run nginx --
image=nginx
How do you extract a pod definition from an existing pod? - ANSWERSkubectl get pod <podname> -o
yaml > filename.yml
How can you edit an existing pods properties? - ANSWERSkubectl edit pod <pod-name>