5. Observability Flashcards
Part of observability
Readliness Probes
Container Logging
Monitor and Debug Applications
Liveness Probes
POD Status | POD Conditions
Status
- Pending >
Scheduler try to where to place the pod.
To figure out why the POD remain in that state
$ kubectl describe pod <pod-name>
- ContainerCreating >
when the container it's creating in a node.
- Running >
until the program completed</pod-name>
POD Conditions
PodSchedule TRUE | FALSE
Initialized TRUE | FALSE
ContainersReady TRUE | FALSE
Ready TRUE | FALSE
Readliness Probes - HTTP Test
readlinessProbe: httpGet: path: /api/ready port: 8080 initialDelaySeconds: 10 periodSeconds: 5
Readliness Probes - TCP Test
readlinessProbe: tcpSocket: port: 3306
How is defined a Readliness Probes - Exec command
readlinessProbe: tcpSocket: port: 3306
Liveness Probes
apiVersion: v1 kind: Pod metadata: name: simple-webapp labels: name: simple-webapp spec: containers: - name: simple-webapp image: simple-webapp ports: - containersPort: 8080 livenessProbe: httpGet: path: /api/healthy port: 8080
Liveness Probes - HTTP test
livenessProbe: httpGet: path: /api/healthy port: 8080 initialDelaySeconds: 10 periodSeconds: 5 failureThreshold: 8
Liveness Probes - TCP Test
livenessProbe: tcpSocket: probe: 3306
Liveness proves - exec command
livenessProbe: exec: command: - cat - /app/is_healthy
Container logging
```
kubectl logs <pod-name> --follow
~~~</pod-name>
How we can monitor the pods
kubectl top pod