:_mod-docs-content-type: ASSEMBLY
:context: accessing-the-registry
[id="accessing-the-registry"]
= Accessing the registry
include::_attributes/common-attributes.adoc[]

toc::[]

[role="_abstract"] 
ifndef::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]
You can access a registry to view logs and metrics. You can also secure and expose the registry.

After you logged in to the registry by using the `podman login` command, you can push or pull images from the integrated registry directly by using `podman push` or `podman pull` commands. The commands that you can use depend on your user permissions.
endif::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]
ifdef::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]
In {product-title}, Red Hat Site Reliability Engineering (SRE) manages the registry for you. However, you can check the status of the registry pods and view the registry logs.
endif::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]

ifndef::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]
== Prerequisites

* You have access to the cluster as a user with the `cluster-admin` role.
* You must have configured an identity provider (IDP).
* For pulling images, for example when using the `podman pull` command, the user must have the `registry-viewer` role. To add this role, run the following command:
+
[source,terminal]
----
$ oc policy add-role-to-user registry-viewer <user_name>
----
+
* For writing or pushing images, such as using `podman push` command, complete the following steps:
+
** Your account has the `registry-editor` role. To add this role, run the following command:
+
[source,terminal]
----
$ oc policy add-role-to-user registry-editor <user_name>
----
+
** Your cluster must have an existing project where the images can be pushed to.
endif::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]

ifndef::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]
include::modules/registry-accessing-directly.adoc[leveloffset=+1]

endif::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]

include::modules/registry-checking-the-status-of-registry-pods.adoc[leveloffset=+1]

include::modules/registry-viewing-logs.adoc[leveloffset=+1]

ifndef::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]

include::modules/registry-accessing-metrics.adoc[leveloffset=+1]

[id="accessing-the-registry-additional-resources"]
[role="_additional-resources"]
== Additional resources

* xref:../openshift_images/managing_images/using-image-pull-secrets.adoc#images-allow-pods-to-reference-images-across-projects_using-image-pull-secrets[Allowing pods to reference images across projects]
* xref:../authentication/remove-kubeadmin.adoc#removing-kubeadmin_removing-kubeadmin[Removing the kubeadmin user]
* xref:../authentication/understanding-identity-provider.adoc#understanding-identity-provider_understanding-identity-provider[Understanding identity provider configuration]
endif::openshift-dedicated,openshift-rosa,openshift-rosa-hcp[]
