What's the meaning of READY2/2 output by command kubectl get pod yourpod
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
In Kubernetes, when you execute the command kubectl get pod $yourpod, you're accessing detailed information about the specified pod. Amongst the columns presented, you'll often see an entry denoted as READY. This article delves into the meaning of the READY=2/2 output, providing both a technical breakdown and practical examples.
Understanding the READY Column
In the output of kubectl get pod, the READY column provides insights into the status of the containers within a pod. Specifically, it signifies the ratio of containers that are considered "ready" versus the total number of containers within that pod. Each part of the ratio can be interpreted as:
- Current Ready Containers: The number before the slash (
/) indicates how many containers in the pod are in a ready state. - Total Containers: The number after the slash (
/) represents the total count of containers that form the pod.
Breaking Down READY=2/2
When you encounter READY=2/2, it signifies that the pod consists of two containers and both are in a ready state. This result is an indicator of healthy and functioning containers within a pod, ready to handle incoming requests and perform their designated tasks.
Example Scenario
Consider a pod designed to host a web application:
- First Container: Hosts a web server like Nginx, which serves static content.
- Second Container: Runs an application server, perhaps Python's Flask, that handles dynamic content processing.
If both containers initialize correctly and pass their respective readiness probes, the READY status will display as 2/2.
Readiness Probes
Readiness probes are a crucial component in determining the "readiness" of each container. They allow Kubernetes to decide whether a container is ready to start accepting traffic.
- HTTP Probes: SEND an HTTP GET request to the container's IP address. If the response is within the desired range (200-399), the container is marked as ready.
- TCP Probes: Attempt to open a TCP connection to the container. Successful connections denote a ready state.
- Command Probes: Execute commands within the container. A successful exit status indicates readiness.
Configuring Readiness Probes
Here's an example of defining a readiness probe for a container in a pod's configuration:
This configuration checks the /healthz endpoint on port 8080 after an initial delay of 5 seconds, repeating every 10 seconds.
Common READINESS States and Their Implications
Below is a table summarizing various readiness states and their potential implications:
| Ready State | Explanation | Implications |
0/2 | No containers are ready. | Could be due to startup delays or failures in initialization. |
1/2 | One container is ready while the other is not. | Possible issue in a specific container that requires further inspection. |
2/2 | All containers are ready. | The pod and its containers are functioning as expected. |
Additional Considerations
- Initial Delays and Timeouts: Often, configuring readiness probes includes setting initial delays and timeouts during which a container can perform startup tasks before being marked as not ready.
- Impact on Service Routing: Kubernetes will route traffic to only those pods where all containers are confirmed by readiness probes, ensuring only fully operational services receive user requests.
- Monitoring and Alerting: It is essential to set up monitoring systems like Prometheus in tandem with Kubernetes to alert when a pod's readiness status is anything other than the expected state.
In conclusion, the READY=2/2 output from kubectl get pod $yourpod acts as a positive indication of your pod's operational health. Understanding this metric, alongside configuring effective readiness probes, is essential for ensuring your services remain robust and responsive within the Kubernetes ecosystem.
Related reading
- What's the most elegant/right way to stop a spark job running on a Kubernetes cluster?
- When does Kafka Leader Election happen?
- When exactly do I set an ownerReference's controller field to true?
- When I run sudo minikube start --vm-drivernone it gives me error
- What's the recommended way of iterating a container in C11?
- What''s the target group port for, when using Application Load Balancer EC2 Container Service
- What's the most efficient way to determine the minimum AWS permissions necessary for a Terraform configuration?
- What's the risk of deploying debug symbols pdb file in a production environment?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.