Configuring the hub cluster to use unauthenticated registries
You can configure the hub cluster to use unauthenticated registries. Unauthenticated registries does not require authentication to access and download images.
-
You have installed and configured a hub cluster and installed Red Hat Advanced Cluster Management (RHACM) on the hub cluster.
-
You have installed the OpenShift Container Platform CLI (oc).
-
You have logged in as a user with
cluster-adminprivileges. -
You have configured an unauthenticated registry for use with the hub cluster.
-
Update the
AgentServiceConfigcustom resource (CR) by running the following command:$ oc edit AgentServiceConfig agent -
Add the
unauthenticatedRegistriesfield in the CR:apiVersion: agent-install.openshift.io/v1beta1 kind: AgentServiceConfig metadata: name: agent spec: unauthenticatedRegistries: - example.registry.com - example.registry2.com ...Unauthenticated registries are listed under
spec.unauthenticatedRegistriesin theAgentServiceConfigresource. Any registry on this list is not required to have an entry in the pull secret used for the spoke cluster installation.assisted-servicevalidates the pull secret by making sure it contains the authentication information for every image registry used for installation.Mirror registries are automatically added to the ignore list and do not need to be added under
spec.unauthenticatedRegistries. Specifying thePUBLIC_CONTAINER_REGISTRIESenvironment variable in theConfigMapoverrides the default values with the specified value. ThePUBLIC_CONTAINER_REGISTRIESdefaults are quay.io and registry.svc.ci.openshift.org.
Verify that you can access the newly added registry from the hub cluster by running the following commands:
-
Open a debug shell prompt to the hub cluster:
$ oc debug node/<node_name> -
Test access to the unauthenticated registry by running the following command:
sh-4.4# podman login -u kubeadmin -p $(oc whoami -t) <unauthenticated_registry>where:
- <unauthenticated_registry>
-
Is the new registry, for example,
unauthenticated-image-registry.openshift-image-registry.svc:5000.
Example outputLogin Succeeded!