CKA Commands
kubectl describe pod nginx - correct answer-get more information about the nginx pod
kubectl get pods --namespace=kube-system - correct answer-get a list of pods in the
kube-system namespace
kubectl run nginx --image=nginx - correct answer-use the nginx image to create the nginx
pod
kubectl delete pod webapp - correct answer-delete the webapp pod
kubectl edit redis - correct answer-edit the redis pod
kubectl get replicasets - correct answer-get replica sets in default namespace
kubectl get replicasets --namespace=kube-system - correct answer-get the number of
desired replica sets in the system namespace
kubectl apply -f /root/test.yaml - correct answer-create a replicaset with the /root/test.yaml
file
kubectl explain replicaset | grep VERSION - correct answer-get the proper version for a
replicaset
kubectl run redis --namespace=finance --image=redis - correct answer-create the redis pod
using the redis image in the finance namespace
kubectl get pods --all-namespaces - correct answer-get all pods in all namespaces
db-service.dev.svc.cluster.local - correct answer-what is the dns name of db-service in the
dev cluster?
kubectl -n dev get svc - correct answer-using the short flag, get JUST the names of services
running in dev
kubectl describe services kubernetes - correct answer-get the type of service that
kubernetes is
kubectl run nginx --image=nginx --dry-run=client -o yaml - correct answer-don't create an
nginx image called nginx, but instead output to a yaml file.
kubectl create deployment --image=nginx nginx - correct answer-create an nginx deployment
with the nginx image
kubectl describe pod nginx - correct answer-get more information about the nginx pod
kubectl get pods --namespace=kube-system - correct answer-get a list of pods in the
kube-system namespace
kubectl run nginx --image=nginx - correct answer-use the nginx image to create the nginx
pod
kubectl delete pod webapp - correct answer-delete the webapp pod
kubectl edit redis - correct answer-edit the redis pod
kubectl get replicasets - correct answer-get replica sets in default namespace
kubectl get replicasets --namespace=kube-system - correct answer-get the number of
desired replica sets in the system namespace
kubectl apply -f /root/test.yaml - correct answer-create a replicaset with the /root/test.yaml
file
kubectl explain replicaset | grep VERSION - correct answer-get the proper version for a
replicaset
kubectl run redis --namespace=finance --image=redis - correct answer-create the redis pod
using the redis image in the finance namespace
kubectl get pods --all-namespaces - correct answer-get all pods in all namespaces
db-service.dev.svc.cluster.local - correct answer-what is the dns name of db-service in the
dev cluster?
kubectl -n dev get svc - correct answer-using the short flag, get JUST the names of services
running in dev
kubectl describe services kubernetes - correct answer-get the type of service that
kubernetes is
kubectl run nginx --image=nginx --dry-run=client -o yaml - correct answer-don't create an
nginx image called nginx, but instead output to a yaml file.
kubectl create deployment --image=nginx nginx - correct answer-create an nginx deployment
with the nginx image