8.5. OpenShift テンプレートを使用した OpenShift への Image Puller のインストール
この手順では、OpenShift テンプレートを使用して Kubernetes Image Puller を OpenShift にインストールする方法を説明します。
前提条件
- 実行中の OpenShift クラスター。
-
ocツールが利用できる。 - 「プルするイメージの一覧の定義」.
- 「Image Puller のメモリーパラメーターの定義」
手順
Image Puller リポジトリーのクローンを作成し、OpenShift テンプレートが含まれるディレクトリーを取得します。
git clone https://github.com/che-incubator/kubernetes-image-puller cd kubernetes-image-puller/deploy/openshift
$ git clone https://github.com/che-incubator/kubernetes-image-puller $ cd kubernetes-image-puller/deploy/openshiftCopy to Clipboard Copied! Toggle word wrap Toggle overflow 以下のパラメーターを使用して、
app.yaml、configmap.yamlおよびserviceaccount.yamlOpenShift テンプレートを設定します。Expand 表8.2 app.yaml の Image Puller OpenShift テンプレートパラメーター 値 使用法 デフォルト DEPLOYMENT_NAMEConfigMap の
DEPLOYMENT_NAMEの値kubernetes-image-pullerIMAGEkubernetes-image-pullerデプロイメントに使用されるイメージregistry.redhat.io/codeready-workspaces/imagepuller-rhel8:2.11IMAGE_TAGプルするイメージタグ
latestSERVICEACCOUNT_NAMEデプロイメントで作成され、使用される ServiceAccount の名前
kubernetes-image-pullerExpand 表8.3 configmap.yaml の Image Puller OpenShift テンプレートパラメーター 値 使用法 デフォルト CACHING_CPU_LIMITConfigMap の
CACHING_CPU_LIMITの値.2CACHING_CPU_REQUESTConfigMap の
CACHING_CPU_REQUESTの値.05CACHING_INTERVAL_HOURSConfigMap の
CACHING_INTERVAL_HOURSの値"1"CACHING_MEMORY_LIMITConfigMap の
CACHING_MEMORY_LIMITの値"20Mi"CACHING_MEMORY_REQUESTConfigMap の
CACHING_MEMORY_REQUESTの値"10Mi"DAEMONSET_NAMEConfigMap の
DAEMONSET_NAMEの値kubernetes-image-pullerDEPLOYMENT_NAMEConfigMap の
DEPLOYMENT_NAMEの値kubernetes-image-pullerIMAGESConfigMap の
IMAGESの値'che_workspace_plugin_broker_artifacts=registry.redhat.io/codeready-workspaces/pluginbroker-artifacts-rhel8@sha256:a9bf68e6dabbaaaf3e97afe4ac6e97a317e8fd9c05c88e5801fbf01aaa1ebb99;che_workspace_plugin_broker_metadata=registry.redhat.io/codeready-workspaces/pluginbroker-metadata-rhel8@sha256:727f80af1e1f6054ac93cad165bc392f43c951681936b979b98003e06e759643;codeready_workspaces_machineexec_plugin_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/machineexec-rhel8@sha256:bfdd8cf61a6fad757f1e8334aa84dbf44baddf897ff8def7496bf6dbc066679d;codeready_workspaces_plugin_java11_devfile_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:d0337762e71fd4badabcb38a582b2f35e7e7fc1c9c0f2e841e339d45b7bd34ed;codeready_workspaces_plugin_java11_plugin_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:d0337762e71fd4badabcb38a582b2f35e7e7fc1c9c0f2e841e339d45b7bd34ed;codeready_workspaces_plugin_java8_devfile_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/plugin-java8-rhel8@sha256:b2ceb0039c763e6a38aa370157b476ecb08faf8b2bfb680bada774e149583d62;codeready_workspaces_plugin_java8_plugin_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/plugin-java8-rhel8@sha256:b2ceb0039c763e6a38aa370157b476ecb08faf8b2bfb680bada774e149583d62;codeready_workspaces_plugin_kubernetes_plugin_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/plugin-kubernetes-rhel8@sha256:45535630e37e3e317772f36b28b47859d32ad1e82505a796139682cdbefb03b8;codeready_workspaces_plugin_openshift_plugin_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/plugin-openshift-rhel8@sha256:d2384cafc870c497913168508be0d846412c68ace9724baa37ca3c6be9aa4772;codeready_workspaces_stacks_cpp_devfile_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:31ef0774342bc1dbcd91e3b85d68d7a28846500f04ace7a5dfa3116c0cedfeb1;codeready_workspaces_stacks_cpp_plugin_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:31ef0774342bc1dbcd91e3b85d68d7a28846500f04ace7a5dfa3116c0cedfeb1;codeready_workspaces_stacks_dotnet_devfile_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/stacks-dotnet-rhel8@sha256:6ca14e5a94a98b15f39a353e533cf659b2b3937a86bd51af175dc3eadd8b80d5;codeready_workspaces_stacks_dotnet_plugin_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/stacks-dotnet-rhel8@sha256:6ca14e5a94a98b15f39a353e533cf659b2b3937a86bd51af175dc3eadd8b80d5;codeready_workspaces_stacks_golang_devfile_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:30e71577cb80ffaf1f67a292b4c96ab74108a2361347fc593cbb505784629db2;codeready_workspaces_stacks_golang_plugin_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:30e71577cb80ffaf1f67a292b4c96ab74108a2361347fc593cbb505784629db2;codeready_workspaces_stacks_php_devfile_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:bb7f7ef0ce58695aaf29b3355dd9ee187a94d1d382f68f329f9664ca01772ba2;codeready_workspaces_stacks_php_plugin_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:bb7f7ef0ce58695aaf29b3355dd9ee187a94d1d382f68f329f9664ca01772ba2;codeready_workspaces_theia_endpoint_plugin_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/theia-endpoint-rhel8@sha256:abb4f4c8e1328ea9fc5ca4fe0c809ec007fe348e3d2ccd722e5ba75c02ff448f;codeready_workspaces_theia_plugin_registry_image_gixdcmik=registry.redhat.io/codeready-workspaces/theia-rhel8@sha256:5ed38a48d18577120993cd3b673a365e31aeb4265c5b4a95dd9d0ac747260392;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:31ccb79b1b2c2d6eff1bee0db23d5b8ab598eafd6238417d9813f1346f717c11;rhscl_mongodb_36_rhel7_devfile_registry_image_gewtkmak=registry.redhat.io/rhscl/mongodb-36-rhel7@sha256:9f799d356d7d2e442bde9d401b720600fd9059a3d8eefea6f3b2ffa721c0dc73;'NAMESPACEConfigMap の
NAMESPACEの値k8s-image-pullerNODE_SELECTORConfigMap の
NODE_SELECTORの値"{}"Expand 表8.4 serviceaccount.yaml の Image Puller OpenShift テンプレートパラメーター 値 使用法 デフォルト SERVICEACCOUNT_NAMEデプロイメントで作成され、使用される ServiceAccount の名前
kubernetes-image-pullerImage Puller をホストする OpenShift プロジェクトを作成します。
oc new-project <k8s-image-puller>
$ oc new-project <k8s-image-puller>Copy to Clipboard Copied! Toggle word wrap Toggle overflow テンプレートを処理してから適用し、Puller をインストールします。
oc process -f serviceaccount.yaml | oc apply -f - oc process -f configmap.yaml | oc apply -f - oc process -f app.yaml | oc apply -f -
$ oc process -f serviceaccount.yaml | oc apply -f - $ oc process -f configmap.yaml | oc apply -f - $ oc process -f app.yaml | oc apply -f -Copy to Clipboard Copied! Toggle word wrap Toggle overflow
検証手順
<kubernetes-image-puller> デプロイメントおよび <kubernetes-image-puller> デーモンセットがあることを確認します。デーモンセットでは、クラスター内の各ノードに Pod が必要です。
oc get deployment,daemonset,pod --namespace <k8s-image-puller>
$ oc get deployment,daemonset,pod --namespace <k8s-image-puller>Copy to Clipboard Copied! Toggle word wrap Toggle overflow <kubernetes-image-puller>
ConfigMapの値を確認します。oc get configmap <kubernetes-image-puller> --output yaml
$ oc get configmap <kubernetes-image-puller> --output yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow