Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Quay 3.3 installation
Senior Technical Account manager
Jooho
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.
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
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
- 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
Update parts:
- Operating System: RHEL 7.x
- Name: jlee_rhel7U8
- Instance Images (RHEL_7U8) +​ Check Boot
- nic1: tamlab
Update parts:
- Memory Size: 4096M
- CPU: 4
- Hardware Clock Time Offset
Create a template with the created VM
Click ​“Make Template”
Update parts:
- Name: quay33
Phase 2
LB/Ceph/Quay using Ansible playbook + Manual jobs
Clone git repository
cd /tmp
git clone ​https://github.com/Jooho/quay_install.git
git checkout -b 3.11 origin/3.11
cd quay_install
Export credential as an environmental variable.
$ cp rhv ~/rhv
# RHEV(upstream name: Ovirt) Information
export OVIRT_USERNAME=CHANGE_ME
export OVIRT_PASSWORD=CHANGE_ME
export OVIRT_API_URL=CHANGE_ME
# Red hat subscription manager information
export RHSM_ID='CHANGE_ME'
export RHSM_PW='CHANGE_ME'
# Subscription Pool ID
export BROKER_SUB_POOL_ID="CHANGE_ME"
export NODE_SUB_POOL_ID="CHANGE_ME"
# Quay image(​https://access.redhat.com/solutions/3533201​)
export QUAY_IMAGE_ATH="CHANGE_ME"
(Sample)
# RHEV(upstream name: Ovirt) Information
export OVIRT_USERNAME=admin@internal
export OVIRT_PASSWORD=test
export OVIRT_API_URL=https://rhev.console.com/ovirt-engine/api
# Red hat subscription manager information
export RHSM_ID='jlee'
export RHSM_PW='test'
# Subscription Pool ID
export BROKER_SUB_POOL_ID="8axxx"
export NODE_SUB_POOL_ID="8axxx"
# Quay image(​https://access.redhat.com/solutions/3533201​)
export QUAY_IMAGE_ATH="XXX"
source ~/rhv
Update vars.yaml
cat vars.yaml
vm_prefix: CHANGE_ME
(sample)
vm_prefix: jlee
Create all VMs (Ansible)
ansible-playbook ./playbooks/vm_creation.yaml -vvvv
Update hosts file with vm ip(Manual)
cp hosts_template hosts
vi hosts
[QUAYv3:children]
sys
quay
ceph
[QUAYv3:vars]
ansible_ssh_user=root
ansible_become=true
[rhv]
localhost ansible_connection=local ssh_public_key=%CHANGE_ME%
[sys]
sysA ansible_host=%CHANGE_ME%
[quay]
quay01 ansible_host=%CHANGE_ME%
quay02 ansible_host=%CHANGE_ME%
quay03 ansible_host=%CHANGE_ME%
[ceph]
ceph01 ansible_host=%CHANGE_ME%
ceph02 ansible_host=%CHANGE_ME%
ceph03 ansible_host=%CHANGE_ME%
ceph04 ansible_host=%CHANGE_ME%
ceph05 ansible_host=%CHANGE_ME%
(Sample)
[QUAYv3:children]
sys
quay
ceph
[QUAYv3:vars]
ansible_ssh_user=root
ansible_become=true
[rhv]
localhost ansible_connection=local ssh_public_key=​/home/jooho/.ssh/id_rsa.pub
[sys]
sysA ansible_host=​X.X.X.209
[quay]
quay01 ansible_host=​X.X.X.237
quay02 ansible_host=​X.X.X.232
quay03 ansible_host=​X.X.X.235
[ceph]
ceph01 ansible_host=​X.X.X.241
ceph02 ansible_host=​X.X.X..247
ceph03 ansible_host=​X.X.X.202
ceph04 ansible_host=​X.X.X.227
ceph05 ansible_host=​X.X.X.217
SSH Copy/ Subscription Attach/ Generate Hosts file for all groups
ansible-playbook -i hosts ./playbooks/pre.yaml -vvvv
System A (LB,DB)
Enable Repos/ Docker/ Selinux / HAProxy/ Postgresql
ansible-playbook -i hosts ./playbooks/sys.yaml -vvvv
Ceph (Enable Repos/ Install ceph-ansible/ Copy ansible files)
ansible-playbook -i hosts ./playbooks/ceph.yaml -vvvv
on Ceph05
ssh root@$(cat hosts|grep ceph05|cut -d= -f2)
ansible-playbook ./main.yaml -vvvv
cd /usr/share/ceph-ansible
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"
QUIT
+OK
Generate Quay config
Configuration console
echo https://$(cat hosts|grep quay01|cut -d= -f2):8443
(sample)
echo https://$(cat hosts|grep quay01|cut -d= -f2):8443
https://X.X.X.X:8443
quayconfig/quaypass
quaypass
quayredhat
Move config file to git repository folder
mv ~/Downloads/quay-config.tar.gz /tmp/quay_install/quay-config.tar.gz
Deploy Quay
ansible-playbook -i hosts ./playbooks/quay.yaml -e phase=quay -vvvv
Clean up (Ansible)
ansible-playbook ./playbooks/vm_teardown.yaml -vvvv
Reference:
https://access.redhat.com/documentation/en-us/red_hat_quay/3.3/html-single/deploy_red_hat_q
uay_-_high_availability/index#set_up_load_balancer_and_database

