Observability Flashcards

1
Q

What is the imperative command to view the current Pod status for all pods?

A

kubectl get po

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

What are Pod conditions?

A

Additional information related to the Pod status. Array of boolean values, as to whether Pod is Scheduled, Initialized, ContainersReady, and Pod is Ready.

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

What is the imperative command to view the Pod conditions for a Pod? (e.g. for Pod po1)

A

kubectl describe po po1

View the Conditions section

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

What is the purpose of the Readiness probe?

A

Prevents service disruption while Pods are scaled up. The Readiness probe provides kubernetes with additional information about the state of the application running in a Pod. Kubernetes can use this to determine whether to send traffic to a Pod.

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

What are three ways of determining readiness of a Pod?

A
  • HTTP request to the Pod
  • TCP request to the Pod
  • Execute a Script within a container of the Pod
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In the Pod definition, how is an HTTP readiness probe declared? (e.g. HTTP on Port 80 for path /example/path)

A

spec: containers - readinessProbe: httpGet: path: /example/path port: 80

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

In the Pod definition, how is an TCP readiness probe declared? (e.g. TCP on Port 3000)

A

spec: containers: - readinessProbe: tcpSocket: port: 3000

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

In the Pod definition, how is an executable readiness probe declared? (e.g. cat file /var/log/ready)

A

spec: containers: - readinessProbe: exec: command: - cat - /var/log/ready

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

In the Pod definition, how are initial delay and how often to repeat a readiness probe defined? (e.g. 10 seconds for initial delay and 5 seconds for repetition)

A

spec: containers: - readinessProbe: initialDelaySeconds: 10 periodSeconds: 5

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

In the Pod definition, how is the maximum number of failures of the readiness probe defined? (e.g. 3 failures)

A

spec: containers: - readinessProbe: failureThreshold: 3

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

What is the purpose of the liveness probe?

A

Prevents traffic being sent to a probe that is not healthy. The liveness probe provides kubernetes with additional information about the state of the application running in a Pod. Kubernetes can use this to determine whether to send traffic to a Pod.

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

In the Pod definition, how is an HTTP liveness probe declared? (e.g. HTTP on Port 80 for path /api/healthy)

A

spec containers: - livenessProbe: httpGet: path: /api/healthy port: 80

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

In the Pod definition, how is an TCP readiness probe declared? (e.g. TCP on Port 3001)

A

spec: containers: - livenessProbe: tcpSocket: port: 3001

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

In the Pod definition, how is an executable readiness probe declared? (e.g. cat file /var/log/healthy)

A

spec: containers: - livenessProbe: exec: command: - cat - /var/log/healthy

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

In the Pod definition, how are initial delay and how often to repeat a liveness probe defined? (e.g. 10 seconds for initial delay and 5 seconds for repetition)

A

spec: containers: - livenessProbe: initialDelaySeconds: 10 periodSeconds: 5

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

In the Pod definition, how is the maximum number of failures of the liveness probe defined? (e.g. 3 failures)

A

spec: containers: - livenessProbe: failureThreshold: 3

17
Q

What is the imperative command for viewing logs of a Pod with a single container? (e.g. Pod po1)

A

kubectl logs po1

18
Q

What is the imperative command for viewing logs of a Pod with multiple containers? (e.g. Container c1 of Pod po1)

A

kubectl logs po1 c1

19
Q

What is the purpose of Metrics Server?

A

It provides metrics data about Kubernetes Pods and Nodes. One metrics server can be deployed per cluster. It aggregates the metrics and stores in memory.

20
Q

What is one limitation of Metrics Server?

A

It stores data in memory, and does not provide persistence.

21
Q

How does the Metrics Server work?

A

The cAdvisor component of Kubelet, which is installed on each node, collects metrics. Kubelet exposes these metrics through its API which Metrics Server can send requests to.

22
Q

How is metrics server deployed to kubernetes?

A

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml

23
Q

What is the imperative command for viewing metrics about nodes?

A

kubectl top node

24
Q

What is the imperative command for viewing metrics about pods?

A

kubectl top po