9.5. OpenShift テンプレートを使用した OpenShift への Image Puller のインストール

この手順では、OpenShift テンプレートを使用して Kubernetes Image Puller を OpenShift にインストールする方法を説明します。

前提条件

手順

  1. Image Puller リポジトリーのクローンを作成し、OpenShift テンプレートが含まれるディレクトリーを取得します。

    $ git clone https://github.com/che-incubator/kubernetes-image-puller
    $ cd kubernetes-image-puller/deploy/openshift
  2. 以下のパラメーターを使用して、app.yamlconfigmap.yaml および serviceaccount.yaml OpenShift テンプレートを設定します。

    表9.2 app.yaml の Image Puller OpenShift テンプレートパラメーター

    使用法デフォルト

    DEPLOYMENT_NAME

    ConfigMap の DEPLOYMENT_NAME の値

    kubernetes-image-puller

    IMAGE

    kubernetes-image-puller デプロイメントに使用されるイメージ

    registry.redhat.io/codeready-workspaces/imagepuller-rhel8:2.13

    IMAGE_TAG

    プルするイメージタグ

    latest

    SERVICEACCOUNT_NAME

    デプロイメントで作成され、使用される ServiceAccount の名前

    kubernetes-image-puller

    表9.3 configmap.yaml の Image Puller OpenShift テンプレートパラメーター

    使用法デフォルト

    CACHING_CPU_LIMIT

    ConfigMap の CACHING_CPU_LIMIT の値

    .2

    CACHING_CPU_REQUEST

    ConfigMap の CACHING_CPU_REQUEST の値

    .05

    CACHING_INTERVAL_HOURS

    ConfigMap の CACHING_INTERVAL_HOURS の値

    "1"

    CACHING_MEMORY_LIMIT

    ConfigMap の CACHING_MEMORY_LIMIT の値

    "20Mi"

    CACHING_MEMORY_REQUEST

    ConfigMap の CACHING_MEMORY_REQUEST の値

    "10Mi"

    DAEMONSET_NAME

    ConfigMap の DAEMONSET_NAME の値

    kubernetes-image-puller

    DEPLOYMENT_NAME

    ConfigMap の DEPLOYMENT_NAME の値

    kubernetes-image-puller

    IMAGES

    ConfigMap の 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:b3c318ddf23e6fcdd8cc307b135a3e570a6787f97b51461daf948ddddb6171; codeready_workspaces_stacks_cpp_plugin_registry_image_gixdcmyk=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:b3c318ddf23e6fcdd8cc307b135a3e570a6787f97b51461daf948ddddb6171; 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; '

    NAMESPACE

    ConfigMap の NAMESPACE の値

    k8s-image-puller

    NODE_SELECTOR

    ConfigMap の NODE_SELECTOR の値

    "{}"

    表9.4 serviceaccount.yaml の Image Puller OpenShift テンプレートパラメーター

    使用法デフォルト

    SERVICEACCOUNT_NAME

    デプロイメントで作成され、使用される ServiceAccount の名前

    kubernetes-image-puller

  3. Image Puller をホストする OpenShift プロジェクトを作成します。

    $ oc new-project <k8s-image-puller>
  4. テンプレートを処理してから適用し、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 -

検証手順

  1. <kubernetes-image-puller> デプロイメントおよび <kubernetes-image-puller> デーモンセットがあることを確認します。デーモンセットでは、クラスター内の各ノードに Pod が必要です。

    $ oc get deployment,daemonset,pod --namespace <k8s-image-puller>
  2. <kubernetes-image-puller> ConfigMap の値を確認します。

    $ oc get configmap <kubernetes-image-puller> --output yaml