Registry
Installation of in-cluster offline devfile registry
A devfile refers to various resources, such as container images and starter projects. The current devfile registry currently does not store those supporting resources. Therefore, you must have access to those resources when using those devfiles.
To support the air gap installation of the devfile registry, the air gap scenario divides into two stages:
Build a devfile registry based on one or more source repositories so that the registry contains all the resources available for offline installation.
Install the devfile registry to a cluster to make it available for users to access the registry.
Stage 1: Build and Package a Devfile Registry
The main goal of this stage is:
Pull in resources into the registry as part of the registry build.
Modify the devfile to update references to those offline resources as part of the registry build.
Prerequisites
Golang 1.18.x or higher
Docker 17.05 or higher or Podman 4.0.x or higher
Git
Create Offline Registry
Download / clone the devfile/registry repository.
Procedure
Clone through HTTPS
$ git clone https://github.com/devfile/registry.git /path/to/registry
Clone through SSH
$ git clone git@github.com:devfile/registry.git /path/to/registry
Install Stack Images
You will first need to collect all the image tags used in the stacks needed for offline access. The image tags collected are to each be pulled, re-tagged, and installed into the image repository accessible by the offline cluster. Procedure here will require you to change the devfile.
Procedure
Use the
docker pull
or thepodman pull
to pull down an image for a stack component:$ podman pull registry.access.redhat.com/ubi8/nodejs-16:latest
Use the
docker tag
or thepodman tag
to re-tag the image that uses the form<registry_host>:<port>/<project>/<image>
:$ podman tag registry.access.redhat.com/ubi8/nodejs-16:latest \ <registry_host>:<port>/<project>/nodejs-16:latest
Use the
docker push
orpodman push
to push the re-tagged image to the image repository at<registry_host>:<port>
:$ podman push <registry_host>:<port>/<project>/nodejs-16:latest
Modify Devfile
Change the devfile so you can update references to those offline resources as part of the registry build. For all the items pulled into the registry, update the corresponding devfile entries to reference the resources within the offline version in the registry.
Note!
- Stack component image references will change to use the offline accessible image repository.
Build Registry
Procedure
If not already at the root of the registry, change to the root of the registry.
$ cd /path/to/registry
Build the offline registry image.
$ bash .ci/build.sh offline
Additional resources
To create your own registry Git repository, see Building a custom devfile registry
For more on interacting with the OpenShift Image Registry, see Accessing the registry
To learn more about starter projects in devfiles, see Adding projects to a devfile
For more information about building your own registry image, see Building a custom devfile registry
Stage 2: Install a Devfile Registry to a cluster
In this stage, you will push the container images to a registry available to the offline cluster.
Prerequisites
- Docker 17.05 or higher or Podman 4.0.x or higher
Install Image into Cluster Image Registry
The process of installing the built images into an offline image registry depends on which image registry has deployed and which image registry you have access to.
Procedure
Use the
docker tag
or thepodman tag
to re-tag the image using the form<registry_host>:<port>/<project>/<image>
:$ podman tag devfile-index <registry_host>:<port>/<project>/devfile-index
Use the
docker push
orpodman push
to push the re-tagged image to the cluster image registry at<registry_host>:<port>
:$ podman push <registry_host>:<port>/<project>/devfile-index
Additional resources
- For more on interacting with the OpenShift Image Registry, see Accessing the registry
Update strategy for refreshing registry contents
Steps to update an already deployed registry in the air gap scenario:
Follow offline registry instructions in the above sections and rerun the registry build script to rebuild the devfile registry.
Update the existing offline devfile registry deployment with a newly built and updated offline devfile registry image.