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 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: USD ip a 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 --- 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: USD cat /etc/hosts Example output 192.168.1.138 quay-server.example.com 3.2. Configuring the database 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 USDQUAY variable, create a directory for the database data by entering the following command: USD mkdir -p USDQUAY/postgres-quay Set the appropriate permissions by entering the following command: USD setfacl -m u:26:-wx USDQUAY/postgres-quay Start the Postgres container, specifying the username, password, and database name and port, with the volume definition for database data: Ensure that the Postgres pg_trgm module is installed by running the following command: USD sudo podman exec -it postgresql-quay /bin/bash -c 'echo "CREATE EXTENSION IF NOT EXISTS pg_trgm" | psql -d quay -U postgres' Note The pg_trgm module is required for the Quay container. 3.3. Configuring Redis 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:

Commands:
ip a
--- 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 ---
cat /etc/hosts
192.168.1.138 quay-server.example.com
mkdir -p USDQUAY/postgres-quay
setfacl -m u:26:-wx USDQUAY/postgres-quay
sudo podman run -d --rm --name postgresql-quay -e POSTGRESQL_USER=quayuser -e POSTGRESQL_PASSWORD=quaypass -e POSTGRESQL_DATABASE=quay -e POSTGRESQL_ADMIN_PASSWORD=adminpass -p 5432:5432 -v USDQUAY/postgres-quay:/var/lib/pgsql/data:Z registry.redhat.io/rhel8/postgresql-13
sudo podman exec -it postgresql-quay /bin/bash -c 'echo "CREATE EXTENSION IF NOT EXISTS pg_trgm" | psql -d quay -U postgres'
sudo podman run -d --rm --name redis -p 6379:6379 -e REDIS_PASSWORD=strongpassword registry.redhat.io/rhel8/redis-6:1-110