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.12IMAGE_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:3436bacdc249e8dcc289b67e89340bdc2c5b6694304fe369af751f684a140d60;che_workspace_plugin_broker_metadata=registry.redhat.io/codeready-workspaces/pluginbroker-metadata-rhel8@sha256:e709e89bd1ab1612baad039ad6b824b027a070ff0a37be3395202faa55518e09;codeready_workspaces_machineexec_plugin_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/machineexec-rhel8@sha256:93dc77a7f33171b36dbc112e7e732da4044c4c75a48b7a25907521c529170c0c;codeready_workspaces_plugin_java11_devfile_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:1ca806f7a094fd524b9012d593eafeb5096233c2871e21205d705e46091e6de7;codeready_workspaces_plugin_java11_plugin_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:1ca806f7a094fd524b9012d593eafeb5096233c2871e21205d705e46091e6de7;codeready_workspaces_plugin_java8_devfile_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/plugin-java8-rhel8@sha256:eff4d7987d332b0b3baf22ba1e056b339063ce92d1e84f8c9027cb3c28e1aea6;codeready_workspaces_plugin_java8_plugin_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/plugin-java8-rhel8@sha256:eff4d7987d332b0b3baf22ba1e056b339063ce92d1e84f8c9027cb3c28e1aea6;codeready_workspaces_plugin_kubernetes_plugin_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/plugin-kubernetes-rhel8@sha256:827cd9b9c30e14ec3958445dc3ef1a087794a1f0259601e868619af746daee89;codeready_workspaces_plugin_openshift_plugin_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/plugin-openshift-rhel8@sha256:d794597b27e15e47560ce63596226932d498243ac4327dfe5514af1645e3c23a;codeready_workspaces_stacks_cpp_devfile_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:871edac168ea6d670943cb7a7f3e51f2ad2aff5d3ccf1fc22e3b1872db60d8d7;codeready_workspaces_stacks_cpp_plugin_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/stacks-cpp-rhel8@sha256:871edac168ea6d670943cb7a7f3e51f2ad2aff5d3ccf1fc22e3b1872db60d8d7;codeready_workspaces_stacks_dotnet_devfile_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/stacks-dotnet-rhel8@sha256:60007e969d7e3dbc526f3be6b5ebb6aadac9018448c6f2d967ade8400d158531;codeready_workspaces_stacks_dotnet_plugin_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/stacks-dotnet-rhel8@sha256:60007e969d7e3dbc526f3be6b5ebb6aadac9018448c6f2d967ade8400d158531;codeready_workspaces_stacks_golang_devfile_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:a2cbdc901b1f52e2f11482cdff5c2ee367858ba5ab3789c7330f1e79c5615688;codeready_workspaces_stacks_golang_plugin_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/stacks-golang-rhel8@sha256:a2cbdc901b1f52e2f11482cdff5c2ee367858ba5ab3789c7330f1e79c5615688;codeready_workspaces_stacks_php_devfile_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:32d28aef989cadf8dda497dd3375de2c65fd0fde74935134cfc807a4c97e6631;codeready_workspaces_stacks_php_plugin_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/stacks-php-rhel8@sha256:32d28aef989cadf8dda497dd3375de2c65fd0fde74935134cfc807a4c97e6631;codeready_workspaces_theia_endpoint_plugin_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/theia-endpoint-rhel8@sha256:2eb5fd69e08e3a1a8f557fe1d41170ee9dac89d15c5947aabc477d4e2107a9ea;codeready_workspaces_theia_plugin_registry_image_gixdcmqk=registry.redhat.io/codeready-workspaces/theia-rhel8@sha256:7c1fcf0a972e2905a0758d53e2155534643d0fbcbb688d57b54f05bafe323582;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:54ef2173bba7384dc7609e8affbae1c36f8a3ec137cacc0866116d65dd4b9afe;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