Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding oc-mirror v2 qna yaml file #1335

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions knowledge/oc-mirror/qna.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
created_by: CID
domain: OpenShift
seed_examples:
- question: what is oc-mirror?
answer: |
You can use the oc-mirror OpenShift CLI (oc) plugin to mirror all required OpenShift Container Platform content and other images to your mirror registry by using a single tool. It provides the following features:
* Provides a centralized method to mirror OpenShift Container Platform releases, Operators, helm charts, and other images.
* Maintains update paths for OpenShift Container Platform and Operators.
* Uses a declarative image set configuration file to include only the OpenShift Container Platform releases, Operators, and images that your cluster needs.
* Performs incremental mirroring, which reduces the size of future image sets.
* Prunes images from the target mirror registry that were excluded from the image set configuration since the previous execution.
* Optionally generates supporting artifacts for OpenShift Update Service (OSUS) usage.
- question: Can we do a --dry-run before doing the actual mirror ?
answer: |
Yes, --dry-run option is available for v2 as well and command to perform the same is `oc-mirror --config <imageSetConfig.yaml> file://dryrun --dry-run`. When running dry-run on a mirror to disk workflow, oc-mirror v2 also checks if all the images within the image set are available in its cache. Any missing images are added to the missing.txt file.
When a dry-run is performed before mirroring both missing.txt and mapping.txt will contain the same list of images.. Adding the sample output here
- question: What can be mirrored with oc-mirror ?
answer: |
ocp platform release images(only stable ones), operator catalogs(again only stable ones), oci based catalogs, additionalImages
BlockedImages functionality is only available for images with manifest unknown errors which means if an image mirroring is failing due to `manifestUnknown` that image could be added to blockedImages and image will be ignored for mirroring.
Helm charts cannot be mirrored and are not available for now.
- question: how do you create an imagesetconfiguration?
answer: |
Use the oc mirror init command to create a template for the image set configuration and save it to a file called imageset-config.yaml:
$ oc mirror init <--registry <storage_backend> > imageset-config.yaml
Specifies the location of your storage backend, such as example.com/mirror/oc-mirror-metadata.
Edit the file and adjust the settings as necessar
Edit the file and adjust the settings as necessary:

kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v1alpha2
archiveSize: 4
storageConfig:
registry:
imageURL: example.com/mirror/oc-mirror-metadata
skipTLS: false
mirror:
platform:
channels:
- name: stable-4.17
type: ocp
graph: true
operators:
- catalog: registry.redhat.io/redhat/redhat-operator-index:v4.17
packages:
- name: serverless-operator
channels:
- name: stable
additionalImages:
- name: registry.redhat.io/ubi9/ubi:latest
helm: {}

