luisarizmendi / ocp-libvirt-ipi-role Goto Github PK
View Code? Open in Web Editor NEWAnsible Role to deploy OpenShift 4 on a CentOS 7 or Fedora KVM using libvirt IPI
Ansible Role to deploy OpenShift 4 on a CentOS 7 or Fedora KVM using libvirt IPI
As an FYI the NFS Provisioner doesn't work in OCP 4.8 due to the removal of the selfLink feature from Kubernetes. Looking at switching to the NFS SubDirectory provisioner and will submit a PR when done.
https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
Hi Luis,
On my hypervisors, I have most of the memory dedicated to hugepages (the default 2Mb hugepages).
This allows me to fit more VMs into reserved memory and makes their TLB's smaller.
Here's an example:
# virsh dumpxml sat6|head -24
<domain type='kvm' id='3'>
<name>sat6</name>
[...]
<memoryBacking>
<hugepages/>
</memoryBacking>
[...]
I've done some research and it appears that Terraform has support for hugepages but I wouldn't know where to change it in the openshift installer.. Do you have any idea of where that might be?
Hi,
First of all, thank you for creating this role. I'll have a PR soonish for some RHEL7 specifics.
on a system where I have /, /var, /usr, /home and others as dedicated logical volumes, I found the role was filling up '/' because of /root/go, /root/ocp and /root/.cache/go-build.
Is there a way to redirect the workdir to something else than the $HOME of the root user?
[root@myhost ~]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootdg-lv_root 3.9G 3.7G 0 100% /
[root@myhost ~]# du -ks go .cache/ocp .cache/go*
378928 go
0 .cache/ocp
0 .cache/go
2021744 .cache/go-build
The OpenShift baremetal IPI installer has builtin support for libvirt (see https://docs.openshift.com/container-platform/4.10/installing/installing_bare_metal_ipi/ipi-install-installation-workflow.html#retrieving-the-openshift-installer_ipi-install-installation-workflow)
This libvirt support is used to create the bootstrap vm when doing the install.
Using this support would quite reduce the size of the taks in the role, and make it even more readable.
I used ocp-libvirt-ipi-role in my project which provision various OpenShift development environments on GCP such as:
CRC, SNC (Single Node Cluster) and MNC.
When the variable lb (haproxy) is true, I needed to make some modifications before starting ansible:
a) pip3 install netaddr
Otherwise, ansible returns an error:
...
TASK [luisarizmendi.ocp_libvirt_ipi_role : Create backends haproxy file] *******
task path: /root/.ansible/roles/luisarizmendi.ocp_libvirt_ipi_role/tasks/kvm_deploy.yml:279
fatal: [localhost]: FAILED! => {"changed": false, "msg": "AnsibleFilterError: The ipmath filter requires python's netaddr be installed on the ansible controller"}
b)
sed -i 's/mode tcp/mode http/g' .ansible/roles/luisarizmendi.ocp_libvirt_ipi_role/templates/haproxy.cfg.back.j2
Otherwise, ansible/haproxy returns an error:
...
TASK [luisarizmendi.ocp_libvirt_ipi_role : Starting services] ***************************************************************
task path: /root/.ansible/roles/luisarizmendi.ocp_libvirt_ipi_role/tasks/kvm_deploy.yml:306
failed: [localhost] (item=haproxy) => {"ansible_loop_var": "item", "changed": false, "item": "haproxy", "msg": "Unable to start service haproxy: Job for haproxy.service failed because the control process exited with error code.\nSee \"systemctl status haproxy.service\" and \"journalctl -xe\" for details.\n"}
PLAY RECAP ******************************************************************************************************************
localhost : ok=26 changed=9 unreachable=0 failed=1 skipped=6 rescued=0 ignored=0
...
$ sudo systemctl status haproxy.service -l --no-pager
โ haproxy.service - HAProxy Load Balancer
Loaded: loaded (/usr/lib/systemd/system/haproxy.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2021-08-13 16:41:45 UTC; 2min 36s ago
Process: 57604 ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q $OPTIONS (code=exited, status=1/FAILURE)
Aug 13 16:41:45 crc-build-1 systemd[1]: Starting HAProxy Load Balancer...
Aug 13 16:41:45 crc-build-1 haproxy[57604]: [ALERT] 224/164145 (57604) : http backend 'app' (/etc/haproxy/haproxy.cfg:85) tries to use incompatible tcp backend 'mycluster-openshift-api-server' (/etc/haproxy/haproxy.cfg:97) in a 'use_backend' rule (see 'mode').
Aug 13 16:41:45 crc-build-1 haproxy[57604]: [ALERT] 224/164145 (57604) : http backend 'app' (/etc/haproxy/haproxy.cfg:85) tries to use incompatible tcp backend 'mycluster-ingress-https' (/etc/haproxy/haproxy.cfg:113) in a 'use_backend' rule (see 'mode').
Aug 13 16:41:45 crc-build-1 haproxy[57604]: [ALERT] 224/164145 (57604) : http backend 'app' (/etc/haproxy/haproxy.cfg:85) tries to use incompatible tcp backend 'mycluster-ingress-http' (/etc/haproxy/haproxy.cfg:106) in a 'use_backend' rule (see 'mode').
Aug 13 16:41:45 crc-build-1 haproxy[57604]: [ALERT] 224/164145 (57604) : Fatal errors found in configuration.
Aug 13 16:41:45 crc-build-1 systemd[1]: haproxy.service: Control process exited, code=exited status=1
Aug 13 16:41:45 crc-build-1 systemd[1]: haproxy.service: Failed with result 'exit-code'.
Aug 13 16:41:45 crc-build-1 systemd[1]: Failed to start HAProxy Load Balancer.
...
$ haproxy version
HA-Proxy version 1.8.27-493ce0b 2020/11/06
Copyright 2000-2020 Willy Tarreau <[email protected]>
My OS:
cat /etc/os-release
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.