Observability Flashcards
What is the imperative command to view the current Pod status for all pods?
kubectl get po
What are Pod conditions?
Additional information related to the Pod status. Array of boolean values, as to whether Pod is Scheduled, Initialized, ContainersReady, and Pod is Ready.
What is the imperative command to view the Pod conditions for a Pod? (e.g. for Pod po1)
kubectl describe po po1
View the Conditions section
What is the purpose of the Readiness probe?
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.
What are three ways of determining readiness of a Pod?
- HTTP request to the Pod
- TCP request to the Pod
- Execute a Script within a container of the Pod
In the Pod definition, how is an HTTP readiness probe declared? (e.g. HTTP on Port 80 for path /example/path)
spec: containers - readinessProbe: httpGet: path: /example/path port: 80
In the Pod definition, how is an TCP readiness probe declared? (e.g. TCP on Port 3000)
spec: containers: - readinessProbe: tcpSocket: port: 3000
In the Pod definition, how is an executable readiness probe declared? (e.g. cat file /var/log/ready)
spec: containers: - readinessProbe: exec: command: - cat - /var/log/ready
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)
spec: containers: - readinessProbe: initialDelaySeconds: 10 periodSeconds: 5
In the Pod definition, how is the maximum number of failures of the readiness probe defined? (e.g. 3 failures)
spec: containers: - readinessProbe: failureThreshold: 3
What is the purpose of the liveness probe?
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.
In the Pod definition, how is an HTTP liveness probe declared? (e.g. HTTP on Port 80 for path /api/healthy)
spec containers: - livenessProbe: httpGet: path: /api/healthy port: 80
In the Pod definition, how is an TCP readiness probe declared? (e.g. TCP on Port 3001)
spec: containers: - livenessProbe: tcpSocket: port: 3001
In the Pod definition, how is an executable readiness probe declared? (e.g. cat file /var/log/healthy)
spec: containers: - livenessProbe: exec: command: - cat - /var/log/healthy
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)
spec: containers: - livenessProbe: initialDelaySeconds: 10 periodSeconds: 5