Diagnostics Periodically Performed by Kubelet in Containers
To perform diagnostics, kubelet calls handlers implemented by the container. These diagnostics are crucial for monitoring container health and ensuring proper operation.
Kubelet Probe Handlers
- ExecAction: Executes a specified command inside the container. The diagnostic is considered successful if the command exits with status code 0.
- TCPSocketAction: Performs a TCP check on the container's IP address at a specified port. The diagnostic is considered successful if the port is active.
- HTTPGetAction: Performs an HTTP Get request to the container's IP address at a specified port and path. The diagnostic is considered successful if the response status code is greater than 200 and less than 400.
Kubelet Probe Types
- livenessProbe: Determines if a container is running. If this probe fails, kubelet kills the container.
- readinessProbe: Determines if a container is ready to serve requests. If this probe fails, the container is removed from service load balancers.
- startupProbe: Indicates whether the application within the container is started. All other probes are disabled until this probe succeeds.
Probe Results
Success: The container passed the diagnostic check.
Failure: The container failed the diagnostic check.
Unknown: The diagnostic itself failed, so no action should be taken.
Kubelet Probe gRPC
Kubelet also supports probes using gRPC for applications that use this protocol for communication.
kubernetes Pod의 진단을 담당하는 서비스 : probe
프로브(Probe)는 컨테이너에서 kubelet 에 의해 주기적으로 수행되는 진단(diagnostic)이다. 진단을 수행하기 위해서, kubelet은 컨테이너에 의해서 구현된 핸들러를 호출한다. 핸들러 에는 다음과 같이 세 가지 타입이 있다. ExecAction : 컨테이너 내에서 지정된 명령어를 실행한다. 명령어 상태 코드 0으로 종료되면 진단이 성공한 것으로 간주한다. TCPSocketAction : 지정된 포트에서 컨테이너의 IP 주소에 대해 TCP 검사를 수행한다.
https://medium.com/finda-tech/kubernetes-pod%EC%9D%98-%EC%A7%84%EB%8B%A8%EC%9D%84-%EB%8B%B4%EB%8B%B9%ED%95%98%EB%8A%94-%EC%84%9C%EB%B9%84%EC%8A%A4-probe-7872cec9e568

파드 라이프사이클
이 페이지에서는 파드의 라이프사이클을 설명한다. 파드는 정의된 라이프사이클을 따른다. Pending 단계에서 시작해서, 기본 컨테이너 중 적어도 하나 이상이 OK로 시작하면 Running 단계를 통과하고, 그런 다음 파드의 컨테이너가 실패로 종료되었는지 여부에 따라 Succeeded 또는 Failed 단계로 이동한다. 파드가 실행되는 동안, kubelet은 일종의 오류를 처리하기 위해 컨테이너를 다시 시작할 수 있다.
https://kubernetes.io/ko/docs/concepts/workloads/pods/pod-lifecycle/#%EC%BB%A8%ED%85%8C%EC%9D%B4%EB%84%88-%ED%94%84%EB%A1%9C%EB%B8%8C-probe


Seonglae Cho