not look into the network packets and perform application-level load balancing such as HTTP cookie-based session affinity. 

Readiness Probes 

In Chapter 4, Health Probe  you learned how to define a readinessProbe  for a container. If a Pod has defined readiness checks, and they are failing, the Pod is removed from the list of Service endpoints to call even if the label selector matches the Pod. 

Virtual IP 

When we create a Service with type: ClusterIP , it gets a stable virtual IP address. However, this IP address does not correspond to any network interface and doesn’t exist in reality. It is the kube-proxy that runs on every node that picks this new Service and updates the iptables of the node with rules to catch the net‐ work packets destined for this virtual IP address and replaces it with a selected Pod IP address. The rules in the iptables do not add ICMP rules, but only the protocol specified in the Service definition, such as TCP or UDP. As a conse‐ quence, it is not possible to ping  the IP address of the Service as that operation uses ICMP protocol. However, it is of course possible to access the Service IP address via TCP (e.g., for an HTTP request). 

Choosing ClusterIP 

During Service creation, we can specify an IP to use with the field .spec.clus terIP . It must be a valid IP address and within a predefined range. While not recommended, this option can turn out to be handy when dealing with legacy applications configured to use a specific IP address, or if there is an existing DNS entry we wish to reuse. 

Kubernetes Services with type: ClusterIP  are accessible only from within the clus‐ ter; they are used for discovery of Pods by matching selectors, and are the most com‐ monly used type. Next, we will look at other types of Services that allow discovery of endpoints that are manually specified. 

## Manual Service Discovery 

When we create a Service with selector , Kubernetes tracks the list of matching and ready-to-serve Pods in the list of endpoint resources. For Example 12-1, you can check all endpoints created on behalf of the Service with kubectl get endpoints random-generator . Instead of redirecting connections to Pods within the cluster, we could also redirect connections to external IP addresses and ports. We can do that by omitting the selector  definition of a Service and manually creating endpoint resour‐ ces, as shown in Example 12-3. 

