ocp-power-automation / ocp4-upi-kvm

OCP4 on KVM/Power
Apache License 2.0
17 stars 20 forks source link

Automate OCP creation for OCS CiCD #40

Closed lukebrowning closed 4 years ago

lukebrowning commented 4 years ago

A new framework is provided that parameterizes most of the user specified fields in the control file var.tfvars. This framework is composed of a few scripts and environment variables.

A create script is provided that allows the user to specify the OCP version, the number of worker nodes, and the amount of CPU and memory to be allocated for each worker node. The user can similarly control the amount of memory and CPU to be allocated for master nodes. These environment variables are optional. The default behavior is so to use today's hadcorded parameters, so the new scripts are transparent to the end user.

The only difference in default behavior is that libvirt images are allocated in /var/lib/libvirt instead of /home/libvirt/images, but this difference can be eliminated as it is subject to an environment varible. See the scripts/README.md for details.

A setup KVM host script is provided to install and configure libvirt, firewalls, dns overlays, iptables, and HAProxy enabling the user to remotely connect to the OpenShift webconsole.

A final script is provided to destroy the cluster from the host server. This scripts removes all virsh objects associated with the cluster.

The user can create a cluster at OCP 4.4, tear it down, and create another cluster at OCP 4.5, ... OCP 4.6 is also supported.

This support does not impact the existing use of the project. It simply defines an alternate use that can be scripted.

Signed-off-by: Luke Browning lukebrowning@us.ibm.com

bpradipt commented 4 years ago

@lukebrowning thanks for raising this PR. I'm wondering if this makes more sense in https://github.com/ocp-power-automation/extra ? /cc @yussufsh @Prajyot-Parab

lukebrowning commented 4 years ago

I don't know what to make out of the ocp-power-automation/extra project. It seems like it is a placeholder for a trouble shooting document that hasn't been written yet. My scripts are specific to this project - libvirt only.

yussufsh commented 4 years ago

I agree with @bpradipt that the PR changes are not affecting the working of libvirt project in any way and is just reffering to it. The scripts could be run from anywhere by just cloning this repo.

You can create a new folder "kvm_helper" under https://github.com/ocp-power-automation/extra.

However, I see some suggestions from this PR (Eg: By just specifying the OCP version automation should pick up the install and client binaries) which could be part of the main TF/Ansible code.

lukebrowning commented 4 years ago

Technically, it could be run outside the project. There is no doubt of that. The point is that it adds value to this project by making it easier to consume which presumably would appeal to developers who work on the OpenShift runtime, operators, ecosystem, and containerized applications as well as customers who would like to experiment with this new technology on Power Systems. The project as it is currently structured is oriented towards a handful of developers. The underlying technology is great, but it is limited by being so manual in nature. Having to install a bunch of software, setup KVM, networking, DNS, haproxy, GO language, terraform, terraform providers which are usually downloaded automatically on other platforms, and editing a bunch of OCP control files to create a cluster that cannot be sized for any workloads is a major barrier that limits the usefulness of this project. Ideally, this project would be restructured to include the existing terraform stuff in a subdirectory as opposed to the root of the project and the new scripts would constitute the administrative use of this project, but I am not advocating that presently. That can come in time or not based on merit. What I am proposing here is simply alternative use with no impact to the existing project. Just to be clear, I have no issue with providing these scripts somewhere else. I just believe this being a public repo, it is the best place for these scripts. Anyway, these are simply my opinions. I'll give you a couple days to think about it and if I don't hear back from ya'll, then I will move it somewhere else. BTW, there is a very good chance that these scripts will be used by OSC-CI which includes options for dynamically installing the cluster and OCS on libvirt. These scripts should work on any Power Server, including baremetal, PowerVM, and PowerVS. For the latter two, one simply needs a large LPAR.

lukebrowning commented 4 years ago

@bpradipt Besides creating an OCP cluster with additional worker nodes with various size constraints, I will need to create an OCS cluster, run CiCD tests, and setup fio for performance analysis. This work will encompass multiple projects, so it would actually be easier for me to have my own project. Can you add me as a member of this organization, so that I can create a project?

bpradipt commented 4 years ago

@lukebrowning yeah that makes more sense.