0
0
Kubernetesdevops~20 mins

Desired state vs actual state reconciliation in Kubernetes - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kubernetes Reconciliation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the main purpose of Kubernetes' reconciliation loop?

Kubernetes uses a reconciliation loop to manage resources. What does this loop do?

AIt only creates resources once and never checks their status again.
BIt continuously compares the desired state with the actual state and makes changes to match them.
CIt deletes all resources periodically to free up space.
DIt manually requires users to update resource states through commands.
Attempts:
2 left
💡 Hint

Think about how Kubernetes keeps your apps running as you want.

💻 Command Output
intermediate
2:00remaining
What is the output of 'kubectl get pods' after deleting a pod manually?

You manually delete a pod that is part of a Deployment. What will 'kubectl get pods' show shortly after?

Kubernetes
kubectl delete pod <pod-name>
kubectl get pods
AThe deleted pod remains in the list with status 'Terminating' forever.
BNo pods are running because the deleted pod is gone.
CA new pod with a different name is created to replace the deleted one.
DAn error message saying pods cannot be deleted manually.
Attempts:
2 left
💡 Hint

Think about how Deployments maintain the number of pods.

Configuration
advanced
3:00remaining
Which YAML snippet correctly defines a desired state for a Deployment with 3 replicas?

Choose the YAML snippet that correctly sets a Deployment to have 3 replicas of an nginx container.

A
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deploy
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
B
apiVersion: v1
kind: Deployment
metadata:
  name: nginx-deploy
spec:
  replicas: 3
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
C
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deploy
spec:
  replicas: 'three'
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
D
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deploy
spec:
  replicas: 3
  selector:
    app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:latest
Attempts:
2 left
💡 Hint

Check apiVersion, kind, and selector format carefully.

Troubleshoot
advanced
3:00remaining
Why does a Deployment never reach the desired number of ready pods?

You set replicas: 5 in your Deployment, but 'kubectl get pods' shows only 3 pods running and ready. What could cause this?

AThe pod template has an invalid image name causing pods to crash on start.
BThe Deployment controller does not support more than 3 replicas.
CThe cluster has no nodes available to schedule pods.
DThe Deployment spec is missing the replicas field.
Attempts:
2 left
💡 Hint

Check pod status and events for crash loops.

🔀 Workflow
expert
3:00remaining
What is the correct sequence of steps Kubernetes takes to reconcile a changed Deployment manifest?

Put these steps in the order Kubernetes performs them when you update a Deployment manifest to change replicas from 2 to 4.

A1,3,2,4
B2,1,3,4
C3,1,2,4
D1,2,3,4
Attempts:
2 left
💡 Hint

Think about how the update flows from manifest to running pods.