此内容没有您所选择的语言版本。

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

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.