This is a list of 10 Interview Questions on Kubernetes for SDET/Devops Set-03 (ReplicaSet in K8S). It is required for those who are applying for job openings. SDET – System Testing, Automation, Kubernetes.
1. How to create a ReplicaSet?
kubectl create -f replicasetrs-test.yml
2. How to get list of ReplicaSet?
kubectl get replicaset
3. How to describe newly created ReplicaSet?
kubectl describe rs/<replicaset-name>
4. How we can verify owner of the Pod?
kubectl get pods <pod-name> -o yaml
Check the “name” tag under “ownerReferences”
5. How to expose replica set as a service?
kubectl expose rs <ReplicaSet-Name> --type=NodePort --port=80 --target-port=8080 --name=<ServiceName>
6. How to delete replica set?
kubectl delete rs <ReplicaSet-Name>
7. What is the use of replica set?
A ReplicaSet’s purpose is to maintain a stable set of replica Pods running at any given time. As such, it is often used to guarantee the availability of a specified number of identical Pods.
8. What is POD Selector?
.spec.selector label selector. These are the labels which is used to identify potential Pods to acquire.In the ReplicaSet,
.spec.template.metadata.labels must match
spec.selector, or it will be rejected by the API.
9. How to set number of pods concurrently?
You can specify how many Pods should run concurrently by setting
.spec.replicas. The ReplicaSet will create/delete its Pods to match this number.If you do not specify
.spec.replicas, then it defaults to 1.
10. Commands for kubernetes POD?