このコンテンツは選択した言語では利用できません。
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 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.19.x, you can use the gitops-1.19 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 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-operatorstoopenshift-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=truelabel:$ oc label namespace <namespace> openshift.io/cluster-monitoring=trueExample output:
namespace/<namespace> labeled
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 リンクのコピーリンクがクリップボードにコピーされました!
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-adminprivileges. -
You have installed the
ocCLI.
Procedure
Create a
openshift-gitops-operatornamespace:$ oc create ns openshift-gitops-operatorExample output:
namespace/openshift-gitops-operator createdNoteYou can enable cluster monitoring on
openshift-gitops-operator, or any namespace, by applying theopenshift.io/cluster-monitoring=truelabel:$ oc label namespace <namespace> openshift.io/cluster-monitoring=trueExample output:
namespace/<namespace> labeledCreate a
OperatorGroupobject 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: DefaultApply the
OperatorGroupto the cluster:$ oc apply -f gitops-operator-group.yamlExample output:
operatorgroup.operators.coreos.com/openshift-gitops-operator createdCreate a
Subscriptionobject 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 installPlanApproval: Automatic name: openshift-gitops-operator source: redhat-operators sourceNamespace: openshift-marketplacewhere:
metadata.name- Specifies the specify the channel name from where you want to subscribe the Operator.
metadata.namespace- Specifies the specify the name of the Operator to subscribe to.
spec.channel- Specifies the specify the name of the CatalogSource that provides the Operator.
spec.source(openshift-marketplace namespace)-
Specifies the namespace of the CatalogSource. Use
openshift-marketplacefor the default OperatorHub CatalogSources.
Apply the
Subscriptionto the cluster:$ oc apply -f openshift-gitops-sub.yamlExample output:
subscription.operators.coreos.com/openshift-gitops-operator createdAfter the installation is complete, verify that all the pods in the
openshift-gitopsnamespace are running:$ oc get pods -n openshift-gitopsExample output:
NAME READY STATUS RESTARTS AGE cluster-785cfc5f75-669wq 1/1 Running 0 76s gitops-plugin-6664c749dd-dx64s 1/1 Running 0 76s openshift-gitops-application-controller-0 1/1 Running 0 74s openshift-gitops-applicationset-controller-549d7f6686-wzckt 1/1 Running 0 74s openshift-gitops-dex-server-5d4ffdb9b9-lb7b7 1/1 Running 0 74s openshift-gitops-redis-6d65c94d4b-k9l8k 1/1 Running 0 75s openshift-gitops-repo-server-79db854c58-279jr 1/1 Running 0 75s openshift-gitops-server-f488b848-xntbc 1/1 Running 0 75sVerify that the pods in the
openshift-gitops-operatornamespace are running:$ oc get pods -n openshift-gitops-operatorExample output:
NAME READY STATUS RESTARTS AGE openshift-gitops-operator-controller-manager-6fdc5cd9dc-jr9mn 2/2 Running 0 41s
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
-
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-adminsgroup and then select theLOG IN VIA OPENSHIFToption in the Argo CD user interface.NoteTo be a user of the
cluster-adminsgroup, 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 the navigation panel to go to the Workloads
-
Use
adminas 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.
Avoid modifying the argocd-secret secret that GitOps creates, using external secret management solutions such as the External Secrets Operator or Vault plugins. The openshift-gitops-operator manages this secret as part of its core functionality. If you modify this secret externally, it can cause reconciliation conflicts, unpredictable behavior, or disruption of Argo CD instances and GitOps workflows. To maintain consistency and reliability, allow the GitOps Operator to exclusively manage the argocd-secret secret.