第9章 ワークスペースの起動を迅速化するイメージのキャッシュ

CodeReady Workspaces ワークスペースの起動時間のパフォーマンスを改善するには、Image Puller を使用して OpenShift クラスターのイメージの事前プルに使用できる CodeReady Workspaces に依存しないコンポーネントを使用します。Image Puller は、関連する CodeReady Workspaces ワークスペースイメージを各ノードで事前にプルするように設定できる DaemonSet を作成する追加の OpenShift デプロイメントです。これらのイメージは、CodeReady Workspaces ワークスペースの起動時にすでに利用可能なため、ワークスペースの開始時間が改善されています。

Image Puller は、設定用に以下のパラメーターを提供します。

表9.1 Image Puller パラメーター

パラメーター使用法デフォルト

CACHING_INTERVAL_HOURS

デーモンセットのヘルスチェック間隔(時間単位)

"1"

CACHING_MEMORY_REQUEST

Puller の実行時にキャッシュされる各イメージのメモリー要求。「Image Puller のメモリーパラメーターの定義」 を参照してください。

10Mi

CACHING_MEMORY_LIMIT

Puller の実行時にキャッシュされる各イメージのメモリー制限。「Image Puller のメモリーパラメーターの定義」 を参照してください。

20Mi

CACHING_CPU_REQUEST

Puller の実行時にキャッシュされる各イメージのプロセッサー要求

.05 または 50 ミリコア

CACHING_CPU_LIMIT

Puller の実行時にキャッシュされる各イメージのプロセッサー制限

.2 または 200 ミリコア

DAEMONSET_NAME

作成するデーモンセットの名前

kubernetes-image-puller

DEPLOYMENT_NAME

作成するデプロイメントの名前

kubernetes-image-puller

NAMESPACE

作成するデーモンセットが含まれる OpenShift プロジェクト

k8s-image-puller

IMAGES

プルするイメージのセミコロンで区切られた一覧 (<name1>=<image1>;<name2>=<image2> の形式) 「プルするイメージの一覧の定義」 を参照してください。

 

NODE_SELECTOR

デーモンセットによって作成される Pod に適用するノードセレクター

'{}'

AFFINITY

DaemonSet によって作成される Pod に適用されるアフィニティー

'{}'

IMAGE_PULL_SECRETS

DeamonSet で作成される Pod に追加する pullsecret1;…​ 形式のイメージプルシークレットの一覧。これらのシークレットはイメージ puller の namespace に配置し、クラスター管理者はそれらを作成する必要があります。

""

9.1. プルするイメージの一覧の定義

Image Puller は、che-machine-exec などの scratch イメージを含むほとんどのイメージを事前プルできます。ただし、traefik などの Dockerfile にボリュームをマウントするイメージは、OpenShift 3.11 における事前プルではサポートされません。

ワークスペースの起動に関連するイメージの事前プルが行われると、ワークスペースの起動時間が短縮されます。以下は例になります。

  • Che-Theia
  • ブローカーイメージ
  • プラグインサイドカーイメージ

前提条件

