<commit_before>// Module included in the following assemblies:
//
// * assembly/registry

[id="registry-exposing-secure-registry-manually_{context}"]
= Exposing a secure registry manually

Instead of logging in to the {product-title} registry from within the cluster,
you can gain external access to it by exposing it with a route. This allows you
to log in to the registry from outside the cluster using the route address, and
to tag and push images using the route host.

.Prerequisites:

* The following prerequisites are automatically performed:
** Deploy the Registry Operator.
** Deploy the Ingress Operator.

.Procedure

You can expose the route by using `DefaultRoute` parameter in the
`configs.imageregistry.operator.openshift.io` resource or by using custom routes.

To expose the registry using `DefaultRoute`:

. Set `DefaultRoute` to `True`:
+
----
$ oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"defaultRoute":true}}' --type=merge
----
+
. Log in with Podman:
+
----
$ HOST=$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')
$ podman login -u $(oc whoami) -p $(oc whoami -t) --tls-verify=false $HOST <1>
----
<1> `--tls-verify=false` is needed if the cluster's default certificate for routes
is untrusted. You can set a custom, trusted certificate as the default
certificate with the xref:../networking/ingress-operator.adoc#configuring-ingress[Ingress Operator].


To expose the registry using custom routes:

. Create a secret with your route's TLS keys:
+<commit_msg>Remove xref from module<commit_after>// Module included in the following assemblies:
//
// * registry/securing-exposing-registry.adoc

[id="registry-exposing-secure-registry-manually_{context}"]
= Exposing a secure registry manually

Instead of logging in to the {product-title} registry from within the cluster,
you can gain external access to it by exposing it with a route. This allows you
to log in to the registry from outside the cluster using the route address, and
to tag and push images using the route host.

.Prerequisites:

* The following prerequisites are automatically performed:
** Deploy the Registry Operator.
** Deploy the Ingress Operator.

.Procedure

You can expose the route by using `DefaultRoute` parameter in the
`configs.imageregistry.operator.openshift.io` resource or by using custom routes.

To expose the registry using `DefaultRoute`:

. Set `DefaultRoute` to `True`:
+
----
$ oc patch configs.imageregistry.operator.openshift.io/cluster --patch '{"spec":{"defaultRoute":true}}' --type=merge
----
+
. Log in with Podman:
+
----
$ HOST=$(oc get route default-route -n openshift-image-registry --template='{{ .spec.host }}')
$ podman login -u $(oc whoami) -p $(oc whoami -t) --tls-verify=false $HOST <1>
----
<1> `--tls-verify=false` is needed if the cluster's default certificate for routes
is untrusted. You can set a custom, trusted certificate as the default
certificate with the Ingress Operator.


To expose the registry using custom routes:

. Create a secret with your route's TLS keys:
+
{'fraction_non_alphanumeric': 0.10710808179162609, 'fraction_numerical': 0.0012982797792924375, 'mean_word_length': 4.277397260273973, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6342081', 'n_tokens_mistral': 898, 'n_tokens_neox': 846, 'n_words': 369}