More Related Content

Quay 3.3 installation

  • 1. Quay 3.3 installation Senior Technical Account manager Jooho
  • 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
  • 6. Update parts: - Operating System: RHEL 7.x - Name: jlee_rhel7U8 - Instance Images (RHEL_7U8) +​ Check Boot - nic1: tamlab
  • 7. Update parts: - Memory Size: 4096M - CPU: 4 - Hardware Clock Time Offset Create a template with the created VM Click ​“Make Template”
  • 9. Phase 2 LB/Ceph/Quay using Ansible playbook + Manual jobs Clone git repository cd /tmp git clone ​https://github.com/Jooho/quay_install.git git checkout -b 3.11 origin/3.11 cd quay_install Export credential as an environmental variable. $ cp rhv ~/rhv # RHEV(upstream name: Ovirt) Information export OVIRT_USERNAME=CHANGE_ME export OVIRT_PASSWORD=CHANGE_ME export OVIRT_API_URL=CHANGE_ME # Red hat subscription manager information export RHSM_ID='CHANGE_ME' export RHSM_PW='CHANGE_ME' # Subscription Pool ID export BROKER_SUB_POOL_ID="CHANGE_ME" export NODE_SUB_POOL_ID="CHANGE_ME" # Quay image(​https://access.redhat.com/solutions/3533201​) export QUAY_IMAGE_ATH="CHANGE_ME" (Sample) # RHEV(upstream name: Ovirt) Information export OVIRT_USERNAME=admin@internal export OVIRT_PASSWORD=test
  • 10. export OVIRT_API_URL=https://rhev.console.com/ovirt-engine/api # Red hat subscription manager information export RHSM_ID='jlee' export RHSM_PW='test' # Subscription Pool ID export BROKER_SUB_POOL_ID="8axxx" export NODE_SUB_POOL_ID="8axxx" # Quay image(​https://access.redhat.com/solutions/3533201​) export QUAY_IMAGE_ATH="XXX" source ~/rhv Update vars.yaml cat vars.yaml vm_prefix: CHANGE_ME (sample) vm_prefix: jlee Create all VMs (Ansible) ansible-playbook ./playbooks/vm_creation.yaml -vvvv Update hosts file with vm ip(Manual) cp hosts_template hosts vi hosts
  • 11. [QUAYv3:children] sys quay ceph [QUAYv3:vars] ansible_ssh_user=root ansible_become=true [rhv] localhost ansible_connection=local ssh_public_key=%CHANGE_ME% [sys] sysA ansible_host=%CHANGE_ME% [quay] quay01 ansible_host=%CHANGE_ME% quay02 ansible_host=%CHANGE_ME% quay03 ansible_host=%CHANGE_ME% [ceph] ceph01 ansible_host=%CHANGE_ME% ceph02 ansible_host=%CHANGE_ME% ceph03 ansible_host=%CHANGE_ME% ceph04 ansible_host=%CHANGE_ME% ceph05 ansible_host=%CHANGE_ME% (Sample) [QUAYv3:children] sys quay ceph [QUAYv3:vars] ansible_ssh_user=root ansible_become=true [rhv] localhost ansible_connection=local ssh_public_key=​/home/jooho/.ssh/id_rsa.pub [sys] sysA ansible_host=​X.X.X.209
  • 12. [quay] quay01 ansible_host=​X.X.X.237 quay02 ansible_host=​X.X.X.232 quay03 ansible_host=​X.X.X.235 [ceph] ceph01 ansible_host=​X.X.X.241 ceph02 ansible_host=​X.X.X..247 ceph03 ansible_host=​X.X.X.202 ceph04 ansible_host=​X.X.X.227 ceph05 ansible_host=​X.X.X.217 SSH Copy/ Subscription Attach/ Generate Hosts file for all groups ansible-playbook -i hosts ./playbooks/pre.yaml -vvvv System A (LB,DB) Enable Repos/ Docker/ Selinux / HAProxy/ Postgresql ansible-playbook -i hosts ./playbooks/sys.yaml -vvvv Ceph (Enable Repos/ Install ceph-ansible/ Copy ansible files) ansible-playbook -i hosts ./playbooks/ceph.yaml -vvvv on Ceph05 ssh root@$(cat hosts|grep ceph05|cut -d= -f2) ansible-playbook ./main.yaml -vvvv cd /usr/share/ceph-ansible
  • 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"
  • 14. QUIT +OK Generate Quay config Configuration console echo https://$(cat hosts|grep quay01|cut -d= -f2):8443 (sample) echo https://$(cat hosts|grep quay01|cut -d= -f2):8443 https://X.X.X.X:8443 quayconfig/quaypass
  • 17. Move config file to git repository folder mv ~/Downloads/quay-config.tar.gz /tmp/quay_install/quay-config.tar.gz Deploy Quay ansible-playbook -i hosts ./playbooks/quay.yaml -e phase=quay -vvvv
  • 18. Clean up (Ansible) ansible-playbook ./playbooks/vm_teardown.yaml -vvvv Reference: https://access.redhat.com/documentation/en-us/red_hat_quay/3.3/html-single/deploy_red_hat_q uay_-_high_availability/index#set_up_load_balancer_and_database