Container Orchestration
medium

Questão de Container Orchestration #019e3a4f

Enunciado da Questão
Container Orchestration
#kubernetes
#kubelet
#container
#health check
Médio

What is a probe within Kubernetes?

A

A monitoring mechanism of the Kubernetes API.

B

A pre-operational scope issued by the kubectl agent.

C

A diagnostic performed periodically by the kubelet on a container.

Correta
D

A logging mechanism of the Kubernetes API.

Explicação Oficial / Explicações da Comunidade

A probe in Kubernetes is a diagnostic performed periodically by the kubelet on a container to determine its health and readiness. The kubelet uses probes to decide when to restart a container (liveness probe), when to send traffic to a pod (readiness probe), and when a container has started successfully (startup probe). Probes can be executed via HTTP requests, TCP socket checks, or command execution inside the container.

How it Works
The kubelet, the primary node agent that runs on each Kubernetes node, is responsible for executing probes. For each container in a pod, the kubelet runs the configured probe at regular intervals (e.g., every 10 seconds). If a liveness probe fails, the kubelet kills the container and restarts it based on the pod's restart policy. If a readiness probe fails, the kubelet removes the pod's IP address from the endpoints of the service, stopping traffic from being routed to that pod. Startup probes are used to delay liveness and readiness checks until the container has fully started.

Why the Correct Value is Right
The correct definition states that a probe is "a diagnostic performed periodically by the kubelet on a container." This accurately describes the core function of probes in Kubernetes. The kubelet is the component that runs on each node and manages containers, and it performs these checks to ensure the container is healthy and ready to serve traffic.

Why the Incorrect Values are Wrong

  • "A monitoring mechanism of the Kubernetes API" is incorrect because probes are not part of the Kubernetes API itself; they are actions performed by the kubelet on the node. While the API defines probe configurations, the actual execution is done by the kubelet.
  • "A pre-operational scope issued by the kubectl agent" is incorrect because kubectl is a command-line tool for interacting with the Kubernetes API, not an agent that issues scopes. There is no concept of a "pre-operational scope" in Kubernetes.
  • "A logging mechanism of the Kubernetes API" is incorrect because probes are not related to logging. Logging in Kubernetes is typically handled by container logs and tools like Fluentd or Elasticsearch, not by probes.