0
0
Kubernetesdevops~10 mins

Why production readiness 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 that runs the nginx container.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
spec:
  containers:
  - name: nginx
    image: [1]
Drag options to blanks, or click blank then click option'
Amysql
Bubuntu:latest
Cnginx:latest
Dbusybox
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated images like ubuntu or mysql for a web server pod.
2fill in blank
medium

Complete the code to expose the nginx Pod with a Service of type LoadBalancer.

Kubernetes
apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  selector:
    app: nginx
  type: [1]
  ports:
  - protocol: TCP
    port: 80
    targetPort: 80
Drag options to blanks, or click blank then click option'
ANodePort
BLoadBalancer
CClusterIP
DExternalName
Attempts:
3 left
💡 Hint
Common Mistakes
Using ClusterIP which is internal only, not external.
3fill in blank
hard

Fix the error in the Deployment spec to ensure the container restarts automatically.

Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
      restartPolicy: [1]
Drag options to blanks, or click blank then click option'
AAlways
BUnlessStopped
CNever
DOnFailure
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Never' or 'OnFailure' which are invalid for Deployments.
4fill in blank
hard

Fill both blanks to create a readiness probe that checks HTTP on port 80.

Kubernetes
readinessProbe:
  httpGet:
    path: [1]
    port: [2]
Drag options to blanks, or click blank then click option'
A/healthz
B80
C8080
D/status
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong port or path that the container does not serve.
5fill in blank
hard

Fill all three blanks to define resource limits for CPU and memory in the container spec.

Kubernetes
resources:
  limits:
    cpu: [1]
    memory: [2]
  requests:
    cpu: [3]
Drag options to blanks, or click blank then click option'
A500m
B256Mi
C250m
D1Gi
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing limits with requests or using invalid units.