Observability & Maintenance Flashcards

(16 cards)

1
Q

What is a Liveness Probe?

A

Checks if the container is running. If it fails; K8s kills and restarts the container.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a Readiness Probe?

A

Checks if the container is ready to serve traffic. If it fails; the Pod is removed from Service endpoints.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a Startup Probe?

A

Disables Liveness/Readiness checks until the container has finished its initial startup.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you view logs for a pod named ‘myapp’?

A

kubectl logs myapp

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you view logs for a specific container in a multi-container pod?

A

kubectl logs myapp -c <container-name></container-name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What command shows why a Pod failed to start?

A

kubectl describe pod <name></name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do you see the CPU/Memory usage of pods?

A

kubectl top pod

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

If a Pod status is ‘OOMKilled’; what was the likely cause?

A

The container tried to use more memory than its ‘limits.memory’ allowed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between ‘initialDelaySeconds’ and ‘startupProbe’?

A

startupProbe disables liveness/readiness checks until the app is ready; whereas initialDelay is a static wait time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you stream logs from all pods with the label ‘app=frontend’?

A

kubectl logs -l app=frontend

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which command shows you the Events of a namespace in chronological order?

A

kubectl get events –sort-by=’.lastTimestamp’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do you run a shell in a running pod to inspect its filesystem?

A

kubectl exec -it <pod-name> -- /bin/sh</pod-name>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

If a Pod is ‘Pending’; what is the most common reason related to resources?

A

Insufficient CPU or Memory on available nodes to satisfy the Pod’s ‘requests’.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

If kubectl commands are timing out, which master component should you check first?

A

The Kube-APIServer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the difference between ‘kubectl logs’ and ‘journalctl -u kubelet’?

A

‘kubectl logs’ is for pod containers; ‘journalctl’ is for the system service (Kubelet) running on the node.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A node is ‘NotReady’ and the Kubelet is running. What is the next thing to check?

A

Node disk space, memory pressure, or the CNI (network) plugin status.