0
0
Kubernetesdevops~10 mins

Probe failure and container restart behavior in Kubernetes - Interactive Code Practice

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

Complete the code to specify the liveness probe command in a Kubernetes pod spec.

Kubernetes
livenessProbe:
  exec:
    command:
    - [1]
Drag options to blanks, or click blank then click option'
Acurl
Bcat
Cls
Decho
Attempts:
3 left
💡 Hint
Common Mistakes
Using commands that do not check service health like 'ls' or 'cat'.
2fill in blank
medium

Complete the code to set the initial delay before the liveness probe starts.

Kubernetes
livenessProbe:
  initialDelaySeconds: [1]
Drag options to blanks, or click blank then click option'
A10
B300
C60
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Setting delay too low causing premature probe failures.
3fill in blank
hard

Fix the error in the restart policy to ensure the container restarts on failure.

Kubernetes
restartPolicy: [1]
Drag options to blanks, or click blank then click option'
ASometimes
BAlways
CNever
DOnFailure
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Never' which disables restarts, or 'Always' which restarts even on success.
4fill in blank
hard

Fill both blanks to configure readiness and liveness probes with HTTP GET method.

Kubernetes
readinessProbe:
  httpGet:
    path: [1]
    port: [2]
livenessProbe:
  httpGet:
    path: /healthz
    port: 8080
Drag options to blanks, or click blank then click option'
A/ready
B80
C8080
D/status
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong paths or mismatched ports causing probe failures.
5fill in blank
hard

Fill all three blanks to create a liveness probe with exec command, initial delay, and failure threshold.

Kubernetes
livenessProbe:
  exec:
    command:
    - [1]
  initialDelaySeconds: [2]
  failureThreshold: [3]
Drag options to blanks, or click blank then click option'
Apgrep
B15
C3
Dcurl
Attempts:
3 left
💡 Hint
Common Mistakes
Using HTTP commands in exec probe or setting too low failure threshold.