8.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 テンプレートを設定します。

    表8.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.10

    IMAGE_TAG

    プルするイメージタグ

    latest

    SERVICEACCOUNT_NAME

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

    kubernetes-image-puller

    表8.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:0e6b054323fd8cfca3171fa5aaa25f48b1d4ebd098ca63e71d7f0a379e2a51a1;che_workspace_plugin_broker_metadata=registry.redhat.io/codeready-workspaces/pluginbroker-metadata-rhel8@sha256:ca8ba32dd8c789cf4a384bf4bf1c63d845b370b7b1249dbbc0b7ebd1aab6437d;codeready_workspaces_machineexec=registry.redhat.io/codeready-workspaces/machineexec-rhel8@sha256:56573ec2092ba1b4339e5ae9e9c128bb48c6ef08f95512fb7e12b6d732624899;codeready_workspaces_plugin_java11=registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:f90e09397caa4dd5cd3476e495adfc0096272c0ba746a6e32215175c541ae058;codeready_workspaces_plugin_java8=registry.redhat.io/codeready-workspaces/plugin-java8-rhel8@sha256:1f5ac84a66454ab4b7b31cb259d30d1a5675dd5a342c9c7dfc536846c8d9a9b1;codeready_workspaces_plugin_kubernetes=registry.redhat.io/codeready-workspaces/plugin-kubernetes-rhel8@sha256:82e5e4cc40a458b4ea3d7e070945532cbf6a2f3ae966a68b50fe4cd74348c283;codeready_workspaces_plugin_openshift=registry.redhat.io/codeready-workspaces/plugin-openshift-rhel8@sha256:00aeb2293b02a8875ca996b3b02cf7ece516fe5c254ce83ade8fa3648afb6a56;codeready_workspaces_stacks_cpp=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:4bd93c6fbd77acf07f2206fe76d9e8589f453aa219302c9b4ad0e80ca6180dce;codeready_workspaces_stacks_dotnet=registry.redhat.io/codeready-workspaces/stacks-dotnet-rhel8@sha256:581d3da4bf1fe4467d688cd4390e958dc15f07b530845298c3fbcb18bfdc033a;codeready_workspaces_stacks_golang=registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:a4c848642e5cbd2e503915932c27342c94904763caa9085a866cb39c7e443335;codeready_workspaces_stacks_php=registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:a3fc9a39225136f735660830787fdb84531db4481665a26e5be21e4534b6bac0;codeready_workspaces_theia=registry.redhat.io/codeready-workspaces/theia-rhel8@sha256:1e77ab29f9a72ce94ae40670499c3823048cfdb4fe7de0707adeffd7274f78c9;codeready_workspaces_theia_endpoint=registry.redhat.io/codeready-workspaces/theia-endpoint-rhel8@sha256:e19ab58d0bb1b4f39ff3f66edd2138fed76b8feae5db78acee0e364936a73827;jboss_eap_7_eap73_openjdk8_openshift_rhel7=registry.redhat.io/jboss-eap-7/eap73-openjdk8-openshift-rhel7@sha256:d16cfe30eaf20a157cd5d5980a6c34f3fcbcfd2fd225e670a0138d81007dd919;jboss_eap_7_eap_xp2_openjdk11_openshift=registry.redhat.io/jboss-eap-7/eap-xp2-openjdk11-openshift-rhel8@sha256:647d092383a760edc083eafb2d7bc3208d6409097281bedbd5eaccde360e7e39;pvc_jobs=registry.redhat.io/ubi8/ubi-minimal@sha256:b6b0c30bb747dfacee216e5ae2ad02adb18920d8f744c04f29354278e19df2a9;rhscl_mongodb_36_rhel7=registry.redhat.io/rhscl/mongodb-36-rhel7@sha256:9f799d356d7d2e442bde9d401b720600fd9059a3d8eefea6f3b2ffa721c0dc73;'

    NAMESPACE

    ConfigMap の NAMESPACE の値

    k8s-image-puller

    NODE_SELECTOR

    ConfigMap の NODE_SELECTOR の値

    "{}"

    表8.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