Installing GitOps
Installing the OpenShift GitOps Operator, logging in to the Argo CD instance, and installing the GitOps CLI
Abstract
Chapter 1. Preparing to install Red Hat OpenShift GitOps Copy linkLink copied to clipboard!
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 Copy linkLink copied to clipboard!
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 | 250m | 2 | 1024Mi | 2048Mi |
applicationset-controller | 250m | 2 | 512Mi | 1024Mi |
argocd-server | 125m | 500m | 128Mi | 256Mi |
argocd-repo-server | 250m | 1 | 256Mi | 1024Mi |
argocd-redis | 250m | 500m | 128Mi | 256Mi |
argocd-dex-server | 250m | 500m | 128Mi | 256Mi |
argocd-redis-ha-haproxy | 200m | 500m | 128Mi | 256Mi |
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
oc edit argocd <name of argo cd> -n namespace
1.1.1. Sizing requirements for argocd-redis Copy linkLink copied to clipboard!
During the capacity planning stage for your application in the Red Hat OpenShift GitOps Operator, you must ensure that an adequate amount of resources, such as memory, CPU, and storage, are allocated for the argocd-redis
pod.
The default memory limit for the Redis pod might not be enough to manage a large number of resources. In these instances, you must increase the memory limit, monitor the memory metrics, and change the memory configuration while the application deployment scales up.
The following command shows the example of the memory configuration for a Redis pod in the openshift-gitops
namespace:
oc get argocd -n openshift-gitops openshift-gitops -o json | jq '.spec.redis.resources'
$ oc get argocd -n openshift-gitops openshift-gitops -o json | jq '.spec.redis.resources'
Example Output
The following example command changes the memory configuration for a Redis pod. The highest resource limit threshold is set to 8 GiB and the lowest is set to 256 MiB.
oc patch argocd -n openshift-gitops openshift-gitops --type json -p '[{"op": "replace", "path": \ "/spec/redis/resources/limits/memory", "value": "8Gi"}, {"op": "replace", "path": \ "/spec/redis/resources/requests/memory", "value": "256Mi"}]'
$ oc patch argocd -n openshift-gitops openshift-gitops --type json -p '[{"op": "replace", "path": \
"/spec/redis/resources/limits/memory", "value": "8Gi"}, {"op": "replace", "path": \
"/spec/redis/resources/requests/memory", "value": "256Mi"}]'
Example Output
argocd.argoproj.io/openshift-gitops patched
argocd.argoproj.io/openshift-gitops patched
Chapter 2. Installing Red Hat OpenShift GitOps Copy linkLink copied to clipboard!
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 Copy linkLink copied to clipboard!
- 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 Copy linkLink copied to clipboard!
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 go to Operators → OperatorHub.
-
Search for
OpenShift GitOps
, click the Red Hat OpenShift GitOps tile, and then click Install. On the Install Operator page:
- Select an Update channel.
- Select a GitOps Version to install.
Choose an Installed Namespace. The default installation namespace is
openshift-gitops-operator
.NoteFor the GitOps version 1.10 and later, the default namespace changed from
openshift-operators
toopenshift-gitops operator
.Select the Enable Operator recommended cluster monitoring on this Namespace checkbox to enable cluster monitoring.
NoteYou can enable cluster monitoring on any namespace by applying the
openshift.io/cluster-monitoring=true
label:oc label namespace <namespace> openshift.io/cluster-monitoring=true
$ oc label namespace <namespace> openshift.io/cluster-monitoring=true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
namespace/<namespace> labeled
namespace/<namespace> labeled
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Click Install to make the GitOps Operator available on the OpenShift Container Platform cluster.
Red Hat OpenShift GitOps is installed in all namespaces of the cluster.
- Verify that the Red Hat OpenShift GitOps Operator is listed in Operators → Installed Operators. The Status should resolve to Succeeded.
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 Copy linkLink copied to clipboard!
You can install Red Hat OpenShift GitOps Operator from the OperatorHub by using the CLI.
For the GitOps version 1.10 and later, the default namespace changed from openshift-operators
to openshift-gitops operator
.
Prerequisite
-
You have login credentials to access the OpenShift Container Platform cluster with
cluster-admin
privileges. -
You have installed the
oc
CLI.
Procedure
Create a
openshift-gitops-operator
namespace:oc create ns openshift-gitops-operator
$ oc create ns openshift-gitops-operator
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
namespace/openshift-gitops-operator created
namespace/openshift-gitops-operator created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou can enable cluster monitoring on
openshift-gitops-operator
, or any namespace, by applying theopenshift.io/cluster-monitoring=true
label:oc label namespace <namespace> openshift.io/cluster-monitoring=true
$ oc label namespace <namespace> openshift.io/cluster-monitoring=true
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
namespace/<namespace> labeled
namespace/<namespace> labeled
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
OperatorGroup
object YAML file, for example,gitops-operator-group.yaml
:Example OperatorGroup
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the
OperatorGroup
to the cluster:oc apply -f gitops-operator-group.yaml
$ oc apply -f gitops-operator-group.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
operatorgroup.operators.coreos.com/openshift-gitops-operator created
operatorgroup.operators.coreos.com/openshift-gitops-operator created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
Subscription
object YAML file to subscribe a namespace to the Red Hat OpenShift GitOps Operator, for example,openshift-gitops-sub.yaml
:Example Subscription
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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
$ oc apply -f openshift-gitops-sub.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
subscription.operators.coreos.com/openshift-gitops-operator created
subscription.operators.coreos.com/openshift-gitops-operator created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After the installation is complete, verify that all the pods in the
openshift-gitops
namespace are running:oc get pods -n openshift-gitops
$ oc get pods -n openshift-gitops
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the pods in the
openshift-gitops-operator
namespace are running:oc get pods -n openshift-gitops-operator
$ oc get pods -n openshift-gitops-operator
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME READY STATUS RESTARTS AGE openshift-gitops-operator-controller-manager-6fdc5cd9dc-jr9mn 2/2 Running 0 41s
NAME READY STATUS RESTARTS AGE openshift-gitops-operator-controller-manager-6fdc5cd9dc-jr9mn 2/2 Running 0 41s
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.4. Logging in to the Argo CD instance by using the Argo CD admin account Copy linkLink copied to clipboard!
Red Hat OpenShift GitOps automatically creates a ready-to-use Argo CD instance that is available in the openshift-gitops
namespace. Optionally, you can create a new Argo CD instance to manage cluster configurations or deploy applications.
Use the Argo CD admin account to log in to the default ready-to-use Argo CD instance or the newly installed and deployed Argo CD instance.
Prerequisites
- You have installed the Red Hat OpenShift GitOps Operator on your OpenShift Container Platform 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.Obtain the password for the Argo CD instance:
- Use the navigation panel to go to the Workloads → Secrets page.
- Use the Project drop-down list and select the namespace where the Argo CD instance is created.
- Select the <argo_CD_instance_name>-cluster instance to display the password.
- On the Details tab, copy the password under Data → admin.password.
-
Use
admin
as the Username and the copied password as the Password to log in to the Argo CD UI in the new window.
You cannot create two Argo CD CRs in the same namespace.
Chapter 3. Installing the GitOps CLI Copy linkLink copied to clipboard!
The Red Hat OpenShift GitOps argocd
CLI tool is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
Use the GitOps argocd
CLI tool to configure and manage Red Hat OpenShift GitOps and Argo CD resources from the command line. The GitOps argocd
CLI is designed to make GitOps computing tasks simple and concise. You can install the CLI tool on different platforms.
Both the compressed archives and the RPMs contain the argocd
executable binary file. If you have an active OpenShift Container Platform subscription on your Red Hat account, install the CLI tool as an RPM by using a package manager, such as yum
or dnf
.
3.1. Installing the Red Hat OpenShift GitOps CLI on Linux Copy linkLink copied to clipboard!
For Linux distributions, you can download the GitOps argocd
CLI as a tar.gz
archive.
Procedure
Download the latest version of the CLI tool from the content gateway for your operating system and architecture.
Expand Operating system Architecture Tarball Linux
x86_64, amd64
argocd-linux-amd64.tar.gz
Linux on IBM zSystems and IBM® LinuxONE
s390x
argocd-linux-s390x.tar.gz
Linux on IBM Power
ppc64le
argocd-linux-ppc64le.tar.gz
Linux on ARM
aarch64, arm64
argocd-linux-arm64.tar.gz
NoteNewer versions of the CLI tool are compatible with the older versions of Red Hat OpenShift GitOps server, but not vice versa.
Extract the archive by running the following command:
tar xvzf <file>
$ tar xvzf <file>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the binary to a directory on your
PATH
environment variable by running the following command:sudo mv argocd /usr/local/bin/argocd
$ sudo mv argocd /usr/local/bin/argocd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make the file executable by running the following command:
sudo chmod +x /usr/local/bin/argocd
$ sudo chmod +x /usr/local/bin/argocd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After you install the GitOps
argocd
CLI, verify that it is available by running the following command:argocd version --client
$ argocd version --client
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The build information of Red Hat OpenShift GitOps built by Red Hat.
3.2. Installing the Red Hat OpenShift GitOps CLI on Linux using an RPM Copy linkLink copied to clipboard!
For Red Hat Enterprise Linux (RHEL) version 8 or later, you can install the GitOps argocd
CLI as an RPM by using a package manager, such as yum
or dnf
. This allows the GitOps argocd
CLI version to be automatically managed by the system. For example, using a command such as dnf upgrade
upgrades all packages, including argocd
, if a new version is available.
Prerequisites
- You have an active OpenShift Container Platform subscription on your Red Hat account.
-
You have root or
sudo
privileges on your local system.
Procedure
Register with Red Hat Subscription Manager by running the following command:
subscription-manager register
# subscription-manager register
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Pull the latest subscription data by running the following command:
subscription-manager refresh
# subscription-manager refresh
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List the available subscriptions by running the following command:
subscription-manager list --available --matches '*gitops*'
# subscription-manager list --available --matches '*gitops*'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the output for the previous command, find the pool ID for your OpenShift Container Platform subscription, and attach the subscription to the registered system by running the following command:
subscription-manager attach --pool=<pool_id>
# subscription-manager attach --pool=<pool_id>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the repositories required by Red Hat OpenShift GitOps for RHEL version 8 or later by running the following command:
Linux (x86_64, amd64)
subscription-manager repos --enable="gitops-<gitops_version>-for-rhel-<rhel_version>-x86_64-rpms"
# subscription-manager repos --enable="gitops-<gitops_version>-for-rhel-<rhel_version>-x86_64-rpms"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example command
subscription-manager repos --enable="gitops-1.17-for-rhel-8-x86_64-rpms"
# subscription-manager repos --enable="gitops-1.17-for-rhel-8-x86_64-rpms"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Linux on IBM zSystems and IBM® LinuxONE (s390x)
subscription-manager repos --enable="gitops-<gitops_version>-for-rhel-<rhel_version>-s390x-rpms"
# subscription-manager repos --enable="gitops-<gitops_version>-for-rhel-<rhel_version>-s390x-rpms"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example command
subscription-manager repos --enable="gitops-1.17-for-rhel-8-s390x-rpms"
# subscription-manager repos --enable="gitops-1.17-for-rhel-8-s390x-rpms"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Linux on IBM Power (ppc64le)
subscription-manager repos --enable="gitops-<gitops_version>-for-rhel-<rhel_version>-ppc64le-rpms"
# subscription-manager repos --enable="gitops-<gitops_version>-for-rhel-<rhel_version>-ppc64le-rpms"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example command
subscription-manager repos --enable="gitops-1.17-for-rhel-8-ppc64le-rpms"
# subscription-manager repos --enable="gitops-1.17-for-rhel-8-ppc64le-rpms"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Linux on ARM (aarch64, arm64)
subscription-manager repos --enable="gitops-<gitops_version>-for-rhel-<rhel_version>-aarch64-rpms"
# subscription-manager repos --enable="gitops-<gitops_version>-for-rhel-<rhel_version>-aarch64-rpms"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example command
subscription-manager repos --enable="gitops-1.17-for-rhel-8-aarch64-rpms"
# subscription-manager repos --enable="gitops-1.17-for-rhel-8-aarch64-rpms"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Install the
openshift-gitops-argocd-cli
package by running the following command:yum install openshift-gitops-argocd-cli
# yum install openshift-gitops-argocd-cli
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After you install the GitOps
argocd
CLI, verify that it is available by running the following command:argocd version --client
$ argocd version --client
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The build information of Red Hat OpenShift GitOps built by Red Hat.
3.3. Installing the Red Hat OpenShift GitOps CLI on Windows Copy linkLink copied to clipboard!
For Windows, you can download the GitOps argocd
CLI as a compressed zip
archive.
Procedure
Download the latest version of the CLI tool from the content gateway for your operating system and architecture.
Expand Operating system Architecture Tarball Windows
x86_64
argocd-windows-amd64.zip
NoteNewer versions of the CLI tool are compatible with the older versions of Red Hat OpenShift GitOps server, but not vice versa.
- Extract the archive with a ZIP program.
Move the binary to a directory on your
PATH
environment variable by running the following command:move argocd.exe <directory>
C:\> move argocd.exe <directory>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After you install the GitOps
argocd
CLI, verify that it is available by running the following command:argocd version --client
$ argocd version --client
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The build information of Red Hat OpenShift GitOps built by Red Hat.
3.4. Installing the Red Hat OpenShift GitOps CLI on macOS Copy linkLink copied to clipboard!
For macOS, you can download the GitOps argocd
CLI as a tar.gz
archive.
Procedure
Download the latest version of the CLI tool from the content gateway for your operating system and architecture.
Expand Operating system Architecture Tarball macOS on Intel
x86_64
argocd-macos-amd64.tar.gz
macOS on ARM
arm64
argocd-macos-arm64.tar.gz
NoteNewer versions of the CLI tool are compatible with the older versions of Red Hat OpenShift GitOps server, but not vice versa.
Extract the archive by running the following command:
tar xvzf <file>
$ tar xvzf <file>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the binary to a directory on your
PATH
environment variable by running the following command:sudo mv argocd /usr/local/bin/argocd
$ sudo mv argocd /usr/local/bin/argocd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make the file executable by running the following command:
sudo chmod +x /usr/local/bin/argocd
$ sudo chmod +x /usr/local/bin/argocd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After you install the GitOps
argocd
CLI, verify that it is available by running the following command:argocd version --client
$ argocd version --client
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The build information of Red Hat OpenShift GitOps built by Red Hat.