Installing GitOps
Installing the OpenShift GitOps Operator and logging in to the Argo CD instance
Abstract
Chapter 1. Preparing to install Red Hat OpenShift GitOps
Read the following information about sizing requirements and prerequisites before you install Red Hat OpenShift GitOps on OpenShift Container Platform. Sizing requirements also provides the sizing details for the default ArgoCD instance that is instantiated by the Red Hat OpenShift GitOps Operator.
1.1. Sizing requirements for GitOps
Red Hat OpenShift GitOps is a declarative way to implement continuous deployment for cloud-native applications. Through GitOps, you can define and configure the CPU and memory requirements of your application.
Every time you install the Red Hat OpenShift GitOps Operator, the resources on the namespace are installed within the defined limits. If the default installation does not set any limits or requests, the Operator fails within the namespace with quotas. Without enough resources, the cluster cannot schedule ArgoCD related pods. The following table details the resource requests and limits for the default workloads:
Workload | CPU requests | CPU limits | Memory requests | Memory limits |
---|---|---|---|---|
argocd-application-controller | 1 | 2 | 1024M | 2048M |
applicationset-controller | 1 | 2 | 512M | 1024M |
argocd-server | 0.125 | 0.5 | 128M | 256M |
argocd-repo-server | 0.5 | 1 | 256M | 1024M |
argocd-redis | 0.25 | 0.5 | 128M | 256M |
argocd-dex | 0.25 | 0.5 | 128M | 256M |
HAProxy | 0.25 | 0.5 | 128M | 256M |
Optionally, you can also use the ArgoCD custom resource with the oc
command to see the specifics and modify them:
oc edit argocd <name of argo cd> -n namespace
Chapter 2. Installing Red Hat OpenShift GitOps
Red Hat OpenShift GitOps uses Argo CD to manage specific cluster-scoped resources, including cluster Operators, optional Operator Lifecycle Manager (OLM) Operators, and user management.
2.1. Prerequisites
- You have access to the OpenShift Container Platform web console.
-
You are logged in as a user with the
cluster-admin
role. - You are logged in to the OpenShift Container Platform cluster as an administrator.
- Your cluster has the Marketplace capability enabled or the Red Hat Operator catalog source configured manually.
If you have already installed the Community version of the Argo CD Operator, remove the Argo CD Community Operator before you install the Red Hat OpenShift GitOps Operator.
This guide explains how to install the Red Hat OpenShift GitOps Operator to an OpenShift Container Platform cluster and log in to the Argo CD instance.
The latest
channel enables installation of the most recent stable version of the Red Hat OpenShift GitOps Operator. Currently, it is the default channel for installing the Red Hat OpenShift GitOps Operator.
To install a specific version of the Red Hat OpenShift GitOps Operator, cluster administrators can use the corresponding gitops-<version>
channel. For example, to install the Red Hat OpenShift GitOps Operator version 1.8.x, you can use the gitops-1.8
channel.
2.2. Installing Red Hat OpenShift GitOps Operator in web console
You can install Red Hat OpenShift GitOps Operator from the OperatorHub by using the web console.
Procedure
- Open the Administrator perspective of the web console and navigate to Operators → OperatorHub in the menu on the left.
Search for
OpenShift GitOps
, click the Red Hat OpenShift GitOps tile, and then click Install.Red Hat OpenShift GitOps will be installed in all namespaces of the cluster.
After the Red Hat OpenShift GitOps Operator is installed, it automatically sets up a ready-to-use Argo CD instance that is available in the openshift-gitops
namespace, and an Argo CD icon is displayed in the console toolbar. You can create subsequent Argo CD instances for your applications under your projects.
2.3. Installing Red Hat OpenShift GitOps Operator using CLI
You can install Red Hat OpenShift GitOps Operator from the OperatorHub by using the CLI.
Procedure
Create a Subscription object YAML file to subscribe a namespace to the Red Hat OpenShift GitOps, for example,
sub.yaml
:Example Subscription
apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: openshift-gitops-operator namespace: openshift-operators spec: channel: latest 1 installPlanApproval: Automatic name: openshift-gitops-operator 2 source: redhat-operators 3 sourceNamespace: openshift-marketplace 4
- 1
- Specify the channel name from where you want to subscribe the Operator.
- 2
- Specify the name of the Operator to subscribe to.
- 3
- Specify the name of the CatalogSource that provides the Operator.
- 4
- The namespace of the CatalogSource. Use
openshift-marketplace
for the default OperatorHub CatalogSources.
Apply the
Subscription
to the cluster:$ oc apply -f openshift-gitops-sub.yaml
After the installation is complete, ensure that all the pods in the
openshift-gitops
namespace are running:$ oc get pods -n openshift-gitops
Example output
NAME READY STATUS RESTARTS AGE cluster-b5798d6f9-zr576 1/1 Running 0 65m kam-69866d7c48-8nsjv 1/1 Running 0 65m openshift-gitops-application-controller-0 1/1 Running 0 53m openshift-gitops-applicationset-controller-6447b8dfdd-5ckgh 1/1 Running 0 65m openshift-gitops-redis-74bd8d7d96-49bjf 1/1 Running 0 65m openshift-gitops-repo-server-c999f75d5-l4rsg 1/1 Running 0 65m openshift-gitops-server-5785f7668b-wj57t 1/1 Running 0 53m
2.4. Logging in to the Argo CD instance by using the Argo CD admin account
Red Hat OpenShift GitOps Operator automatically creates a ready-to-use Argo CD instance that is available in the openshift-gitops
namespace.
Prerequisites
- You have installed the Red Hat OpenShift GitOps Operator in your cluster.
Procedure
- In the Administrator perspective of the web console, navigate to Operators → Installed Operators to verify that the Red Hat OpenShift GitOps Operator is installed.
-
Navigate to the
menu → OpenShift GitOps → Cluster Argo CD. The login page of the Argo CD UI is displayed in a new window.
Optional: To log in with your OpenShift Container Platform credentials, ensure you are a user of the
cluster-admins
group and then select theLOG IN VIA OPENSHIFT
option in the Argo CD user interface.NoteTo be a user of the
cluster-admins
group, use theoc adm groups new cluster-admins <user>
command, where<user>
is the default cluster role that you can bind to users and groups cluster-wide or locally.To log in with your username and password, obtain the password for the Argo CD instance:
- In the left panel of the console, use the perspective switcher to switch to the Developer perspective.
-
Use the Project drop-down list and select the
openshift-gitops
project. - Use the left navigation panel to navigate to the Secrets page.
- Select the openshift-gitops-cluster instance to display the password.
- Copy the password.
-
Use this password and
admin
as the username to log in to the Argo CD UI in the new window.
You cannot create two Argo CD CRs in the same namespace.