Pods Flashcards
How many container probes are there and which are they?
3, livelinessProbe, readinessProbe, startupProbe
the livelinessProbe checks if the application is healthy if not the resource is restarted,
the readinessProbe checks if the application is ready to receive traffic if not requests are not send to it,
the startupProbe prevents other probes from being checked until the application as started usefull for slow starting applications.
What does the livelinessProbe checks?
Checks if a container needs to be restarted
What does the readinessProbe check?
Checks if a container is ready to accept traffic
What does the startupProbe check?
Checks if the application has started and if the other probes can start to run
What kubernetes component runs probes?
The kubelet component
How many check mechanisms are there and which are they?
exec, httpGet, grpc, tcp, tcpSocket
What are the common configuration options for probes?
initialDelaySeconds, timeoutSeconds, periodSeconds, failureThreshold
What is the difference between requested memory and cpu and limit memory and cpu?
Requested is the minimum viable amount of memory or cpu, whilst limit is the maximum
write the spec part of a pod that needs to run the following command: “sh -c ‘while sleep 3600; do :; done’”
spec:
containers:
- name: pod
image: nginx
args:
- sh
- -c
- ‘while sleep 3600;do :; done’
resources:
requests:
cpu: 1
memory: 250Mi
limits:
cpu: 2.5
memory: 300Mi