Chapter 4. Working with services

 

This chapter covers

  • Testing application resiliency
  • Working with labels and selectors
  • Scaling applications
  • Tracking application health and status

In chapter 2, you deployed your first application in OpenShift and reviewed many of the components that were created. You confirmed that all the components worked together to deliver two deployments of the Image Uploader application. In this chapter, we’ll discuss those relationships in depth, and how OpenShift recovers when those relationships are altered.

4.1. Testing application resiliency

When you deployed the Image Uploader application in chapter 2, one pod was created for each deployment. If that pod crashed, the application would be temporarily unavailable until a new pod was created to replace it. If your application became more popular, you wouldn’t be able to support new users past the capacity of a single pod. To solve this problem and provide scalable applications, OpenShift deploys each application with the ability to scale up and down. The application component that handles scaling application pods is called the replication controller (RC).

4.1.1. Understanding replication controllers

The RC’s main function is to ensure that the desired number of identical pods is running at all times. If a pod exits or fails, the RC deploys a new one to ensure a healthy application is always available (see figure 4.1).

4.2. Scaling applications

4.3. Maintaining healthy applications

4.4. Summary