- Take me to Practice Test
-
Run the command
kubectl get pods
and count the number of pods.$ kubectl get pods
-
Run the command
kubectl get replicaset
and count the number of replicasets.$ kubectl get rs
-
Run the command
kubectl get replicaset
$ kubectl get rs
-
Run the command
kubectl get replicaset
and look at the count under theDesired
column$ kubectl get rs
-
Run the command
kubectl describe replicaset
and look under the containers section.$ kubectl describe replicaset (or) $ kubectl get rs -o wide
-
Run the command
kubectl get replicaset
and look at the count under theReady
column$ kubectl get repplicaset
-
Run the command
kubectl describe pods
and look under the events section.$ kubectl describe pods
-
Run the command
kubectl delete pod <podname>
$ kubectl delete pod new-replica-set-XXXX
-
Run the command
kubectl get pods
and count the number of PODs$ kubectl get pods
-
ReplicaSets ensures that desired number of PODs always run
-
The value for
apiVersion
is incorrect. Find the correct apiVersion for ReplicaSet.Get the apiVersion for replicaset
$ kubectl explain replicaset|grep VERSION
Update the replicaset definition file with correct version and create a replicaset
$ kubectl create -f replicaset-definition-1.yaml
-
The values for labels on lines 9 and 13 should match.
Selector matchLabels should match with POD labels - Update the replicaset-definition-2.yaml $ kubectl create -f replicaset-definition-2.yaml
-
Run the command
kubectl delete replicaset
$ kubectl delete replicaset replicaset-1 $ kubectl delete rs replicaset-2
-
Run the command
kubectl edit replicaset new-replica-set
, modify the image name tobusybox
and then save the file.$ kubectl edit replicaset new-replica-set
-
Run the command
kubectl edit replicaset new-replica-set
, modify the replicas and then save the file.$ kubectl edit replicaset new-replica-set
Another way
$ 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.$ kubectl edit replicaset new-replica-set
Another way
$ kubectl scale --replicas=2 replicaset new-replica-set