Complete the code to create a Kubernetes pod manifest with the correct apiVersion.
apiVersion: [1]
kind: Pod
metadata:
name: my-pod
spec:
containers:
- name: my-container
image: nginxThe correct apiVersion for a Pod manifest is v1. Other apiVersions are for different Kubernetes resources.
Complete the command to list all pods in the default namespace.
kubectl [1] podsThe command kubectl get pods lists all pods in the current namespace.
Fix the error in the command to expose a deployment as a service.
kubectl expose deployment my-deployment --type=[1] --port=80
The --type flag accepts 'ClusterIP', 'NodePort', or 'LoadBalancer'. 'NodePort' exposes the service on each node's IP at a static port.
Fill both blanks to create a deployment manifest with 3 replicas and the correct container image.
apiVersion: apps/v1 kind: Deployment metadata: name: my-app spec: replicas: [1] selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: app-container image: [2]
The replicas field should be set to 3 to run three pods. The container image should be specified with a tag like 'nginx:latest' to ensure the correct version is used.
Fill all three blanks to create a ConfigMap manifest with a key-value pair.
apiVersion: v1 kind: ConfigMap metadata: name: my-config data: [1]: "[2]" [3]: "true"
The ConfigMap keys are 'enableFeatureX' and 'debugMode'. The value for 'enableFeatureX' is 'false', and 'debugMode' is set to 'true'.