Chapter 10. Readiness init containers


CodeReady Workspaces Operator installs CodeReady Workspaces and starts its containers in the correct order. If a node with CodeReady Workspaces is restarted and all CodeReady Workspaces containers start simultaneously, some containers may fail because some other component they depend on is not ready. To avoid such failures, the readiness init containers queue the containers for CodeReady Workspaces components to start in the correct order.

The readiness init containers are disabled by default. If you choose to enable them, proceed according to the installation method used to install CodeReady Workspaces:

10.1. Enabling and disabling the readiness init containers for the Operator installer

You can enable and disable the readiness init containers for the CodeReady Workspaces installed by the Operator installer:

10.2. Enabling the readiness init containers for the Operator installer

The readiness init containers are not enabled by default, so to use them you first have to enable them. To enable the readiness init containers for the CodeReady Workspaces installed by the Operator installer:

Prerequisites

  • Red Hat CodeReady Workspaces installed by the Operator installer.

Procedure

  1. Find the name of the CodeReady Workspaces Operator Deployment. Usually it is codeready-workspaces-operator:

    $ oc get deployments -n openshift-workspaces
  2. Edit the Deployment as follows: Under spec.template.spec.containers[0].env of the Operator Deployment, insert the following lines:

     - name: ADD_COMPONENT_READINESS_INIT_CONTAINERS 1
       value: "true"
    1
    ADD_COMPONENT_READINESS_INIT_CONTAINERS is an environment variable.
  3. Wait while CodeReady Workspaces Operator restarts some components.
Note

Repeat these steps after each CodeReady Workspaces upgrade when a new Operator Deployment is created.

10.3. Disabling the readiness init containers for the Operator installer

To disable the previously enabled readiness init containers for the CodeReady Workspaces installed by the Operator installer:

Prerequisites

  • Red Hat CodeReady Workspaces installed by the Operator installer.

Procedure

  1. Find the name of the CodeReady Workspaces Operator Deployment. Usually it is codeready-workspaces-operator:

    $ oc get deployments -n openshift-workspaces
  2. Edit the Deployment as follows: Under spec.template.spec.containers[0].env of the Operator Deployment, remove the following lines:

     - name: ADD_COMPONENT_READINESS_INIT_CONTAINERS 1
       value: "true"
    1
    ADD_COMPONENT_READINESS_INIT_CONTAINERS is an environment variable.
  3. Wait while CodeReady Workspaces Operator restarts some components.

10.4. Enabling and disabling the readiness init containers for the OLM installer

You can enable and disable the readiness init containers for the CodeReady Workspaces installed by the OLM installer. (Available through crwctl, the OLM installer uses the Operator Lifecycle Manager to install CodeReady Workspaces.)

10.5. Enabling the readiness init containers for the OLM installer

The readiness init containers are not enabled by default, so to use them you first have to enable them. To enable the readiness init containers for the CodeReady Workspaces installed by the OLM installer:

Prerequisites

  • CodeReady Workspaces is installed by the OLM installer.

Procedure

  1. Find the CodeReady Workspaces Operator subscription name:

    $ oc get subscriptions -n openshift-workspaces
  2. Get the CSV (Cluster Service Version) name from the CodeReady Workspaces Operator subscription:

    $ oc get subscription <subscription-name> -n openshift-workspaces -o yaml | grep installedCSV
  3. Edit the ClusterServiceVersion YAML manifest:

    $ oc edit csv <csv-name> -n openshift-workspaces
  4. Add the following environment variable to the Operator Deployment spec:

     - name: ADD_COMPONENT_READINESS_INIT_CONTAINERS
       value: "true"
  5. Wait for the CodeReady Workspaces Operator restart to finish. The restarted Operator will then continue with restarting some of its components.
Note

Repeat these steps after each CodeReady Workspaces upgrade when a new CSV is created by OLM.

10.6. Disabling the readiness init containers for the OLM installer

To disable the previously enabled readiness init containers for the CodeReady Workspaces installed by the OLM installer:

Prerequisites

  • CodeReady Workspaces is installed by the OLM installer.

Procedure

  1. Find the CodeReady Workspaces Operator subscription name:

    $ oc get subscriptions -n openshift-workspaces
  2. Get the CSV (Cluster Service Version) name from the CodeReady Workspaces Operator subscription:

    $ oc get subscription <subscription-name> -n openshift-workspaces -o yaml | grep installedCSV
  3. Edit the ClusterServiceVersion YAML manifest:

    $ oc edit csv <csv-name> -n openshift-workspaces
  4. Remove the following environment variable from the Operator Deployment spec:

     - name: ADD_COMPONENT_READINESS_INIT_CONTAINERS
       value: "true"
  5. Wait for the CodeReady Workspaces Operator restart to finish. The restarted Operator will then continue with restarting some of its components.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.