This document provides instructions for deploying Quay 3.3 in a highly available configuration on Red Hat Virtualization (RHV) using Ansible. It outlines the steps to install required packages, create virtual machines on RHV, deploy Ceph for storage, and configure Quay with load balancing and a PostgreSQL database. The steps include cloning a Git repository containing Ansible playbooks, creating VMs on RHV, configuring Ceph, deploying Redis, generating Quay configurations, and running Ansible playbooks to deploy Quay in a multi-node configuration.
2. This document shows how to deploy Quay 3.3 HA on RHV according to the official Red Hat doc.
It shares more practical command lines to achieve the goal.
Note that this document is NOT the official one that Red Hat provided so it is not supported.
3. Test Environment 4
Phase 0 5
Install required packages 5
Phase 1 5
Download RHEL 7.x image from here 5
Change root password for the RHEL 7.x image 5
Upload qcow2 file to RHV 5
Create a VM with the uploaded disk on RHV console. 6
Create a template with the created VM 7
Phase 2 9
Clone git repository 9
Export credential as an environmental variable. 9
Update vars.yaml 10
Create all VMs (Ansible) 10
Update hosts file with vm ip(Manual) 10
SSH Copy/ Subscription Attach/ Generate Hosts file for all groups 12
System A (LB,DB) 12
Ceph (Enable Repos/ Install ceph-ansible/ Copy ansible files) 12
Quay(Deploy Redis) 13
Generate Quay config 14
Move config file to git repository folder 17
Deploy Quay 17
Clean up (Ansible) 18
Reference: 18
4. Test Environment
sysA - Load Balancer / PostgreSQL
ceph01/02/03 - Ceph
ceph04 - Ceph Object Gateway
ceph05 - Ceph Ansible system
quay01/02/03 - Quay
Phase 0
To use ansible for Rhv, the host needs some mandatory packages. Phase 0 is for base
preparation.
Install required packages
yum install libxslt-devel libxml2-devel
pip install ovirt-engine-sdk-python
Phase 1
This phase does tasks that are related with RHV.
Download RHEL 7.x image from here
Change root password for the RHEL 7.x image
virt-customize -a rhel-server-7.8-x86_64-kvm.qcow2 --root-password
password:redhat--uninstall cloud-init
Upload qcow2 file to RHV
cat upload_rhel_disk.yaml
5. - hosts: localhost
gather_facts: no
tasks:
- name: Authenticate with engine
ovirt_auth:
url: https://10.8.109.7/ovirt-engine/api
username: admin@internal
password: redhat
insecure: yes
- name: Upload RHCOS image
ovirt_disk:
auth: "{{ ovirt_auth }}"
name: rhel_7U8
size: 30GiB
interface: virtio_scsi
storage_domain: vmstore
bootable: yes
timeout: 3600
upload_image_path:
/home/jooho/dev/git/quay_rhev/QUAY/rhel-server-7.8-x86_64-kvm.qcow2
wait: yes
ansible-playbook upload.yaml -vvvv
Create a VM with the uploaded disk on RHV console.
Compute > Virtual Machines
13. ansible-playbook -i hosts site.yml -vvvv -e @vars.yaml
# Check ceph health
/root/check_ceph_health.sh
radosgw_interface: eth0
Known errors
reason": "The field 'loop' is supposed to be a string type, however the incoming data structure
is a <class 'ansible.parsing.yaml.objects.AnsibleSequence'>nnThe error appears to have
been in '/usr/share/ceph-ansible/roles/ceph-config/tasks/create_ceph_initial_dirs.yml': line 2,
column 3, but maynbe elsewhere in the file depending on the exact syntax problem.nnThe
offending line appears to be:nn---n- name: create ceph initial directoriesn ^ heren"
}
Solution
sed -i 's/loop/with_items/g'
/usr/share/ceph-ansible/roles/ceph-config/tasks/create_ceph_initial_dirs.yml
ansible-playbook -i hosts site.yml -vvvv -e @vars.yaml
Quay(Deploy Redis)
ansible-playbook -i hosts ./playbooks/quay.yaml -e phase=redis -vvvv
(Note) it might take 10mins.
Test Redis
# ssh root@$(cat hosts|grep quay01|cut -d= -f2)
# yum install telnet -y
# telnet quay01 6379
Trying x.x.x.x...
Connected to x.x.x.x/
Escape character is '^]'.
MONITOR
+OK
+1525703165.754099 [0 172.17.0.1:43848] "PING"