Complete the code to specify the kind of Kubernetes object.
apiVersion: apps/v1
kind: [1]
metadata:
name: my-replicasetThe kind field specifies the type of Kubernetes object. For a ReplicaSet, it must be ReplicaSet.
Complete the code to set the number of pod replicas.
spec:
replicas: [1]The replicas field sets how many pod copies the ReplicaSet should maintain. It must be a positive integer like 3.
Fix the error in the selector field to match the pod labels.
spec:
selector:
matchLabels:
app: [1]The selector must match the labels of the pods the ReplicaSet manages. Here, the pods have label app: frontend.
Fill both blanks to complete the pod template metadata and container name.
spec:
template:
metadata:
labels:
app: [1]
spec:
containers:
- name: [2]
image: nginx:latestThe pod template labels must match the selector labels. The container name is usually the application or image name, here nginx.
Fill all three blanks to complete the ReplicaSet spec with replicas, selector, and pod labels.
spec: replicas: [1] selector: matchLabels: app: [2] template: metadata: labels: app: [3]
The replicas is set to 3. The selector and pod labels must match and are both frontend.