0
0
Kubernetesdevops~10 mins

Why container orchestration matters in Kubernetes - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a Kubernetes Pod manifest with one container.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: my-pod
spec:
  containers:
  - name: my-container
    image: [1]
Drag options to blanks, or click blank then click option'
Adocker run nginx
Bnginx:latest
Ckubectl apply
Dpodman run
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands instead of image names
Leaving the image field empty
2fill in blank
medium

Complete the command to deploy a Kubernetes manifest file named app.yaml.

Kubernetes
kubectl [1] -f app.yaml
Drag options to blanks, or click blank then click option'
Aapply
Bdelete
Crun
Dbuild
Attempts:
3 left
💡 Hint
Common Mistakes
Using kubectl run which creates a pod directly
Using kubectl delete which removes resources
3fill in blank
hard

Fix the error in the command to list all pods in all namespaces.

Kubernetes
kubectl get pods [1]
Drag options to blanks, or click blank then click option'
A-a
B--namespace=all
C--all-namespaces
D--all
Attempts:
3 left
💡 Hint
Common Mistakes
Using -a which is not valid for namespaces
Using --namespace=all which is invalid
4fill in blank
hard

Fill both blanks to create a Deployment manifest with 3 replicas of an nginx container.

Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: [1]
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: [2]
Drag options to blanks, or click blank then click option'
A3
Bnginx:1.21
Cnginx:latest
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1 replica instead of 3
Using invalid image tags
5fill in blank
hard

Fill all three blanks to create a Service manifest exposing port 80 for the nginx Deployment.

Kubernetes
apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  selector:
    app: [1]
  ports:
  - protocol: TCP
    port: [2]
    targetPort: [3]
Drag options to blanks, or click blank then click option'
Anginx
B80
Dhttp
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong selector label
Using string 'http' instead of port number