This repository provides a playbook that will deploy a standalone instance of Quay using local storage on the container host.
This repo is intended for Home Lab and Proof-of-Concept scenarios. All work for setting up Quay is based on the documentation located here.
- Host running podman to run Quay (this host can be connected or disconnected)
Tested with:
- podman 2.2.1
- RHEL 8.3
- Approximately 20G disk space available on host running Quay
This should be sufficient space to mirror one release version of OpenShift 4 to Quay. More space will be required to mirror additional versions and/or mirror operators.
- If Quay will be running on a disconnected host, the required images for Postgresql, Redis, and Quay must be pre-loaded into the local podman registry. Adjust image versions as desired.
On an internet connected host:
podman login registry.redhat.io
podman pull registry.redhat.io/rhel8/postgresql-10:1
podman save registry.redhat.io/rhel8/postgresql-10:1 > /tmp/postgresql.tar
podman pull registry.redhat.io/rhel7/redis-5:1
podman save registry.redhat.io/rhel7/redis-5:1 > /tmp/redis.tar
podman pull registry.redhat.io/quay/quay-rhel8:v3.4.3
podman save registry.redhat.io/quay/quay-rhel8:v3.4.3 > /tmp/quay.tar
Transfer the tar files to the disconnected host that will run Quay
podman load -i /path/to/postgresql.tar
podman load -i /path/to/redis.tar
podman load -i /path/to/quay.tar
- Your pullsecret from https://cloud.redhat.com must exist on the container host as defined in
cloud_secret
.
In either /etc/ansible/hosts
or a local inventory.yml
, configure your inventory for your container host using a local connection. The example here reflects the hosts
configured in the quay-setup.yml
playbook.
registry:
hosts:
localhost:
vars:
ansible_connection: local
- Quay registry variable defaults are configured in
vars/quay-registry-vars.yml
. Change defaults there, or add overrides in the playbookquay-setup.yml
, or provide additional values at the command-line when launching the playbook.
base_dir
: A filesystem with at least 20G free for all Quay data to be stored.
OPTIONAL: customize subdirectory names for Quay components and/or local pull secret (this may not working due to improperly hard-coded paths in some tasks)
registry_fqdn
: Container hostname (or an approriate alias)registry_ip
: IP of your container hostpostgresql_ip
: Change as desired, default is10.88.0.6
NOTE: When testing on a container host running on VMware, quay could not communicate with postgresql without using the IP of the postgresql container. In this case, set an IP address for postgresql to this variable to ensure the container always uses the same IP so the Quay config is always valid. (podman on RHEL 8 uses 10.88.0.x as the default container network)
redis_ip
: Change as desired, default is10.88.0.7
NOTE: When testing on a container host running on VMware, quay could not communicate with redis without using the IP of the redis container. In this case, set an IP address for redis to this variable to ensure the container always uses the same IP so the Quay config is always valid. (podman on RHEL 8 uses 10.88.0.x as the default container network)
quay_host_connected
: Set true|false if container host is internet-connected(default is true)
When set to true,
required_pkgs
will be checked/installed and postgresql, redis, and quay containers will pull from registry.redhat.io. When set to false, postgresql, redis, and quay must be pre-loaded in the local podman registry.
quay_port
: Set to desired SSL port(default is 8443)
cloud_secret
: full path for pullsecret from https://cloud.redhat.com
OPTIONAL:
9.ssl_cert
: Signed certificate for registry host
10.ssl_key
: Private key for registry host cert
OPTIONAL: Set required Postgresql and Redis data in a vaulted variable file
postgresql_user
postgresql_pass
postgresql_db
postgresql_admin_pass
redis_password
The quay-setup.yml
playbook can be run at any time, and this will typically only be run once.
NOTE: For test environments, the disconnected registry host does not have to actually be disconnected and may actually be the same host used to do the initial mirror to disk.
# if using /etc/ansible/hosts
ansible-playbook quay-setup.yml`
# if using an inventory file
ansible-playbook -i inventory.yml quay-setup.yml
# if using a file for overriding variable
anisble-playbook quay-setup.yml -e@myvars.yaml
# if using a vault for username/passwords
ansible-playbook quay-setup.yml -e@myvault.yml --ask-vault-pass
- Check for and install required packages as required
- Setup and configure directories for Quay
- Configure firewall if running
- Create a self-signed SAN certificate
- Create and start Postgresql container as required
- Create and start Redis container as required
- Create and start Quay container as required