19.06.2021 Views

148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 7 ■ Using Services

Another issue associated with services is that when a new RC is created, pods do not start immediately

and take a certain time (which could be a few seconds). A service representing the RC would need to know

when the containers in a pod are ready so that the service can route traffic to the pod.

Solution

The service is a REST object similar to a pod and provides object-oriented benefits such as modularity or

packaging, abstraction and reuse. Decoupling the service from the controller implements the SRP, and either

the service or controller may be modified or deleted without having to modify or delete the other. Multiple

replication controllers may be kept indefinitely, as shown in Figure 7-2, to meet the requirement of DevOps

teams. A replication controller only manages the pods, and a service only exposes endpoints to access pods.

Decoupling controller and service is a management design pattern.

Replication

Controller

Service

Replication

Controller

Replication

Controller

Figure 7-2. Service associated with multiple replication controllers

Another management pattern used in services is a readiness probe. A readiness probe is used to find

whether a pod’s containers are ready to receive traffic.

Overview

Table 7-1 describes the different ServiceTypes.

154

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!