手順

  1. OpenShift プラットフォームの関連するコンテナーイメージの一覧を収集します。

    例9.1 CodeReady Workspaces 2.13 のすべてのイメージ一覧の取得

  2. ワークスペースの起動フェーズに関連するイメージを保持します。

    • eap
    • machineexec
    • mongodb
    • pluginbroker
    • plugin-
    • stacks
    • theia
    • ubi-minimal
  3. ターゲットプラットフォームで対応していないコンテナーイメージの一覧から除外します。

    • AMD64 および Intel 64 (x86_64)の場合は、openj9 イメージを除外します。

      例9.2 openj9 イメージを除く AMD64 および Intel 64 (x86_64)のイメージ一覧

      che_workspace_plugin_broker_artifacts=registry.redhat.io/codeready-workspaces/pluginbroker-artifacts-rhel8@sha256:bb471b89e7df1f2178bf0e2c75b5d71601e35555b31358138c9933391e5f00f0;
      che_workspace_plugin_broker_metadata=registry.redhat.io/codeready-workspaces/pluginbroker-metadata-rhel8@sha256:db2838f1a2a868d9f3e2b2f7eb9db12fe0e41a0e7bb053dbe11661b235b1db59;
      codeready_workspaces_machineexec_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/machineexec-rhel8@sha256:3d453b099d33f8024e2f5a7b0ed312bebe5f9cc74d4e27b0e1b70d94aa8605d7;
      codeready_workspaces_plugin_java11_devfile_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:eba0875477a9a116cf0e2697048cb586c9b32e90cf21ff4b3dfd70fab77c5fd0;
      codeready_workspaces_plugin_java11_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:eba0875477a9a116cf0e2697048cb586c9b32e90cf21ff4b3dfd70fab77c5fd0;
      codeready_workspaces_plugin_java8_devfile_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-java8-rhel8@sha256:81548d8559fdc3ba3e2b1ec398f3bd94728e8e4037a4c3a180177f20c9704db9;
      codeready_workspaces_plugin_java8_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-java8-rhel8@sha256:81548d8559fdc3ba3e2b1ec398f3bd94728e8e4037a4c3a180177f20c9704db9;
      codeready_workspaces_plugin_kubernetes_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-kubernetes-rhel8@sha256:b284a345abe28ecbeb51261bd99a89870f4a0b37fea4780e3e31d7e2a946936c;
      codeready_workspaces_plugin_openshift_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-openshift-rhel8@sha256:7b176e808a370a7ea115652463a2035a324e1e5ab0286bc8091284ee005e47d4;
      codeready_workspaces_stacks_cpp_devfile_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:b3c318ddf23e6fcdd8cc307b135a3e570a6787f97b51461daf94948ddddb6171;
      codeready_workspaces_stacks_cpp_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:b3c318ddf23e6fcdd8cc307b135a3e570a6787f97b51461daf94948ddddb6171;
      codeready_workspaces_stacks_dotnet_devfile_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-dotnet-rhel8@sha256:6f0534ca7f9727a57719f99fe02fe72557d814d28d7dc233de32bb0496422835;
      codeready_workspaces_stacks_dotnet_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-dotnet-rhel8@sha256:6f0534ca7f9727a57719f99fe02fe72557d814d28d7dc233de32bb0496422835;
      codeready_workspaces_stacks_golang_devfile_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:415c265e03a1f253fb5484139653a3363c7ad466263bf6ab3a9bd201369324cc;
      codeready_workspaces_stacks_golang_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:415c265e03a1f253fb5484139653a3363c7ad466263bf6ab3a9bd201369324cc;
      codeready_workspaces_stacks_php_devfile_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:3a6ff083fde5d262456c96b4752e3d802046ef14d9864f52aa31176aff18bcdd;
      codeready_workspaces_stacks_php_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:3a6ff083fde5d262456c96b4752e3d802046ef14d9864f52aa31176aff18bcdd;
      codeready_workspaces_theia_endpoint_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/theia-endpoint-rhel8@sha256:ae77e83cdf64acd95c0558261c6e5a35049a894f39a7e1debfb709c3b976b262;
      codeready_workspaces_theia_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/theia-rhel8@sha256:d9e2e5d0690874f8e9ff47c3badd533ac4addd2a54182ac8a5de3a34b0f1497a;
      jboss_eap_7_eap74_openjdk8_openshift_rhel7_devfile_registry_image_g4xdilrqbi______=registry.redhat.io/jboss-eap-7/eap74-openjdk8-openshift-rhel7@sha256:b4a113c4d4972d142a3c350e2006a2b297dc883f8ddb29a88db19c892358632d;
      jboss_eap_7_eap_xp3_openjdk11_openshift_devfile_registry_image_gmxdaljzbi______=registry.redhat.io/jboss-eap-7/eap-xp3-openjdk11-openshift-rhel8@sha256:3875b2ee2826a6d8134aa3b80ac0c8b5ebc4a7f718335d76dfc3461b79f93d19;
      pvc_jobs=registry.redhat.io/ubi8/ubi-minimal@sha256:c536d4c63253318fdfc1db499f8f4bb0881db7fbd6f3d1554b4d54c812f85cc7;
      rhscl_mongodb_36_rhel7_devfile_registry_image_gewtkmak=registry.redhat.io/rhscl/mongodb-36-rhel7@sha256:9f799d356d7d2e442bde9d401b720600fd9059a3d8eefea6f3b2ffa721c0dc73;
    • IBM Z および IBM Power Systems の場合は、java8 および java11openj9 バージョンを使用しdotnet を除外します。

      例9.3 IBM Z および IBM Power Systems のイメージ一覧: java8 および java11openj9 バージョンを使用し、dotnet を除く

      che_workspace_plugin_broker_artifacts=registry.redhat.io/codeready-workspaces/pluginbroker-artifacts-rhel8@sha256:bb471b89e7df1f2178bf0e2c75b5d71601e35555b31358138c9933391e5f00f0;
      che_workspace_plugin_broker_metadata=registry.redhat.io/codeready-workspaces/pluginbroker-metadata-rhel8@sha256:db2838f1a2a868d9f3e2b2f7eb9db12fe0e41a0e7bb053dbe11661b235b1db59;
      codeready_workspaces_machineexec_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/machineexec-rhel8@sha256:3d453b099d33f8024e2f5a7b0ed312bebe5f9cc74d4e27b0e1b70d94aa8605d7;
      codeready_workspaces_plugin_java11_openj9_devfile_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-java11-openj9-rhel8@sha256:90b7403f9833e393759bde7df0544518bb141ce7c0072217194b953a8d4b4f82;
      codeready_workspaces_plugin_java11_openj9_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-java11-openj9-rhel8@sha256:90b7403f9833e393759bde7df0544518bb141ce7c0072217194b953a8d4b4f82;
      codeready_workspaces_plugin_java8_openj9_devfile_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-java8-openj9-rhel8@sha256:4dd576f6cfd6ef0355d577ce751175ad3ac21d53b1a6ce056c7df01169918aec;
      codeready_workspaces_plugin_java8_openj9_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-java8-openj9-rhel8@sha256:4dd576f6cfd6ef0355d577ce751175ad3ac21d53b1a6ce056c7df01169918aec;
      codeready_workspaces_plugin_kubernetes_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-kubernetes-rhel8@sha256:b284a345abe28ecbeb51261bd99a89870f4a0b37fea4780e3e31d7e2a946936c;
      codeready_workspaces_plugin_openshift_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/plugin-openshift-rhel8@sha256:7b176e808a370a7ea115652463a2035a324e1e5ab0286bc8091284ee005e47d4;
      codeready_workspaces_stacks_cpp_devfile_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:b3c318ddf23e6fcdd8cc307b135a3e570a6787f97b51461daf94948ddddb6171;
      codeready_workspaces_stacks_cpp_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:b3c318ddf23e6fcdd8cc307b135a3e570a6787f97b51461daf94948ddddb6171;
      codeready_workspaces_stacks_golang_devfile_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:415c265e03a1f253fb5484139653a3363c7ad466263bf6ab3a9bd201369324cc;
      codeready_workspaces_stacks_golang_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:415c265e03a1f253fb5484139653a3363c7ad466263bf6ab3a9bd201369324cc;
      codeready_workspaces_stacks_php_devfile_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:3a6ff083fde5d262456c96b4752e3d802046ef14d9864f52aa31176aff18bcdd;
      codeready_workspaces_stacks_php_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:3a6ff083fde5d262456c96b4752e3d802046ef14d9864f52aa31176aff18bcdd;
      codeready_workspaces_theia_endpoint_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/theia-endpoint-rhel8@sha256:ae77e83cdf64acd95c0558261c6e5a35049a894f39a7e1debfb709c3b976b262;
      codeready_workspaces_theia_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/theia-rhel8@sha256:d9e2e5d0690874f8e9ff47c3badd533ac4addd2a54182ac8a5de3a34b0f1497a;
      jboss_eap_7_eap74_openjdk8_openshift_rhel7_devfile_registry_image_g4xdilrqbi______=registry.redhat.io/jboss-eap-7/eap74-openjdk8-openshift-rhel7@sha256:b4a113c4d4972d142a3c350e2006a2b297dc883f8ddb29a88db19c892358632d;
      jboss_eap_7_eap_xp3_openj9_11_openshift_devfile_registry_image_gmxdacq_=registry.redhat.io/jboss-eap-7/eap-xp3-openj9-11-openshift-rhel8@sha256:44f82c43a730acbfb4ce2be81ca32197099c370eeb85cedbee3d1e89e9ac7684;
      jboss_eap_7_eap_xp3_openjdk11_openshift_devfile_registry_image_gmxdaljzbi______=registry.redhat.io/jboss-eap-7/eap-xp3-openjdk11-openshift-rhel8@sha256:3875b2ee2826a6d8134aa3b80ac0c8b5ebc4a7f718335d76dfc3461b79f93d19;
      pvc_jobs=registry.redhat.io/ubi8/ubi-minimal@sha256:c536d4c63253318fdfc1db499f8f4bb0881db7fbd6f3d1554b4d54c812f85cc7;
      rhscl_mongodb_36_rhel7_devfile_registry_image_gewtkmak=registry.redhat.io/rhscl/mongodb-36-rhel7@sha256:9f799d356d7d2e442bde9d401b720600fd9059a3d8eefea6f3b2ffa721c0dc73;
  4. プル前の一覧からイメージを判別します。

    ワークスペースの起動時間を短縮するには、ワークスペース関連のイメージを事前にプルすることを検討してください。

関連情報