Observability - Readiness Probes Flashcards

1
Q

What POD Status exist and what do they mean?

A
  • Pending: when first created, scheduler tries to find a node for the pod, if none found stays in pending state
  • ContainerCreating: once scheduled, images required are pulled and containers are started
  • Running: Container running, till process fulfilled successfully etc,
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are POD Conditions and what do they do?

A
  • complement pod status
  • array of true or false status that tell us the state of a pod
    Instances:
  • PodScheduled: pod scheduled on a node
  • Initialized: when pod is initialized
  • ContainersReady: when all containers in the pod are ready
  • Ready: pod itself is read with everything, sometimes applications might still be ‘warming up’

Described in ‘kubectl describe pod …’

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

How does Kubernetes know that the application inside a container is actually running and available for input?

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

What kind of Readiness Probes exist?

A
  • HTTP Test against URL/Endpoint
  • TCP Test to see if port is open
  • Exec command, to run a custom script that checks if application is ready
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do we define a Readiness probe?

A

pod-yaml:
~~~

spec:
containers:
- name:
readinessProbe: (http)
httpGet:
path: /api/ready
port: 8080
(optional) initialDelaySecons: 10
(optional) periodSeconds: 5
(optional) failureTreshold: 8
///

readinessProbe: (tcp)
tcpSocket:
port: 3306
///

readinessProbe: (exec)
exec:
command:
- cat
- /app/is_ready
~~~

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

What is the consequence of a ReadinessProbe?

A

Kubernetes does not set Status Ready as soon as pod is ready
- tests instead, whether the api respons positively
- until then, no traffic is forwarded to the pod

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

How are Readiness Probes useful in a multi-pod environment

A
  • without, container would be shown ready, while app is still warming up
  • service would immediately start routing requests to the still starting server
How well did you know this?
1
Not at all
2
3
4
5
Perfectly