Using GitOps for organizations to provide and configure OpenShift clusters automatically
Many years ago, when businesses first began to use Kubernetes systems like OpenShift, the most typical situation was a single cluster hosting all of the workloads. Yet OpenShift clusters automatically, more clusters were required as the rate of OpenShift adoption accelerated within the enterprises. And each company began to build on its own automation; some used Terraform for provisioning, while others utilized Ansible. For Day2 configuration and Cluster Life Cycle, some of them used Ansible, while others used GitOps tools like ArgoCD or Drone. It is not easy to automate the entire workflow of provisioning, day 2 setup, and cluster life cycle, and because there are no industry standards, each team develops its own solution.
In this article, I’ll not only explain how to set up the Provisioning, Day 2 setup, and Cluster Lifecycle workflows, but I’ll also do it from the standpoint of an organization. The most crucial component of this article is that I’m not utilizing a cool custom plugin or a fantastic tool that I recently discovered on GitHub. Don’t get me wrong; I enjoy experimenting with new technologies, but businesses need to employ tools that are supported, used by other businesses, and sourced from a reputable source.
“GitOps for companies” is a Red Hat offering that enables using any orchestrator (AAP/Tower, Service Now, Jenkins…) while provisioning and configuring OpenShift clusters. Git serves as the main integration point and authoritative source in this system. ACM will be used for policy application and provisioning, and OpenShift Gitops (ArgoCD) will be utilized as a Continuous Delivery tool to deploy all configurations to all of our OpenShift clusters.
How it works
Users request a cluster by filling out a form in a frontend (web application), and ACM automatically provisions and configures the cluster. Any web application that has a form for entering cluster information and the ability to publish the necessary yaml objects into a git repository can serve as the frontend. An AAP (Tower), Jenkins, or even an ACM can be utilized for this. But in my experience, the majority of organizations choose to have their own unique platform, such as a “Marketplace.”
Files are generated and written to a git repository after the form has been filled out with all the cluster specifications, and the git repository is then automatically synchronized to ACM using ArgoCD. ACM will provision the cluster on one side. To synchronize all of the setups for the new cluster, the ArgoCD ApplicationSet will construct an Application on the other side.
The cluster is immediately added to OpenShift Gitops and imported into ACM when it is created. ArgoCD now synchronizes every configuration setting to the fresh cluster.
- Users submit a form via a frontend to request their clusters (AAP, Jenkins, Service Now…) The necessary files (conf.yaml and provision.yaml) are created in Git by this platform.
2. ArgoCD retrieves the config from Git and then deploys the ACM objects using Helm to build the OpenShift Cluster. Hive will be used by ACM to provision the clusters.
3. ArgoCD fetches the config from Git, configuring each cluster with Helm+ Kustomize.
4. GIT is where all of the policies are kept. Any Cluster Update or operator update is managed with ACM since Policies control the cluster lifespan.
These 2 parts provide a more thorough explanation of this solution:
Part I: Setting up OpenShift clusters using ACM and GitOps
Part II: Using Helm+Kustomize and ACM Policies to configure an OpenShift clusters automatically with ApplicationSets
The following is the repository used to demonstrate the solution: Gitops for Businesses
A web application that has a form for entering cluster information. AAP (Tower), Service Now, Jenkins, or any other custom web application can be used for this. The yaml/json file containing all the cluster parameters must be posted to git.
Red Hat Advanced Cluster Management for Kubernetes (RHACM)
ACM is used to apply policies to OpenShift clusters as well as provision OpenShift clusters.
Openshift GitOps (ArgoCD)
As a Continuous Delivery solution, OpenShift GitOps (ArgoCD) is utilized to apply all settings to each of our OpenShift clusters.