From fb0a1b9933675cc59fcb2c85c7aefc9e3262ef0a Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Tue, 23 Apr 2024 12:58:42 +0200 Subject: [PATCH 1/7] chore: Restore installing image puller on openshift using cli Signed-off-by: Anatolii Bazko --- ...ing-images-for-faster-workspace-start.adoc | 2 + ...g-image-puller-on-openshift-using-cli.adoc | 159 ++++++++++++++++++ 2 files changed, 161 insertions(+) create mode 100644 modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc diff --git a/modules/administration-guide/pages/caching-images-for-faster-workspace-start.adoc b/modules/administration-guide/pages/caching-images-for-faster-workspace-start.adoc index acd789a568..1e5704edc4 100644 --- a/modules/administration-guide/pages/caching-images-for-faster-workspace-start.adoc +++ b/modules/administration-guide/pages/caching-images-for-faster-workspace-start.adoc @@ -22,6 +22,8 @@ therefore improving the workspace start time. * xref:installing-image-puller-on-openshift-by-using-the-web-console.adoc[] +* xref:installing-image-puller-on-openshift-using-cli.adoc[] + * xref:configuring-image-puller-to-pre-pull-default-che-images.adoc[] * xref:configuring-image-puller-to-pre-pull-custom-images.adoc[] diff --git a/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc new file mode 100644 index 0000000000..b74170863f --- /dev/null +++ b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc @@ -0,0 +1,159 @@ +:_content-type: PROCEDURE +:description: Installing {image-puller-name-short} on OpenShift using CLI +:keywords: administration-guide, image-puller, openshift, openshift-templates, CLI +:navtitle: Installing {image-puller-name-short} on OpenShift using CLI +:page-aliases: .:installing-image-puller-on-openshift-using-openshift-templates.adoc,installing-image-puller-on-openshift-using-openshift-templates.adoc + +[id="installing-image-puller-on-openshift-using-the-cli"] += Installing {image-puller-name-short} on OpenShift by using the CLI + +You can install the {image-puller-name} on OpenShift by using OpenShift `oc` management tool. + +.Prerequisites + +* An active `oc` session with administrative permissions to the OpenShift cluster. See link:https://docs.openshift.com/container-platform/{ocp4-ver}/cli_reference/openshift_cli/getting-started-cli.html[Getting started with the OpenShift CLI]. + +.Procedure + +. Gather a list of relevant container images to pull by navigating to the links: +* `pass:c,a,q[{prod-url}]/plugin-registry/v3/external_images.txt` +* `pass:c,a,q[{prod-url}]/devfile-registry/devfiles/external_images.txt` + +. Define the memory requests and limits parameters to ensure pulled containers and the platform have enough memory to run. ++ +To define the minimal value for `CACHING_MEMORY_REQUEST` or `CACHING_MEMORY_LIMIT`, consider the necessary amount of memory required to run each of the container images to pull. ++ +To define the maximal value for `CACHING_MEMORY_REQUEST` or `CACHING_MEMORY_LIMIT`, consider the total memory allocated to the DaemonSet Pods in the cluster: ++ +---- +(memory limit) * (number of images) * (number of nodes in the cluster) +---- ++ +==== +Pulling 5 images on 20 nodes, with a container memory limit of `20Mi` requires `2000Mi` of memory. +==== + +. Clone the {image-puller-name-short} repository and get in the directory containing the OpenShift templates: ++ +[source,bash,subs="+attributes,+quotes"] +---- +git clone https://github.com/che-incubator/{image-puller-repository-name} +cd {image-puller-repository-name}/deploy/openshift +---- + +. Configure the `app.yaml`, `configmap.yaml` and `serviceaccount.yaml` OpenShift templates using following parameters: ++ +.{image-puller-name-short} OpenShift templates parameters in `app.yaml` +[options="header"] +|=== +|Value |Usage |Default + +|`DEPLOYMENT_NAME` +|The value of `DEPLOYMENT_NAME` in the ConfigMap +|`{image-puller-deployment-name}` + +|`IMAGE` +|Image used for the `{image-puller-deployment-name}` deployment +|`{image-puller-image-name}` + +|`IMAGE_TAG` +|The image tag to pull +|`latest` + +|`SERVICEACCOUNT_NAME` +|The name of the ServiceAccount created and used by the deployment +|`kubernetes-image-puller` + +|=== ++ +.{image-puller-name-short} OpenShift templates parameters in `configmap.yaml` +[options="header"] +|=== +|Value |Usage |Default + +|`CACHING_CPU_LIMIT` +|The value of `CACHING_CPU_LIMIT` in the ConfigMap +|`.2` + +|`CACHING_CPU_REQUEST` +|The value of `CACHING_CPU_REQUEST` in the ConfigMap +|`.05` + +|`CACHING_INTERVAL_HOURS` +|The value of `CACHING_INTERVAL_HOURS` in the ConfigMap +|``"1"`` + +|`CACHING_MEMORY_LIMIT` +|The value of `CACHING_MEMORY_LIMIT` in the ConfigMap +|`"20Mi"` + +|`CACHING_MEMORY_REQUEST` +|The value of `CACHING_MEMORY_REQUEST` in the ConfigMap +|`"10Mi"` + +|`DAEMONSET_NAME` +|The value of `DAEMONSET_NAME` in the ConfigMap +|`{image-puller-deployment-name}` + +|`DEPLOYMENT_NAME` +|The value of `DEPLOYMENT_NAME` in the ConfigMap +|`{image-puller-deployment-name}` + +|`IMAGES` +|The value of `IMAGES` in the ConfigMap +|`{}` + +|`NAMESPACE` +|The value of `NAMESPACE` in the ConfigMap +|`{image-puller-namespace}` + +|`NODE_SELECTOR` +|The value of `NODE_SELECTOR` in the ConfigMap +|`"{}"` +|=== ++ +.{image-puller-name-short} OpenShift templates parameters in `serviceaccount.yaml` +[options="header"] +|=== +|Value |Usage |Default + +|`SERVICEACCOUNT_NAME` +|The name of the ServiceAccount created and used by the deployment +|`kubernetes-image-puller` + +|=== + + + +. Create an OpenShift project to host the {image-puller-name-short}: ++ +[source,bash,subs="+attributes,+quotes"] +---- +oc new-project __<{image-puller-namespace}>__ +---- + +. Process and apply the templates to install the puller: ++ +[source,bash,subs="+attributes,+quotes"] +---- +oc process -f serviceaccount.yaml | oc apply -f - +oc process -f configmap.yaml | oc apply -f - +oc process -f app.yaml | oc apply -f - +---- + + +.Verification steps + +. Verify the existence of a __<{image-puller-deployment-name}>__ deployment and a __<{image-puller-deployment-name}>__ DaemonSet. The DaemonSet needs to have a Pod for each node in the cluster: ++ +[source,bash,subs="+attributes,+quotes"] +---- +oc get deployment,daemonset,pod --namespace __<{image-puller-namespace}>__ +---- + +. Verify the values of the __<{image-puller-deployment-name}>__ `ConfigMap`. ++ +[source,bash,subs="+attributes,+quotes"] +---- +oc get configmap __<{image-puller-deployment-name}>__ --output yaml +---- From 9af84e2b2d7fc4c2d6740fee12446d3113849b43 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 24 Apr 2024 13:59:22 +0200 Subject: [PATCH 2/7] Update modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc Co-authored-by: Jana Vrbkova --- .../pages/installing-image-puller-on-openshift-using-cli.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc index b74170863f..99e3c5cee8 100644 --- a/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc +++ b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc @@ -21,7 +21,7 @@ You can install the {image-puller-name} on OpenShift by using OpenShift `oc` man . Define the memory requests and limits parameters to ensure pulled containers and the platform have enough memory to run. + -To define the minimal value for `CACHING_MEMORY_REQUEST` or `CACHING_MEMORY_LIMIT`, consider the necessary amount of memory required to run each of the container images to pull. +When defining the minimal value for `CACHING_MEMORY_REQUEST` or `CACHING_MEMORY_LIMIT`, consider the necessary amount of memory required to run each of the container images to pull. + To define the maximal value for `CACHING_MEMORY_REQUEST` or `CACHING_MEMORY_LIMIT`, consider the total memory allocated to the DaemonSet Pods in the cluster: + From cd289ee8bd1e3c5503b08c4589f3945b16594754 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 24 Apr 2024 13:59:29 +0200 Subject: [PATCH 3/7] Update modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc Co-authored-by: Jana Vrbkova --- .../pages/installing-image-puller-on-openshift-using-cli.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc index 99e3c5cee8..b5d0cd9087 100644 --- a/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc +++ b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc @@ -23,7 +23,7 @@ You can install the {image-puller-name} on OpenShift by using OpenShift `oc` man + When defining the minimal value for `CACHING_MEMORY_REQUEST` or `CACHING_MEMORY_LIMIT`, consider the necessary amount of memory required to run each of the container images to pull. + -To define the maximal value for `CACHING_MEMORY_REQUEST` or `CACHING_MEMORY_LIMIT`, consider the total memory allocated to the DaemonSet Pods in the cluster: +When defining the maximal value for `CACHING_MEMORY_REQUEST` or `CACHING_MEMORY_LIMIT`, consider the total memory allocated to the DaemonSet Pods in the cluster: + ---- (memory limit) * (number of images) * (number of nodes in the cluster) From bf3798099e924618fe37f32f325041c55bf119e7 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 24 Apr 2024 13:59:41 +0200 Subject: [PATCH 4/7] Update modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc Co-authored-by: Jana Vrbkova --- .../pages/installing-image-puller-on-openshift-using-cli.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc index b5d0cd9087..fae1aea70e 100644 --- a/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc +++ b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc @@ -2,7 +2,7 @@ :description: Installing {image-puller-name-short} on OpenShift using CLI :keywords: administration-guide, image-puller, openshift, openshift-templates, CLI :navtitle: Installing {image-puller-name-short} on OpenShift using CLI -:page-aliases: .:installing-image-puller-on-openshift-using-openshift-templates.adoc,installing-image-puller-on-openshift-using-openshift-templates.adoc +//:page-aliases: .:installing-image-puller-on-openshift-using-openshift-templates.adoc,installing-image-puller-on-openshift-using-openshift-templates.adoc [id="installing-image-puller-on-openshift-using-the-cli"] = Installing {image-puller-name-short} on OpenShift by using the CLI From 72ee636d1c50ad9c03915c33a27a38cb26ecf5aa Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 24 Apr 2024 14:09:56 +0200 Subject: [PATCH 5/7] Adress remarks Signed-off-by: Anatolii Bazko --- ...g-image-puller-on-openshift-using-cli.adoc | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc index fae1aea70e..63eb758d57 100644 --- a/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc +++ b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc @@ -35,10 +35,10 @@ Pulling 5 images on 20 nodes, with a container memory limit of `20Mi` requires ` . Clone the {image-puller-name-short} repository and get in the directory containing the OpenShift templates: + -[source,bash,subs="+attributes,+quotes"] +[subs="+attributes,+quotes"] ---- -git clone https://github.com/che-incubator/{image-puller-repository-name} -cd {image-puller-repository-name}/deploy/openshift +$ git clone https://github.com/che-incubator/{image-puller-repository-name} +$ cd {image-puller-repository-name}/deploy/openshift ---- . Configure the `app.yaml`, `configmap.yaml` and `serviceaccount.yaml` OpenShift templates using following parameters: @@ -127,18 +127,18 @@ cd {image-puller-repository-name}/deploy/openshift . Create an OpenShift project to host the {image-puller-name-short}: + -[source,bash,subs="+attributes,+quotes"] +[subs="+attributes,+quotes"] ---- -oc new-project __<{image-puller-namespace}>__ +$ oc new-project __<{image-puller-namespace}>__ ---- . Process and apply the templates to install the puller: + -[source,bash,subs="+attributes,+quotes"] +[subs="+attributes,+quotes"] ---- -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 - ---- @@ -146,14 +146,14 @@ oc process -f app.yaml | oc apply -f - . Verify the existence of a __<{image-puller-deployment-name}>__ deployment and a __<{image-puller-deployment-name}>__ DaemonSet. The DaemonSet needs to have a Pod for each node in the cluster: + -[source,bash,subs="+attributes,+quotes"] +[source%nowrap,dummy,subs="+quotes,+attributes"] ---- -oc get deployment,daemonset,pod --namespace __<{image-puller-namespace}>__ +$ oc get deployment,daemonset,pod --namespace __<{image-puller-namespace}>__ ---- . Verify the values of the __<{image-puller-deployment-name}>__ `ConfigMap`. + -[source,bash,subs="+attributes,+quotes"] +[source%nowrap,dummy,subs="+quotes,+attributes"] ---- -oc get configmap __<{image-puller-deployment-name}>__ --output yaml +$ oc get configmap __<{image-puller-deployment-name}>__ --output yaml ---- From ce915fb07b0442d853e89eaab14625335142d597 Mon Sep 17 00:00:00 2001 From: Jana Vrbkova Date: Thu, 25 Apr 2024 16:09:03 +0200 Subject: [PATCH 6/7] Update modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc --- .../pages/installing-image-puller-on-openshift-using-cli.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc index 63eb758d57..a4ad9615f4 100644 --- a/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc +++ b/modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc @@ -2,7 +2,7 @@ :description: Installing {image-puller-name-short} on OpenShift using CLI :keywords: administration-guide, image-puller, openshift, openshift-templates, CLI :navtitle: Installing {image-puller-name-short} on OpenShift using CLI -//:page-aliases: .:installing-image-puller-on-openshift-using-openshift-templates.adoc,installing-image-puller-on-openshift-using-openshift-templates.adoc +// :page-aliases: .:installing-image-puller-on-openshift-using-openshift-templates.adoc,installing-image-puller-on-openshift-using-openshift-templates.adoc [id="installing-image-puller-on-openshift-using-the-cli"] = Installing {image-puller-name-short} on OpenShift by using the CLI From 7a71367354d0a837a01e9dd008a2cd29d258356d Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Thu, 25 Apr 2024 16:41:00 +0200 Subject: [PATCH 7/7] Update nav.adoc Signed-off-by: Anatolii Bazko --- modules/administration-guide/nav.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/administration-guide/nav.adoc b/modules/administration-guide/nav.adoc index 7bf78d3cee..cf827c7b6d 100644 --- a/modules/administration-guide/nav.adoc +++ b/modules/administration-guide/nav.adoc @@ -46,6 +46,7 @@ *** xref:configuring-a-user-namespace.adoc[] ** xref:caching-images-for-faster-workspace-start.adoc[] *** xref:installing-image-puller-on-kubernetes-by-using-cli.adoc[] +*** xref:installing-image-puller-on-openshift-using-cli.adoc[] *** xref:installing-image-puller-on-openshift-by-using-the-web-console.adoc[] *** xref:configuring-image-puller-to-pre-pull-default-che-images.adoc[] *** xref:configuring-image-puller-to-pre-pull-custom-images.adoc[]