9.3. CodeReady Workspaces Operator を使用した Image Puller のインストール
本セクションでは、CodeReady Workspaces Operatorを使用して、テクノロジープレビュー状態でコミュニティがサポートする機能であるImage Pullerをインストールする方法を説明します。
前提条件
- 「プルするイメージの一覧の定義」
- 「Image Puller のメモリーパラメーターの定義」
- Operator Lifecycle Manager および OperatorHub が OpenShift インスタンスで利用できる。OpenShift は、バージョン 4.2 以降のバージョンを提供します。
- CodeReady Workspaces Operator が利用できる。https://access.redhat.com/documentation/ja-jp/red_hat_codeready_workspaces/2.13/html-single/installation_guide/index#installing-che-on-openshift-4-using-operatorhub.adocを参照してください。
手順
.spec.imagePuller.enable
をtrue
に設定して、CheCluster
カスタムリソースの Image Puller を有効にします。apiVersion: org.eclipse.che/v1 kind: CheCluster metadata: name: codeready-workspaces spec: # ... imagePuller: enable: true
CheCluster
カスタムリソースに Image Puller を設定します。apiVersion: org.eclipse.che/v1 kind: CheCluster metadata: name: codeready-workspaces spec: ... imagePuller: enable: true spec: configMapName: <kubernetes-image-puller> daemonsetName: <kubernetes-image-puller> deploymentName: <kubernetes-image-puller> images: '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;'
サポートされている Image Puller を使用するには、これを KubernetesImagePuller Operator とは別にインストールします。Red Hat が提供する追加のテストおよび検証により、Red Hat の公式ビルドの利点。
CodeReady Workspaces のインストール時に Operator Hub での KubernetesImagePuller の使用を有効にし、使用するコミュニティーでサポートされるバージョンを設定します。
デフォルトイメージ
-
CodeReady Workspaces Operator は、
CheCluster
カスタムリソースを作成する前にイメージがこのフィールドに追加されていない場合に、ワークスペースの起動(Theia イメージ、プラグインブローカーイメージ、サイドカープラグインイメージ)に使用されるデフォルトイメージを.spec.imagePuller.spec.images
フィールドに入力します。CodeReady Workspaces Operator は、CodeReady Workspaces のロールアウト更新後に.spec.imagePuller.spec.images
フィールドのデフォルトイメージを更新します。ただし、CheCluster
カスタムリソースを作成する前に、イメージが.spec.imagePuller.spec.images
フィールドに追加された場合、CodeReady Workspaces Operator はデフォルトイメージを追加しません。 -
CheCluster
カスタムリソースの作成 後 にユーザーによって提供されるイメージが.spec.imagePuller.spec.images
フィールドに追加されると、CodeReady Workspaces Operator は後続の CodeReady Workspaces ロールアウトの更新時にデフォルトイメージを更新します。ロールアウトの更新後も、デフォルト以外のイメージは.spec.imagePuller.spec.images
フィールドで変更されないままになります。
検証
-
OpenShift は
kubernetes-image-puller-operator
サブスクリプションを作成します。 eclipse-che namespace
には コミュニティーでサポートされるcommunity supported Kubernetes Image Puller Operator
ClusterServiceVersion
が含まれます。$ oc get clusterserviceversions
eclipse-che namespace
にはkubernetes-image-puller
およびkubernetes-image-puller-operator
デプロイメントが含まれます。$ oc get deployments
コミュニティーがサポートする Kubernetes Image Puller Operator は
KubernetesImagePuller
カスタムリソースを作成します。$ oc get kubernetesimagepullers
CodeReady Workspaces Operator を使用した Image Puller のアンインストール
-
CheCluster
カスタムリソースを編集し、.spec.imagePuller.enable
をfalse
に編集します。 -
CheCluster
カスタムリソースを編集し、.spec.imagePuller.spec
を、 CodeReady Workspaces Operator のオプションの Image Puller パラメーターを設定できるように設定します。