Chapter 3. Preparing your system to deploy Red Hat Quay
For a proof of concept Red Hat Quay deployment, you must configure port mapping, a database, and Redis prior to deploying the registry. Use the following procedures to prepare your system to deploy Red Hat Quay.
3.1. Configuring port mapping for Red Hat Quay Copy linkLink copied to clipboard!
You can use port mappings to expose ports on the host and then use these ports in combination with the host IP address or host name to navigate to the Red Hat Quay endpoint.
Procedure
Enter the following command to obtain your static IP address for your host system:
ip a
$ ip a
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
--- link/ether 6c:6a:77:eb:09:f1 brd ff:ff:ff:ff:ff:ff inet 192.168.1.132/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp82s0 ---
--- link/ether 6c:6a:77:eb:09:f1 brd ff:ff:ff:ff:ff:ff inet 192.168.1.132/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp82s0 ---
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the IP address and a local hostname, for example,
quay-server.example.com
to your/etc/hosts
file that will be used to reach the Red Hat Quay endpoint. You can confirm that the IP address and hostname have been added to the/etc/hosts
file by entering the following command:cat /etc/hosts
$ cat /etc/hosts
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
192.168.1.132 quay-server.example.com
192.168.1.132 quay-server.example.com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Configuring the database Copy linkLink copied to clipboard!
Red Hat Quay requires a database for storing metadata. PostgreSQL is used throughout this document. For this deployment, a directory on the local file system to persist database data is used.
Use the following procedure to set up a PostgreSQL database.
Procedure
In the installation folder, denoted here by the
$QUAY
variable, create a directory for the database data by entering the following command:mkdir -p $QUAY/postgres-quay
$ mkdir -p $QUAY/postgres-quay
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the appropriate permissions by entering the following command:
setfacl -m u:26:-wx $QUAY/postgres-quay
$ setfacl -m u:26:-wx $QUAY/postgres-quay
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Start the
Postgres
container, specifying the username, password, and database name and port, with the volume definition for database data:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the Postgres
pg_trgm
module is installed by running the following command:sudo podman exec -it postgresql-quay /bin/bash -c 'echo "CREATE EXTENSION IF NOT EXISTS pg_trgm" | psql -d quay -U postgres'
$ sudo podman exec -it postgresql-quay /bin/bash -c 'echo "CREATE EXTENSION IF NOT EXISTS pg_trgm" | psql -d quay -U postgres'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe
pg_trgm
module is required for theQuay
container.
3.3. Configuring Redis Copy linkLink copied to clipboard!
Redis is a key-value store that is used by Red Hat Quay for live builder logs.
Use the following procedure to deploy the Redis
container for the Red Hat Quay proof of concept.
Procedure
Start the
Redis
container, specifying the port and password, by entering the following command:sudo podman run -d --rm --name redis \ -p 6379:6379 \ -e REDIS_PASSWORD=strongpassword \ registry.redhat.io/rhel8/redis-6:1-110
$ sudo podman run -d --rm --name redis \ -p 6379:6379 \ -e REDIS_PASSWORD=strongpassword \ registry.redhat.io/rhel8/redis-6:1-110
Copy to Clipboard Copied! Toggle word wrap Toggle overflow