- Take me to Practice Test
-
Run the command
kubectl get podsand count the number of pods.Details
$ kubectl get pods -
Run the command
kubectl get replicasetand count the number of replicasets.Details
$ kubectl get rs -
Run the command
kubectl get replicasetDetails
$ kubectl get rs -
Run the command
kubectl get replicasetand look at the count under theDesiredcolumnDetails
$ kubectl get rs -
Run the command
kubectl describe replicasetand look under the containers section.Details
$ kubectl describe replicaset (or) $ kubectl get rs -o wide -
Run the command
kubectl get replicasetand look at the count under theReadycolumnDetails
$ kubectl get repplicaset -
Run the command
kubectl describe podsand look under the events section.Details
$ kubectl describe pods -
Run the command
kubectl delete pod <podname>Details
$ kubectl delete pod new-replica-set-XXXX -
Run the command
kubectl get podsand count the number of PODsDetails
$ kubectl get pods -
ReplicaSets ensures that desired number of PODs always run
-
The value for
apiVersionis incorrect. Find the correct apiVersion for ReplicaSet.Get the apiVersion for replicaset
Details
$ kubectl explain replicaset|grep VERSIONUpdate the replicaset defination file with correct version and create a replicaset
Details
$ kubectl create -f replicaset-defination-1.yaml -
The values for labels on lines 9 and 13 should match.
Details
Selector matchLabels should match with POD labels - Update the replicaset-defination-2.yaml $ kubectl create -f replicaset-defination-2.yaml -
Run the command
kubectl delete replicasetDetails
$ kubectl delete replicaset replicaset-1 $ kubectl delete rs replicaset-2 -
Run the command
kubectl edit replicaset new-replica-set, modify the image name tobusyboxand then save the file.Details
$ kubectl edit replicaset new-replica-set -
Run the command
kubectl edit replicaset new-replica-set, modify the replicas and then save the file.Details
$ kubectl edit replicaset new-replica-setAnother way
Details
$ kubectl scale --replicas=5 replicaset new-replica-set -
Run the command
kubectl edit replicaset new-replica-set, modify the replicas and then save the file.Details
$ kubectl edit replicaset new-replica-setAnother way
Details
$ kubectl scale --replicas=2 replicaset new-replica-set