File: proc_accessing-the-internal-openshift-registry.adoc

package info (click to toggle)
golang-github-crc-org-crc 2.34.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,548 kB
  • sloc: sh: 398; makefile: 326; javascript: 40
file content (70 lines) | stat: -rw-r--r-- 2,009 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
= Accessing the internal {openshift} registry

The {ocp} cluster running in the {prod} instance includes an internal container image registry by default.
This internal container image registry can be used as a publication target for locally developed container images.
To access the internal {ocp} registry, follow these steps.

.Prerequisites
* {prod} is configured to use the {openshift} preset.
For more information, see link:{crc-gsg-url}#changing-the-selected-preset_gsg[Changing the selected preset].
* A running {prod} instance.
For more information, see link:{crc-gsg-url}#starting-the-instance_gsg[Starting the instance].
* A working {openshift} CLI ([command]`oc`) command.
For more information, see link:{crc-gsg-url}#accessing-the-openshift-cluster-with-oc_gsg[Accessing the {openshift} cluster with the {openshift} CLI].

.Procedure
. Check which user is logged in to the cluster:
+
[subs="+quotes,attributes"]
----
$ oc whoami
----
+
[NOTE]
====
For demonstration purposes, the current user is assumed to be `kubeadmin`.
====

. Log in to the registry as that user with its token:
+
[subs="+quotes,attributes"]
----
$ oc registry login --insecure=true
----

. Create a new project:
+
[subs="+quotes,attributes"]
----
$ oc new-project demo
----

. Mirror an example container image:
+
[subs="+quotes,attributes"]
----
$ oc image mirror registry.access.redhat.com/ubi8/ubi:latest=default-route-openshift-image-registry.apps-crc.testing/demo/ubi8:latest --insecure=true --filter-by-os=linux/amd64
----

. Get imagestreams and verify that the pushed image is listed:
+
[subs="+quotes,attributes"]
----
$ oc get is
----

. Enable image lookup in the imagestream:
+
[subs="+quotes,attributes"]
----
$ oc set image-lookup ubi8
----
+
This setting allows the imagestream to be the source of images without having to provide the full URL to the internal registry.

. Create a pod using the recently pushed image:
+
[subs="+quotes,attributes"]
----
$ oc run demo --image=ubi8 --command -- sleep 600s
----