Skip to content

Commit

Permalink
chore: Restore installing image puller on openshift using cli (#2722)
Browse files Browse the repository at this point in the history
* chore: Restore installing image puller on openshift using cli

Signed-off-by: Anatolii Bazko <[email protected]>

* Update modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc

Co-authored-by: Jana Vrbkova <[email protected]>

* Update modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc

Co-authored-by: Jana Vrbkova <[email protected]>

* Update modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc

Co-authored-by: Jana Vrbkova <[email protected]>

* Adress remarks

Signed-off-by: Anatolii Bazko <[email protected]>

* Update modules/administration-guide/pages/installing-image-puller-on-openshift-using-cli.adoc

* Update nav.adoc

Signed-off-by: Anatolii Bazko <[email protected]>

---------

Signed-off-by: Anatolii Bazko <[email protected]>
Co-authored-by: Jana Vrbkova <[email protected]>
  • Loading branch information
tolusha and deerskindoll committed Apr 25, 2024
1 parent 23a1783 commit 495fe5c
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/administration-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
+
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.
+
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)
----
+
====
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:
+
[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}:
+
[subs="+attributes,+quotes"]
----
$ oc new-project __<{image-puller-namespace}>__
----

. Process and apply the templates to install the puller:
+
[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%nowrap,dummy,subs="+quotes,+attributes"]
----
$ oc get deployment,daemonset,pod --namespace __<{image-puller-namespace}>__
----

. Verify the values of the __<{image-puller-deployment-name}>__ `ConfigMap`.
+
[source%nowrap,dummy,subs="+quotes,+attributes"]
----
$ oc get configmap __<{image-puller-deployment-name}>__ --output yaml
----

0 comments on commit 495fe5c

Please sign in to comment.