Search

Installing GitOps

download PDF
Red Hat OpenShift GitOps 1.12

Installing the Openshift GitOps Operator, logging in to the Argo CD instance, and installing the GitOps CLI.

Red Hat OpenShift Documentation Team

Abstract

This document provides information about sizing requirements and prerequisites for installing the OpenShift GitOps Operator. It also discusses how to install the OpenShift GitOps Operator, log in to the Argo CD instance, and install the GitOps CLI.

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:

WorkloadCPU requestsCPU limitsMemory requestsMemory 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.
Warning

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.

Important

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

  1. Open the Administrator perspective of the web console and go to OperatorsOperatorHub.
  2. Search for OpenShift GitOps, click the Red Hat OpenShift GitOps tile, and then click Install.
  3. On the Install Operator page:

    1. Select an Update channel.
    2. Select a GitOps Version to install.
    3. Choose an Installed Namespace. The default installation namespace is openshift-gitops-operator.

      Note

      For the GitOps version 1.10 and later, the default namespace changed from openshift-operators to openshift-gitops operator.

    4. Select the Enable Operator recommended cluster monitoring on this Namespace checkbox to enable cluster monitoring.

      Note

      You 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

      Example output

      namespace/<namespace> labeled

  4. 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.

  5. Verify that the Red Hat OpenShift GitOps Operator is listed in OperatorsInstalled 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

You can install Red Hat OpenShift GitOps Operator from the OperatorHub by using the CLI.

Note

For the GitOps version 1.10 and later, the default namespace changed from openshift-operators to openshift-gitops operator.

Procedure

  1. Create a openshift-gitops-operator namespace:

    $ oc create ns openshift-gitops-operator

    Example output

    namespace/openshift-gitops-operator created

    Note

    You can enable cluster monitoring on openshift-gitops-operator, or any namespace, by applying the openshift.io/cluster-monitoring=true label:

    $ oc label namespace <namespace> openshift.io/cluster-monitoring=true

    Example output

    namespace/<namespace> labeled

  2. Create a OperatorGroup object YAML file, for example, gitops-operator-group.yaml:

    Example OperatorGroup

    apiVersion: operators.coreos.com/v1
    kind: OperatorGroup
    metadata:
      name: openshift-gitops-operator
      namespace: openshift-gitops-operator
    spec:
      upgradeStrategy: Default

  3. Apply the OperatorGroup to the cluster:

    $ oc apply -f gitops-operator-group.yaml

    Example output

    operatorgroup.operators.coreos.com/openshift-gitops-operator created

  4. 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

    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      name: openshift-gitops-operator
      namespace: openshift-gitops-operator
    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.
  5. Apply the Subscription to the cluster:

    $ oc apply -f openshift-gitops-sub.yaml

    Example output

    subscription.operators.coreos.com/openshift-gitops-operator created

  6. After the installation is complete, verify 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-dex-server-569b498bd9-vf6mr                      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

  7. Verify that the pods in the openshift-gitops-operator namespace are running:

    $ oc get pods -n openshift-gitops-operator

    Example output

    NAME                                                            READY   STATUS    RESTARTS   AGE
    openshift-gitops-operator-controller-manager-664966d547-vr4vb   2/2     Running   0          65m

2.4. Logging in to the Argo CD instance by using the Argo CD admin account

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

  1. In the Administrator perspective of the web console, navigate to OperatorsInstalled Operators to verify that the Red Hat OpenShift GitOps Operator is installed.
  2. Navigate to the red hat applications menu icon menu → OpenShift GitOpsCluster Argo CD. The login page of the Argo CD UI is displayed in a new window.
  3. Optional: To log in with your OpenShift Container Platform credentials, ensure you are a user of the cluster-admins group and then select the LOG IN VIA OPENSHIFT option in the Argo CD user interface.

    Note

    To be a user of the cluster-admins group, use the oc 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.

  4. Obtain the password for the Argo CD instance:

    1. Use the navigation panel to go to the WorkloadsSecrets page.
    2. Use the Project drop-down list and select the namespace where the Argo CD instance is created.
    3. Select the <argo_CD_instance_name>-cluster instance to display the password.
    4. On the Details tab, copy the password under Dataadmin.password.
  5. Use admin as the Username and the copied password as the Password to log in to the Argo CD UI in the new window.
Note

You cannot create two Argo CD CRs in the same namespace.

2.5. Additional resources

Chapter 3. Installing the GitOps CLI

Important

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.

Note

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

For Linux distributions, you can download the GitOps argocd CLI as a tar.gz archive.

