11.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.14/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: trueCheClusterカスタムリソースに 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:bde2f4c7c21d7cd7d826d4f4bbd2ee9f31b2119e2d2aa10253592099598cf5ba;che_workspace_plugin_broker_metadata=registry.redhat.io/codeready-workspaces/pluginbroker-metadata-rhel8@sha256:457dd2db3d72cc1d823e1219d657ae32e3a9da26f7dd420e0185d1cbe872a792;codeready_workspaces_machineexec_plugin_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/machineexec-rhel8@sha256:1e25377fe0538ef380030a898fcfcff9493ff0bdbaa4db77d648cdcb0036816b;codeready_workspaces_plugin_java11_devfile_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:2036cbb70aae5f5d507657bd4b820e340ee0bacf3d4b520d80dbd21aad85e13a;codeready_workspaces_plugin_java11_plugin_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:2036cbb70aae5f5d507657bd4b820e340ee0bacf3d4b520d80dbd21aad85e13a;codeready_workspaces_plugin_java8_devfile_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/plugin-java8-rhel8@sha256:f0ecc1812888611407c23ede1d3952dfb7b9bd597c336f22995cc4d8d9c23edd;codeready_workspaces_plugin_java8_plugin_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/plugin-java8-rhel8@sha256:f0ecc1812888611407c23ede1d3952dfb7b9bd597c336f22995cc4d8d9c23edd;codeready_workspaces_plugin_kubernetes_plugin_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/plugin-kubernetes-rhel8@sha256:5f40400fb032b419e90bb334c8748470eb50e9dc4662b487364e494ccf8a3f05;codeready_workspaces_plugin_openshift_plugin_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/plugin-openshift-rhel8@sha256:c4be840840349bb647e6ace19b519b8b3e9676da42bb094512be1fafd411ae37;codeready_workspaces_stacks_cpp_devfile_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:fc621b59be72465ab82cfa293b5b190521eecfed9c353051a7e72592837891c1;codeready_workspaces_stacks_cpp_plugin_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:fc621b59be72465ab82cfa293b5b190521eecfed9c353051a7e72592837891c1;codeready_workspaces_stacks_dotnet_devfile_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/stacks-dotnet-rhel8@sha256:88134d9fd6b7c81e237e6295183d59cfe3e546762315e93f4d6fb547ecdfaeba;codeready_workspaces_stacks_dotnet_plugin_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/stacks-dotnet-rhel8@sha256:88134d9fd6b7c81e237e6295183d59cfe3e546762315e93f4d6fb547ecdfaeba;codeready_workspaces_stacks_golang_devfile_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:ef135a05399a4d5f58bcb059b6634498bee5adbbcf8ddb2956abf25819e82462;codeready_workspaces_stacks_golang_plugin_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:ef135a05399a4d5f58bcb059b6634498bee5adbbcf8ddb2956abf25819e82462;codeready_workspaces_stacks_php_devfile_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:f2ee2cf24f649092568f932977193f585caac19ef23892968d0fe4dbc90f4a35;codeready_workspaces_stacks_php_plugin_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:f2ee2cf24f649092568f932977193f585caac19ef23892968d0fe4dbc90f4a35;codeready_workspaces_theia_endpoint_plugin_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/theia-endpoint-rhel8@sha256:128e281bceaccfcb3f9c3aebdd218b6bb6381f9c41cff2259eba47dd49d95c4d;codeready_workspaces_theia_plugin_registry_image_gixdcnak=registry.redhat.io/codeready-workspaces/theia-rhel8@sha256:928f5792cc39e6b7785f4f92ec0d6a5b9cd36fb285c1f72d12239beb05d8696e;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 OperatorClusterServiceVersionが含まれます。$ oc get clusterserviceversionseclipse-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 パラメーターを設定できるように設定します。