From 9bf2ea77f2a6d696f9fee2ce08645bdc256df496 Mon Sep 17 00:00:00 2001 From: Ondrej Skutka Date: Mon, 23 Nov 2026 11:37:34 +0100 Subject: [PATCH 1/4] docs: document pre-pulling images with a PinnedImageSet OpenShift administrators can pre-pull the editor and sample images with a PinnedImageSet instead of the image puller. Add an Optimize procedure covering the prerequisites, the list of images to pin, verification through MachineConfigNode status, the limitations that fail silently, and refreshing the set after an upgrade. Link it from the image caching pages. Assisted-by: Claude Code Co-Authored-By: Claude Code --- modules/optimize/nav.adoc | 1 + ...ing-images-for-faster-workspace-start.adoc | 1 + ...ge-caching-speeds-up-workspace-starts.adoc | 3 + ...ing-images-by-using-pinned-image-sets.adoc | 133 ++++++++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc diff --git a/modules/optimize/nav.adoc b/modules/optimize/nav.adoc index d8b474ec94..e8cbe17bdf 100644 --- a/modules/optimize/nav.adoc +++ b/modules/optimize/nav.adoc @@ -9,6 +9,7 @@ ** xref:configuring-image-puller-to-pre-pull-custom-images.adoc[] ** xref:configuring-image-puller-to-pre-pull-additional-images.adoc[] ** xref:retrieving-default-list-of-images-for-kubernetes-image-puller.adoc[] +** xref:pre-pulling-images-by-using-pinned-image-sets.adoc[] * xref:configuring-autoscaling.adoc[] ** xref:configuring-number-of-replicas.adoc[] ** xref:configuring-machine-autoscaling.adoc[] diff --git a/modules/optimize/pages/caching-images-for-faster-workspace-start.adoc b/modules/optimize/pages/caching-images-for-faster-workspace-start.adoc index 4d90f76543..a59dd1ae48 100644 --- a/modules/optimize/pages/caching-images-for-faster-workspace-start.adoc +++ b/modules/optimize/pages/caching-images-for-faster-workspace-start.adoc @@ -23,4 +23,5 @@ For an explanation of how image caching works and for deploy and configure proce * xref:configuring-image-puller-to-pre-pull-custom-images.adoc[] * xref:configuring-image-puller-to-pre-pull-additional-images.adoc[] * xref:retrieving-default-list-of-images-for-kubernetes-image-puller.adoc[] +* xref:pre-pulling-images-by-using-pinned-image-sets.adoc[] * link:https://github.com/che-incubator/{image-puller-repository-name}[{image-puller-name} source code repository] diff --git a/modules/optimize/pages/how-image-caching-speeds-up-workspace-starts.adoc b/modules/optimize/pages/how-image-caching-speeds-up-workspace-starts.adoc index 1058334e48..ad6b6237e0 100644 --- a/modules/optimize/pages/how-image-caching-speeds-up-workspace-starts.adoc +++ b/modules/optimize/pages/how-image-caching-speeds-up-workspace-starts.adoc @@ -12,6 +12,8 @@ These images would already be available when a {prod-short} workspace starts, th For instructions on deploying, configuring, and reviewing cached images, see Additional resources. +On OpenShift, administrators can alternatively pre-pull the workspace images by using a `PinnedImageSet`. See xref:pre-pulling-images-by-using-pinned-image-sets.adoc[]. + [role="_additional-resources"] .Additional resources @@ -22,4 +24,5 @@ For instructions on deploying, configuring, and reviewing cached images, see Add * xref:configuring-image-puller-to-pre-pull-custom-images.adoc[] * xref:configuring-image-puller-to-pre-pull-additional-images.adoc[] * xref:retrieving-default-list-of-images-for-kubernetes-image-puller.adoc[] +* xref:pre-pulling-images-by-using-pinned-image-sets.adoc[] * link:https://github.com/che-incubator/{image-puller-repository-name}[{image-puller-name} source code repository] diff --git a/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc b/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc new file mode 100644 index 0000000000..539cdf7632 --- /dev/null +++ b/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc @@ -0,0 +1,133 @@ +:_content-type: PROCEDURE +:description: Pre-pull workspace images on OpenShift nodes by using a PinnedImageSet +:keywords: administration-guide, image-puller, openshift, pinned-image-set, image-caching +:navtitle: Pre-pull images by using a PinnedImageSet on OpenShift + +[id="pre-pulling-images-by-using-pinned-image-sets"] += Pre-pulling images by using a PinnedImageSet on OpenShift + +This page applies to OpenShift only. On a cluster whose nodes are managed by the Machine Config Operator, use a `PinnedImageSet` object to pre-pull the editor and sample images that a {prod-short} workspace waits for. The machine config daemon (MCD) pulls the images on every node of a machine config pool before workspaces need them, which avoids a cold pull at workspace start. + +Use a `PinnedImageSet` as an alternative, not in addition, to the {image-puller-name}. Both mechanisms pre-pull the same images, and a pinned image also consumes disk that is never reclaimed until it is unpinned. + +[IMPORTANT] +==== +A `PinnedImageSet` is all-or-nothing on each node: if one image in the set cannot be pulled, no image of the set is pinned on that node, and the failure is reported only in the `MachineConfigNode` status. Because of this, create a set that contains only image references that the release supports, and check the `MachineConfigNode` status after applying it. + +Hosted control planes do not support `PinnedImageSet`. On such a cluster, use the {image-puller-name} instead. +==== + +.Prerequisites + +* An OpenShift cluster whose nodes are managed by the Machine Config Operator, version 4.19.12 or later. The `PinnedImageSet` feature is enabled by default from that release; earlier 4.19 releases do not provide the `PinnedImageSet` resource. +* An active `oc` session with `cluster-admin` permissions to the OpenShift cluster. + +.Procedure + +. Find the {orch-namespace} where the {prod-short} Operator is deployed: ++ +[source,subs="+attributes"] +---- +OPERATOR_NAMESPACE=$(oc get pods -l app.kubernetes.io/component={prod-operator} -o jsonpath='{.items[0].metadata.namespace}' --all-namespaces) +---- + +. Read the digest references of the editor and sample images that this {prod-short} installation uses: ++ +[source,subs="+attributes"] +---- +oc exec -n $OPERATOR_NAMESPACE deploy/{prod-operator} -- grep '@sha256:' /tmp/external_images.txt | sort -u +---- ++ +The file also lists references that use a tag only, without a digest. They cannot be included in a `PinnedImageSet`, and the command filters them out. + +. Create a `PinnedImageSet` object, with the digest references in `spec.pinnedImages`: ++ +[source,yaml] +---- +apiVersion: machineconfiguration.openshift.io/v1 +kind: PinnedImageSet +metadata: + name: che-workspace-images + labels: + machineconfiguration.openshift.io/role: worker +spec: + pinnedImages: + - name: quay.io/devfile/universal-developer-image@sha256:... + - name: quay.io/devfile/universal-developer-image@sha256:... +---- ++ +* The `machineconfiguration.openshift.io/role` label selects the machine config pool that the set applies to. Use `worker` for worker nodes, `master` for control plane nodes, or the role of a custom pool. On a single-node cluster, or when the worker pool has no machines, use the role of a pool that contains the target nodes, such as `master`. +* Set `metadata.name` to a unique value, for example one that includes the {prod-short} version, so that the set can be updated later under the same name. + +. Apply the object: ++ +[source,subs="+attributes"] +---- +oc apply -f pinnedimageset.yaml +---- + +.Verification + +. Read the status of the machine config nodes: ++ +[source,subs="+attributes"] +---- +oc get machineconfignodes -o yaml +---- + +. For every node in the targeted pool, find the entry for the set in `.status.pinnedImageSets` and confirm that `currentGeneration` equals `desiredGeneration`. The images are pinned on that node when the two generations match. While the images are being pulled, `PinnedImageSetsProgressing` is `True`, it names the nodes that are still pulling, and `currentGeneration` can be absent or lower than `desiredGeneration`. + +. If the pinning fails, check `lastFailedGeneration` and `lastFailedGenerationError` in the same entry. Also review the `PinnedImageSetsProgressing` and `PinnedImageSetsDegraded` conditions. + +== Limitations and silent failure modes + +* **Machine config pool selection.** A set is applied only if a machine config pool selects it by its `machineconfiguration.openshift.io/role` label. If the label does not match an existing pool, the set is accepted and never applied, without an error. +* **Shared pools.** The MCD merges every `PinnedImageSet` that targets a machine config pool. If one set contains an image that cannot be pulled, that set stalls on the nodes of the pool, and so can the other sets that target the same nodes. Create sets for {prod-short} images with names and labels that administrators can identify. +* **Reference format.** Each reference must be a digest reference: `sha256:` followed by 64 lowercase hexadecimal characters, after an `@`. The reference can be at most 447 characters long, must name a registry host that contains a dot, and can contain at most one {orch-namespace} segment. For example, `quay.io/devfile/universal-developer-image@sha256:...` is valid and `quay.io/namespace/team/image@sha256:...` is not. A tag before the digest, as in `image:tag@sha256:...`, is not valid. +* **Size limit.** A set can contain at most 500 images. +* **Authentication.** The MCD pulls with the global pull secret only, `openshift-config/pull-secret`. Image digest mirror sets (IDMS) are honored, but a workspace that authenticates against a registry with a different secret cannot pin images from that registry. +* **Disk usage.** Pinned images are exempt from image garbage collection. The MCD never removes them while they are pinned, so a large set can cause disk pressure, which leads to pod eviction. Size the set against the disk available on the nodes. + +== Updating the set after an upgrade + +The set is a snapshot of the image digests of one {prod-short} release, and nothing updates it automatically. After every {prod-short} upgrade, refresh the set. + +If the set is not refreshed, the following happens, and the status still reports success: + +* The new release's editor and sample images are not pinned, so workspaces pull them at start. +* The previous release's images stay pinned on every node and continue to consume disk. +* If an image that is pinned by the old set later becomes unavailable from its registry, any node that does not already have it fails the prefetch. That includes nodes that are added, replaced, or scaled up after the upgrade. On those nodes the set stalls, and the other sets that target the same pool can stall with it. Existing nodes can hide the problem, because the MCD does not re-check images that are already pinned. + +.Procedure + +. Wait for the new {prod-short} Operator Pod to reconcile the installation. The list of images is written to the Pod's `/tmp` directory, so the list is available only from the new Pod. +. Regenerate the list of digest references as described in steps 1 and 2 of the procedure above. +. Apply the `PinnedImageSet` under the same `metadata.name`. This creates a new generation of the set. +. Verify the new generation through the `MachineConfigNode` status, as described in Verification. + +The new generation is pulled to every node in the pool. The set is applied only after all pulls succeed, and the old images stay pinned until then, so size the node disk for both generations during the change. After the new generation is applied, the old images are unpinned and can be removed by garbage collection. + +With automatic Operator approval, the upgrade happens unattended and the set lags behind until you refresh it. To avoid a gap, use manual approval and refresh the set immediately after approving the upgrade. + +[NOTE] +==== +The list can also include the image that the {devworkspace} Operator uses to clone projects, when this {prod-short} version provides it. The {devworkspace} Operator upgrades on its own Operator subscription, separately from {prod-short}, so refresh the set after either upgrade. After the {devworkspace} Operator upgrade, wait for its rollout to finish and regenerate the list. +==== + +== Removing the set + +When uninstalling {prod-short}, or when switching to the {image-puller-name}, delete the `PinnedImageSet`: + +[source,subs="+attributes"] +---- +oc delete pinnedimageset che-workspace-images +---- + +The images become unpinned on the nodes and are eligible for garbage collection. + +[role="_additional-resources"] +.Additional resources + +* xref:caching-images-for-faster-workspace-start.adoc[] +* xref:how-image-caching-speeds-up-workspace-starts.adoc[] +* link:https://docs.openshift.com/container-platform/4.19/machine_configuration/machine-config-pin-preload-images-about.html[Pinning images to nodes in the OpenShift Container Platform documentation] From b080516e57a695082f030cc52a28591d37097352 Mon Sep 17 00:00:00 2001 From: Ondrej Skutka Date: Thu, 26 Nov 2026 10:34:51 +0100 Subject: [PATCH 2/4] docs: correct the refresh, removal and verification steps - State that the refresh procedure must replace spec.pinnedImages before applying the set, and tell readers who edit the live object to skip the apply step, so applying the saved file cannot restore old digests. - Use a name placeholder in the removal command and tell administrators to substitute the name they created. - Remove a stray AsciiDoc continuation marker that rendered as a plus sign. - Verify against metadata.generation of the set instead of comparing currentGeneration with desiredGeneration, which can pass while the node entry still reports the previous generation. Assisted-by: Claude Code Co-Authored-By: Claude Code --- .../pre-pulling-images-by-using-pinned-image-sets.adoc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc b/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc index 539cdf7632..33378d79d4 100644 --- a/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc +++ b/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc @@ -68,14 +68,15 @@ oc apply -f pinnedimageset.yaml .Verification -. Read the status of the machine config nodes: +. Read the status of the machine config nodes and the generation of the set: + [source,subs="+attributes"] ---- oc get machineconfignodes -o yaml +oc get pinnedimageset -o jsonpath='{.metadata.generation}{"\n"}' ---- -. For every node in the targeted pool, find the entry for the set in `.status.pinnedImageSets` and confirm that `currentGeneration` equals `desiredGeneration`. The images are pinned on that node when the two generations match. While the images are being pulled, `PinnedImageSetsProgressing` is `True`, it names the nodes that are still pulling, and `currentGeneration` can be absent or lower than `desiredGeneration`. +. For every node in the targeted pool, find the entry for the set in `.status.pinnedImageSets` and confirm that both `currentGeneration` and `desiredGeneration` equal the generation you read. The images are pinned on that node when all three values match. Comparing the two status fields with each other is not enough: until the machine config daemon observes the update, both can still report the previous generation. While the images are being pulled, `PinnedImageSetsProgressing` is `True`, it names the nodes that are still pulling, and `currentGeneration` can be absent or lower than `desiredGeneration`. . If the pinning fails, check `lastFailedGeneration` and `lastFailedGenerationError` in the same entry. Also review the `PinnedImageSetsProgressing` and `PinnedImageSetsDegraded` conditions. @@ -102,6 +103,7 @@ If the set is not refreshed, the following happens, and the status still reports . Wait for the new {prod-short} Operator Pod to reconcile the installation. The list of images is written to the Pod's `/tmp` directory, so the list is available only from the new Pod. . Regenerate the list of digest references as described in steps 1 and 2 of the procedure above. +. Replace `spec.pinnedImages` in the set with the regenerated references. Either edit the live object, for example with `oc edit pinnedimageset `, in which case skip the next step and continue with Verification, or update the saved file so that you can apply it in the next step. Applying unchanged content does not change the set. . Apply the `PinnedImageSet` under the same `metadata.name`. This creates a new generation of the set. . Verify the new generation through the `MachineConfigNode` status, as described in Verification. @@ -120,9 +122,11 @@ When uninstalling {prod-short}, or when switching to the {image-puller-name}, de [source,subs="+attributes"] ---- -oc delete pinnedimageset che-workspace-images +oc delete pinnedimageset ---- +Substitute the `metadata.name` that you used when creating the set. + The images become unpinned on the nodes and are eligible for garbage collection. [role="_additional-resources"] From b1dcae251776de37fb579a6aa14f4db0b2e46b6e Mon Sep 17 00:00:00 2001 From: Ondrej Skutka Date: Thu, 26 Nov 2026 13:55:13 +0100 Subject: [PATCH 3/4] docs: name the manifest file and explain the clone image refresh Step 3 did not say to save the manifest as pinnedimageset.yaml, which the apply command expects. Name the file. The note about the DevWorkspace Operator upgrade did not say why the regenerated list contains the new clone image. State that the Dev Spaces Operator reconciles when the DevWorkspace Operator Pod is replaced. Assisted-by: Claude Code Co-Authored-By: Claude Code --- .../pages/pre-pulling-images-by-using-pinned-image-sets.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc b/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc index 33378d79d4..8250af4add 100644 --- a/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc +++ b/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc @@ -40,7 +40,7 @@ oc exec -n $OPERATOR_NAMESPACE deploy/{prod-operator} -- grep '@sha256:' /tmp/ex + The file also lists references that use a tag only, without a digest. They cannot be included in a `PinnedImageSet`, and the command filters them out. -. Create a `PinnedImageSet` object, with the digest references in `spec.pinnedImages`: +. Create a `PinnedImageSet` object in a file named `pinnedimageset.yaml`, with the digest references in `spec.pinnedImages`: + [source,yaml] ---- @@ -113,7 +113,7 @@ With automatic Operator approval, the upgrade happens unattended and the set lag [NOTE] ==== -The list can also include the image that the {devworkspace} Operator uses to clone projects, when this {prod-short} version provides it. The {devworkspace} Operator upgrades on its own Operator subscription, separately from {prod-short}, so refresh the set after either upgrade. After the {devworkspace} Operator upgrade, wait for its rollout to finish and regenerate the list. +The list can also include the image that the {devworkspace} Operator uses to clone projects, when this {prod-short} version provides it. The {devworkspace} Operator upgrades on its own Operator subscription, separately from {prod-short}, so refresh the set after either upgrade. After the {devworkspace} Operator upgrade, wait for its rollout to finish and regenerate the list. The {prod-short} Operator reconciles when the {devworkspace} Operator Pod is replaced, so the regenerated list contains the clone image of the new version. ==== == Removing the set From efcd8c60ffd34bb041f8e184714d4e867e6d9975 Mon Sep 17 00:00:00 2001 From: Ondrej Skutka Date: Thu, 26 Nov 2026 14:54:09 +0100 Subject: [PATCH 4/4] docs: apply editorial suggestions from review - Rework the opening sentence and use "in a machine config pool". - Say "disk space" and "not reclaimed until the image is unpinned". - Put the version requirement before the Machine Config Operator clause. - Use the placeholder consistently and phrase the removal instruction as a replacement of that placeholder. Assisted-by: Claude Code Co-Authored-By: Claude Code --- .../pre-pulling-images-by-using-pinned-image-sets.adoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc b/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc index 8250af4add..faa45b8efd 100644 --- a/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc +++ b/modules/optimize/pages/pre-pulling-images-by-using-pinned-image-sets.adoc @@ -6,9 +6,9 @@ [id="pre-pulling-images-by-using-pinned-image-sets"] = Pre-pulling images by using a PinnedImageSet on OpenShift -This page applies to OpenShift only. On a cluster whose nodes are managed by the Machine Config Operator, use a `PinnedImageSet` object to pre-pull the editor and sample images that a {prod-short} workspace waits for. The machine config daemon (MCD) pulls the images on every node of a machine config pool before workspaces need them, which avoids a cold pull at workspace start. +This page applies to OpenShift only. On a cluster whose nodes are managed by the Machine Config Operator, use a `PinnedImageSet` object to pre-pull the editor and sample images that a {prod-short} workspace waits for. The machine config daemon (MCD) pulls the images on every node in a machine config pool before workspaces need them, avoiding a cold pull at workspace start. -Use a `PinnedImageSet` as an alternative, not in addition, to the {image-puller-name}. Both mechanisms pre-pull the same images, and a pinned image also consumes disk that is never reclaimed until it is unpinned. +Use a `PinnedImageSet` as an alternative, not in addition, to the {image-puller-name}. Both mechanisms pre-pull the same images, and a pinned image also consumes disk space that is not reclaimed until the image is unpinned. [IMPORTANT] ==== @@ -19,7 +19,7 @@ Hosted control planes do not support `PinnedImageSet`. On such a cluster, use th .Prerequisites -* An OpenShift cluster whose nodes are managed by the Machine Config Operator, version 4.19.12 or later. The `PinnedImageSet` feature is enabled by default from that release; earlier 4.19 releases do not provide the `PinnedImageSet` resource. +* An OpenShift cluster, version 4.19.12 or later, whose nodes are managed by the Machine Config Operator. The `PinnedImageSet` feature is enabled by default from that release; earlier 4.19 releases do not provide the `PinnedImageSet` resource. * An active `oc` session with `cluster-admin` permissions to the OpenShift cluster. .Procedure @@ -103,7 +103,7 @@ If the set is not refreshed, the following happens, and the status still reports . Wait for the new {prod-short} Operator Pod to reconcile the installation. The list of images is written to the Pod's `/tmp` directory, so the list is available only from the new Pod. . Regenerate the list of digest references as described in steps 1 and 2 of the procedure above. -. Replace `spec.pinnedImages` in the set with the regenerated references. Either edit the live object, for example with `oc edit pinnedimageset `, in which case skip the next step and continue with Verification, or update the saved file so that you can apply it in the next step. Applying unchanged content does not change the set. +. Replace `spec.pinnedImages` in the set with the regenerated references. Either edit the live object, for example with `oc edit pinnedimageset `, in which case skip the next step and continue with Verification, or update the saved file so that you can apply it in the next step. Applying unchanged content does not change the set. . Apply the `PinnedImageSet` under the same `metadata.name`. This creates a new generation of the set. . Verify the new generation through the `MachineConfigNode` status, as described in Verification. @@ -125,7 +125,7 @@ When uninstalling {prod-short}, or when switching to the {image-puller-name}, de oc delete pinnedimageset ---- -Substitute the `metadata.name` that you used when creating the set. +Replace `` with the `metadata.name` value that you used when creating the set. The images become unpinned on the nodes and are eligible for garbage collection.