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
Find the name of the CodeReady Workspaces Operator Deployment. Usually it is
codeready-workspaces-operator
:$ oc get deployments -n openshift-workspaces
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.
- Wait while CodeReady Workspaces Operator restarts some components.
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
Find the name of the CodeReady Workspaces Operator Deployment. Usually it is
codeready-workspaces-operator
:$ oc get deployments -n openshift-workspaces
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.
- 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
Find the CodeReady Workspaces Operator subscription name:
$ oc get subscriptions -n openshift-workspaces
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
Edit the
ClusterServiceVersion
YAML manifest:$ oc edit csv <csv-name> -n openshift-workspaces
Add the following environment variable to the Operator Deployment spec:
- name: ADD_COMPONENT_READINESS_INIT_CONTAINERS value: "true"
- Wait for the CodeReady Workspaces Operator restart to finish. The restarted Operator will then continue with restarting some of its components.
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
Find the CodeReady Workspaces Operator subscription name:
$ oc get subscriptions -n openshift-workspaces
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
Edit the
ClusterServiceVersion
YAML manifest:$ oc edit csv <csv-name> -n openshift-workspaces
Remove the following environment variable from the Operator Deployment spec:
- name: ADD_COMPONENT_READINESS_INIT_CONTAINERS value: "true"
- Wait for the CodeReady Workspaces Operator restart to finish. The restarted Operator will then continue with restarting some of its components.