Complete the code to specify the kind of Kubernetes object.
apiVersion: apps/v1
kind: [1]
metadata:
name: my-deploymentThe kind field defines the type of Kubernetes object. For creating deployments, it must be Deployment.
Complete the code to set the number of pod replicas.
spec:
replicas: [1]
selector:
matchLabels:
app: myappThe replicas field specifies how many pod copies to run. It must be a positive integer like 3.
Fix the error in the container image name.
containers:
- name: myapp-container
image: [1]The container image name must use a colon : to separate the image name and tag, like nginx:latest.
Fill both blanks to correctly specify container ports and labels.
spec:
template:
metadata:
labels:
app: [1]
spec:
containers:
- name: myapp-container
image: nginx:latest
ports:
- containerPort: [2]The label app should match the selector label, here myapp. The common HTTP port for nginx is 80.
Fill all three blanks to complete the deployment spec with correct keys and values.
apiVersion: apps/v1 kind: Deployment metadata: name: [1] spec: replicas: [2] selector: matchLabels: app: [3]
The deployment name is my-deployment. The replicas count is 3. The label app must match the pod template label, here myapp.