Add archiveSize to set the maximum size, in GiB, of each file within the image set.
Set the back-end location to save the image set metadata to. This location can be a registry or local directory. It is required to specify storageConfig values.
Set the registry URL for the storage backend.
Set the channel to retrieve the OpenShift Container Platform images from.
Add graph: true to build and push the graph-data image to the mirror registry. The graph-data image is required to create OpenShift Update Service (OSUS). The graph: true field also generates the UpdateService custom resource manifest. The oc command-line interface (CLI) can use the UpdateService custom resource manifest to create OSUS. For more information, see About the OpenShift Update Service.
Set the Operator catalog to retrieve the OpenShift Container Platform images from.
Specify only certain Operator packages to include in the image set. Remove this field to retrieve all packages in the catalog.
Specify only certain channels of the Operator packages to include in the image set. You must always include the default channel for the Operator package even if you do not use the bundles in that channel. You can find the default channel by running the following command: oc mirror list operators --catalog=<catalog_name> --package=<package_name>.
Specify any additional images to include in image set.
- question: what is oc-mirror used for?
answer: you can also use oc-mirror plugin to mirror images to a mirror registry in your fully or partially disconnected environments.
- question: how do you install oc-mirror?
answer: Navigate to the Downloads page of the OpenShift Cluster Manager. Under the OpenShift disconnected installation tools section, click Download for OpenShift Client (oc) mirror plugin and save the file. Extract the archive by `$ tar xvzf oc-mirror.tar.gz`. If necessary, update the plugin file to be executable `$ chmod +x oc-mirror``
- question: what is a valid imagesetconfiguration?
answer: |
kind: ImageSetConfiguration
apiVersion: mirror.openshift.io/v2alpha1
mirror:
platform:
channels:
- name: stable-4.13
minVersion: 4.13.10
maxVersion: 4.13.10
graph: true
operators:
- catalog: registry.redhat.io/redhat/redhat-operator-index:v4.15
packages:
- name: aws-load-balancer-operator
- name: 3scale-operator
- name: node-observability-operator
additionalImages:
- name: registry.redhat.io/ubi8/ubi:latest
- name: registry.redhat.io/ubi9/ubi@sha256:20f695d2a91352d4eaa25107535126727b5945bff38ed36a3e59590f495046f0
- question: how do I use oc-mirror to mirror to a partially disconnected environment?
answer: |
In a partially disconnected environment, you can mirror an image set directly to the target mirror registry
you can use the following command line oc mirror -c isc.yaml --workspace file://<file_path> docker://<mirror_registry_url> --v2
You can use the oc-mirror plugin to mirror an image set directly to a target mirror registry that is accessible during image set creation.
You are required to specify a storage backend in the image set configuration file. This storage backend can be a local directory or a Docker v2 registry. The oc-mirror plugin stores metadata in this storage backend during image set creation.
Do not delete or modify the metadata that is generated by the oc-mirror plugin. You must use the same storage backend every time you run the oc-mirror plugin for the same mirror registry.
Prerequisites
* You have access to the internet to get the necessary container images.
* You have installed the OpenShift CLI (oc).
* You have installed the oc-mirror CLI plugin.
* You have created the image set configuration file.
Procedure
Run the oc mirror command to mirror the images from the specified image set configuration to a specified registry:
$ oc mirror --config=./<imageset-config.yaml> \
docker://registry.example:5000
Specify the image set configuration file that you created. For example, imageset-config.yaml.
Specify the registry to mirror the image set file to. The registry must start with docker://. If you specify a top-level namespace for the mirror registry, you must also use this same namespace on subsequent executions.
- question: What do I do after I finish mirroring an imageset with oc-mirror?
answer: |
Navigate into the oc-mirror-workspace directory that was generated.
Navigate into the results directory, for example, results-1639608409/.
Verify that YAML files are present for the ImageContentSourcePolicy and CatalogSource resources.
The repositoryDigestMirrors section of the ImageContentSourcePolicy YAML file is used for the install-config.yaml file during installation.
Configure your cluster to use the resources generated by oc-mirror
After you have mirrored your image set to the mirror registry, you must apply the generated ImageContentSourcePolicy, CatalogSource, and release image signature resources into the cluster.
The ImageContentSourcePolicy resource associates the mirror registry with the source registry and redirects image pull requests from the online registries to the mirror registry. The CatalogSource resource is used by Operator Lifecycle Manager (OLM) to retrieve information about the available Operators in the mirror registry. The release image signatures are used to verify the mirrored release images.
* Log in to the OpenShift CLI as a user with the cluster-admin role.
* Apply the YAML files from the results directory to the cluster by running the following command
oc apply -f ./oc-mirror-workspace/results-1639608409/
* If you mirrored release images, apply the release image signatures to the cluster by running the following command:
oc apply -f ./oc-mirror-workspace/results-1639608409/release-signatures/
- question: how do I use oc-mirror to create an archive containing all the images needed for a mirroring?
answer: you can use the following command line oc mirror -c isc.yaml file://<file_path> --v2
- question: How can i discover content to mirror using oc-mirror for releases and operator images ?
answer: |
oc-mirror provides a way to discover OpenShift release and operator content, then use that information to craft mirror payloads. The list updates command traverses update graphs between the last oc mirror run and provided configuration to show what new versions are available.
* Updates
List updates since the last oc-mirror run
oc-mirror list updates --config imageset-config.yaml
Note: You must have existing metadata in your workspace (or remote storage, if using) to use list updates
* Releases
** List all available release payloads for a version of OpenShift in the stable channel (the default channel)
*** oc-mirror list releases --version=4.9
** List all available release channels to query for a version of OpenShift
***oc-mirror list releases --channels --version=4.9
** List all available release payloads for a version of OpenShift in a specific channel
*** oc-mirror list releases --channel=fast-4.9
* Operators
** List all available Operator catalogs for a version of OpenShift
*** oc-mirror list operators --catalogs --version=4.9
** List all available Operator packages in a catalog
*** oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.9
** List all available Operator channels in a package
*** oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.9 --package=kiali
** List all available Operator versions in a channel
*** oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.9 --package=kiali --channel=stable
task_description: ""
document:
repo: https://github.com/openshift/oc-mirror
commit: 95f0611c1dc9584a4a9e857912b9eaa539234bbc
patterns:
- docs/usage.md
- docs/overview.md
- v2/docs/delete-functionality.md
- v2/docs/enclave_support.md



Loading