Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

3.2. Preparing the green nodes

To migrate pods from the blue environment to the green, you must pull the required container images.

Network latency and load on the registry can cause delays if the environment does not have sufficient capacity. You can minimize impact to the running system by importing new image streams to trigger new pod deployments to the new nodes.

Major releases of OpenShift Container Platform, and sometimes asynchronous errata updates, introduce new image streams for builder images for users of Source-to-Image (S2I). Upon import, any builds or deployments configured with image change triggers are automatically created.

Another benefit of triggering the builds is that it fetches the majority of the ancillary images to all node hosts, such as the various builder images, the pod infrastructure image, and deployers. The green nodes are then prepared for the expected load increase, and the remaining images more quickly migrated during node evacuation.

When you are ready to continue with the upgrade process, follow these steps to warm the green nodes:

  1. Set the green nodes to schedulable so that new pods are deployed to them:

    $ oc adm manage-node --schedulable=true --selector=color=green
  2. Set the blue nodes to unschedulable so that no new pods run on them:

    $ oc adm manage-node --schedulable=false --selector=color=blue
  3. Update the node selectors for the registry and router deployment configurations to use the node-role.kubernetes.io/infra=true label. This change starts new deployments that place the registry and router pods on your new infrastructure nodes.

    1. Edit the docker-registry deployment configuration:

      $ oc edit -n default dc/docker-registry
    2. Update the nodeSelector parameter to use the following value, with "true" in quotation marks, and save your changes:

            nodeSelector:
              node-role.kubernetes.io/infra: "true"
    3. Edit the router deployment configuration:

      $ oc edit -n default dc/router
    4. Update the nodeSelector parameter to use the following value, with "true" in quotation marks, and save your changes:

            nodeSelector:
              node-role.kubernetes.io/infra: "true"
    5. Verify that the docker-registry and router pods are running and in ready state on the new infrastructure nodes:

      $ oc get pods -n default -o wide
      
      NAME                       READY     STATUS    RESTARTS   AGE       IP                NODE
      docker-registry-2-b7xbn    1/1       Running   0          18m       10.128.0.188      infra-node3.example.com
      router-2-mvq6p             1/1       Running   0          6m        192.168.122.184   infra-node4.example.com
  4. Update the default image streams and templates.
  5. Import the latest images. This process can trigger a large number of builds, but the builds are performed on the green nodes and, therefore, do not impact any traffic on the blue deployment.
  6. To monitor build progress across all namespaces (projects) in the cluster:

    $ oc get events -w --all-namespaces

    In large environments, builds rarely completely stop. However, you should see a large increase and decrease caused by the administrative image import.