Procedure

  1. Download the latest version of the CLI tool from the content gateway for your operating system and architecture.

    Operating systemArchitectureTarball

    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

    Note

    Newer versions of the CLI tool are compatible with the older versions of Red Hat OpenShift GitOps server, but not vice versa.

  2. Extract the archive by running the following command:

    $ tar xvzf <file>
  3. Move the binary to a directory on your PATH environment variable by running the following command:

    $ sudo mv argocd /usr/local/bin/argocd
  4. Make the file executable by running the following command:

    $ sudo chmod +x /usr/local/bin/argocd
  5. After you install the GitOps argocd CLI, verify that it is available by running the following command:

    $ argocd version --client

    Example output

    argocd: v2.9.5+f943664
      BuildDate: 2024-02-15T05:19:27Z
      GitCommit: f9436641a616d277ab1f98694e5ce4c986d4ea05
      GitTreeState: clean
      GoVersion: go1.20.10
      Compiler: gc
      Platform: linux/amd64
      ExtraBuildInfo: openshift-gitops-version: 1.12.0, release: 0015022024 1

    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

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

  1. Register with Red Hat Subscription Manager by running the following command:

    # subscription-manager register
  2. Pull the latest subscription data by running the following command:

    # subscription-manager refresh
  3. List the available subscriptions by running the following command:

    # subscription-manager list --available --matches '*gitops*'
  4. 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>
  5. 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"

      Example command

      # subscription-manager repos --enable="gitops-1.12-for-rhel-8-x86_64-rpms"

    • Linux on IBM zSystems and IBM® LinuxONE (s390x)

      # subscription-manager repos --enable="gitops-<gitops_version>-for-rhel-<rhel_version>-s390x-rpms"

      Example command

      # subscription-manager repos --enable="gitops-1.12-for-rhel-8-s390x-rpms"

    • Linux on IBM Power (ppc64le)

      # subscription-manager repos --enable="gitops-<gitops_version>-for-rhel-<rhel_version>-ppc64le-rpms"

      Example command

      # subscription-manager repos --enable="gitops-1.12-for-rhel-8-ppc64le-rpms"

    • Linux on ARM (aarch64, arm64)

      # subscription-manager repos --enable="gitops-<gitops_version>-for-rhel-<rhel_version>-aarch64-rpms"

      Example command

      # subscription-manager repos --enable="gitops-1.12-for-rhel-8-aarch64-rpms"

  6. Install the openshift-gitops-argocd-cli package by running the following command:

    # yum install openshift-gitops-argocd-cli
  7. After you install the GitOps argocd CLI, verify that it is available by running the following command:

    $ argocd version --client

    Example output

    argocd: v2.9.5+f943664
      BuildDate: 2024-02-15T05:19:27Z
      GitCommit: f9436641a616d277ab1f98694e5ce4c986d4ea05
      GitTreeState: clean
      GoVersion: go1.20.10
      Compiler: gc
      Platform: linux/amd64
      ExtraBuildInfo: openshift-gitops-version: 1.12.0, release: 0015022024 1

    1
    The build information of Red Hat OpenShift GitOps built by Red Hat.

3.3. Installing the Red Hat OpenShift GitOps CLI on Windows

For Windows, you can download the GitOps argocd CLI as a compressed zip archive.

Procedure

  1. Download the latest version of the CLI tool from the content gateway for your operating system and architecture.

    Operating systemArchitectureTarball

    Windows

    x86_64

    argocd-windows-amd64.zip

    Note

    Newer versions of the CLI tool are compatible with the older versions of Red Hat OpenShift GitOps server, but not vice versa.

  2. Extract the archive with a ZIP program.
  3. Move the binary to a directory on your PATH environment variable by running the following command:

    C:\> move argocd.exe <directory>
  4. After you install the GitOps argocd CLI, verify that it is available by running the following command:

    $ argocd version --client

    Example output

    argocd: v2.9.5+f943664
      BuildDate: 2024-02-15T05:19:27Z
      GitCommit: f9436641a616d277ab1f98694e5ce4c986d4ea05
      GitTreeState: clean
      GoVersion: go1.20.10
      Compiler: gc
      Platform: linux/amd64
      ExtraBuildInfo: openshift-gitops-version: 1.12.0, release: 0015022024 1

    1
    The build information of Red Hat OpenShift GitOps built by Red Hat.

3.4. Installing the Red Hat OpenShift GitOps CLI on macOS

For macOS, you can download the GitOps argocd CLI as a tar.gz archive.

Procedure

  1. Download the latest version of the CLI tool from the content gateway for your operating system and architecture.

    Operating systemArchitectureTarball

    macOS on Intel

    x86_64

    argocd-macos-amd64.tar.gz

    macOS on ARM

    arm64

    argocd-macos-arm64.tar.gz

    Note

    Newer versions of the CLI tool are compatible with the older versions of Red Hat OpenShift GitOps server, but not vice versa.

  2. Extract the archive by running the following command:

    $ tar xvzf <file>
  3. Move the binary to a directory on your PATH environment variable by running the following command:

    $ sudo mv argocd /usr/local/bin/argocd
  4. Make the file executable by running the following command:

    $ sudo chmod +x /usr/local/bin/argocd
  5. After you install the GitOps argocd CLI, verify that it is available by running the following command:

    $ argocd version --client

    Example output

    argocd: v2.9.5+f943664
      BuildDate: 2024-02-15T05:19:27Z
      GitCommit: f9436641a616d277ab1f98694e5ce4c986d4ea05
      GitTreeState: clean
      GoVersion: go1.20.10
      Compiler: gc
      Platform: linux/amd64
      ExtraBuildInfo: openshift-gitops-version: 1.12.0, release: 0015022024 1

    1
    The build information of Red Hat OpenShift GitOps built by Red Hat.

3.5. Additional resources

Legal Notice

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.