Deploy a Quay.io / Mirror-registry on container
Nothing original, it just the documentation of redhat, but can be usefull to kickstart a registry.
Prerequisites:
- 10G /home
- 15G /var
- 300G /srv or /opt (regarding QuayRoot)
- min 2 or more vCPUs.
- min 8 GB of RAM.
1# packages
2sudo yum install -y podman
3sudo yum install -y rsync
4sudo yum install -y jq
5
6# Get tar
7mirror="https://mirror.openshift.com/pub/openshift-v4/clients"
8wget ${mirror}/mirror-registry/latest/mirror-registry.tar.gz
9tar zxvf mirror-registry.tar.gz
10
11# Get oc-mirror
12curl https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/oc-mirror.rhel9.tar.gz -O
13
14# Basic install
15sudo ./mirror-registry install \
16 --quayHostname quay01.example.local \
17 --quayRoot /opt
18
19# More detailed install
20sudo ./mirror-registry install \
21 --quayHostname quay01.example.local \
22 --quayRoot /srv \
23 --quayStorage /srv/quay-pg \
24 --pgStorage /srv/quay-storage \
25 --sslCert tls.crt \
26 --sslKey tls.key
27
28podman login -u init \
29 -p 7u2Dm68a1s3bQvz9twrh4Nel0i5EMXUB \
30 quay01.example.local:8443 \
31 --tls-verify=false
32
33# By default login go in:
34cat $XDG_RUNTIME_DIR/containers/auth.json
35
36# Get IP
37sudo podman inspect --format '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' quay-app
38
39#unistall
40sudo ./mirror-registry uninstall -v \
41 --quayRoot <example_directory_name>
42
43# Info
44curl -u init: https://quay01.example.local:8443/v2/_catalog | jq
45curl -u root:password https://<url>:<port>/v2/ocp4/openshift4/tags/list | jq
46
47# Get an example of imageset
48oc-mirror init --registry quay.example.com:8443/mirror/oc-mirror-metadata
49
50# Get list of Operators, channels, packages
51oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.14
52oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.14 --package=kubevirt-hyperconverged
53oc-mirror list operators --catalog=registry.redhat.io/redhat/redhat-operator-index:v4.14 --package=kubevirt-hyperconverged --channel=stable
unlock user init/admin
1QUAY_POSTGRES=`podman ps | grep quay-postgres | awk '{print $1}'`
2
3podman exec -it $QUAY_POSTGRES psql -d quay -c "UPDATE "public.user" SET invalid_login_attempts = 0 WHERE username = 'init'"
Comments