Este conteúdo não está disponível no idioma selecionado.
Argo CD instance
Installing and deploying Argo CD instances
Abstract
Chapter 1. Setting up an Argo CD instance Copiar o linkLink copiado para a área de transferência!
By default, the Red Hat OpenShift GitOps installs an instance of Argo CD in the openshift-gitops
namespace with additional permissions for managing certain cluster-scoped resources. To manage cluster configurations or deploy applications, you can install and deploy a new Argo CD instance. By default, any new instance has permissions to manage resources only in the namespace where it is deployed.
1.1. Installing an Argo CD instance Copiar o linkLink copiado para a área de transferência!
To manage cluster configurations or deploy applications, you can install and deploy a new Argo CD instance.
Procedure
- Log in to the OpenShift Container Platform web console.
- Click Operators → Installed Operators.
- Create or select the project where you want to install the Argo CD instance from the Project drop-down menu.
- Select OpenShift GitOps Operator from the installed operators list and click the Argo CD tab.
Click Create ArgoCD to configure the parameters:
-
Enter the Name of the instance. By default, the Name is set to
example
. - Create an external OS Route to access Argo CD server. Click Server → Route and check Enabled.
-
Enter the Name of the instance. By default, the Name is set to
- To open the Argo CD web UI, click the route by navigating to Networking → Routes → <instance name>-server in the project where the Argo CD instance is installed.
1.2. Enabling replicas for Argo CD server and repo server Copiar o linkLink copiado para a área de transferência!
Argo CD-server and Argo CD-repo-server workloads are stateless. To better distribute your workloads among pods, you can increase the number of Argo CD-server and Argo CD-repo-server replicas. However, if a horizontal autoscaler is enabled on the Argo CD-server, it overrides the number of replicas you set.
Procedure
Set the
replicas
parameters for therepo
andserver
spec to the number of replicas you want to run:Example Argo CD custom resource
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.3. Deploying resources to a different namespace Copiar o linkLink copiado para a área de transferência!
To allow Argo CD to manage resources in other namespaces apart from where it is installed, configure the target namespace with a argocd.argoproj.io/managed-by
label.
Procedure
Configure the namespace:
oc label namespace <namespace> \ argocd.argoproj.io/managed-by=<namespace>
$ oc label namespace <namespace> \ argocd.argoproj.io/managed-by=<namespace>
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The namespace where Argo CD is installed.
1.4. Customizing the Argo CD console link Copiar o linkLink copiado para a área de transferência!
In a multi-tenant cluster, users might have to deal with multiple instances of Argo CD. For example, after installing an Argo CD instance in your namespace, you might find a different Argo CD instance attached to the Argo CD console link, instead of your own Argo CD instance, in the Console Application Launcher.
You can customize the Argo CD console link by setting the DISABLE_DEFAULT_ARGOCD_CONSOLELINK
environment variable:
-
When you set
DISABLE_DEFAULT_ARGOCD_CONSOLELINK
totrue
, the Argo CD console link is permanently deleted. -
When you set
DISABLE_DEFAULT_ARGOCD_CONSOLELINK
tofalse
or use the default value, the Argo CD console link is temporarily deleted and visible again when the Argo CD route is reconciled.
Prerequisites
- You have logged in to the OpenShift Container Platform cluster as an administrator.
- You have installed the Red Hat OpenShift GitOps Operator.
Procedure
- In the Administrator perspective, navigate to Administration → CustomResourceDefinitions.
- Find the Subscription CRD and click to open it.
- Select the Instances tab and click the openshift-gitops-operator subscription.
Select the YAML tab and make your customization:
To enable or disable the Argo CD console link, edit the value of
DISABLE_DEFAULT_ARGOCD_CONSOLELINK
as needed:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Chapter 2. Argo CD custom resource and component properties Copiar o linkLink copiado para a área de transferência!
The ArgoCD
custom resource is a Kubernetes Custom Resource (CRD) that describes the desired state for a given Argo CD cluster that allows you to configure the components which make up an Argo CD cluster.
2.1. Argo CD CLI tool Copiar o linkLink copiado para a área de transferência!
The Argo CD CLI tool is a tool used to configure Argo CD through the command line. Red Hat OpenShift GitOps does not support this binary. Use the OpenShift Console to configure the Argo CD.
2.2. Argo CD custom resource properties Copiar o linkLink copiado para a área de transferência!
The Argo CD Custom Resource consists of the following properties:
Name | Description | Default | Properties |
---|---|---|---|
|
The |
| |
|
|
|
|
| Add a configuration management plugin. |
| |
| Argo CD Application Controller options. |
|
|
| Disables the built-in admin user. |
| |
| Use a Google Analytics tracking ID. |
| |
| Enable hashed usernames sent to google analytics. |
| |
| High availablity options. |
|
|
| URL for getting chat help (this is typically your Slack channel for support). | ||
| The text that appears in a text box for getting chat help. |
| |
|
The container image for all Argo CD components. This overrides the |
| |
| Ingress configuration options. |
| |
| Initial Git repositories to configure Argo CD to use upon creation of the cluster. |
| |
| Notifications controller configuration options. |
|
|
| Git repository credential templates to configure Argo CD to use upon creation of the cluster. |
| |
| Initial SSH Known Hosts for Argo CD to use upon creation of the cluster. |
| |
|
The build options and parameters to use with |
| |
| The OIDC configuration as an alternative to Dex. |
| |
|
Add the |
| |
| Prometheus configuration options. |
|
|
| RBAC configuration options. |
|
|
| Redis configuration options. |
|
|
| Customize resource health check behavior. |
| |
| Customize resource ignore difference behavior. |
| |
| Customize resource action behavior. |
| |
| Completely ignore entire classes of resource group. |
| |
| The configuration to identify which resource group/kinds are applied. |
| |
| Argo CD Server configuration options. |
|
|
| Single Sign-on options. |
|
|
| Enable application status badge. |
| |
| TLS configuration options. |
|
|
| Enable anonymous user access. |
| |
| The tag to use with the container image for all Argo CD components. | Latest Argo CD version | |
| Add a UI banner message. |
|
|
2.3. Repo server properties Copiar o linkLink copiado para a área de transferência!
The following properties are available for configuring the Repo server component:
Name | Default | Description |
---|---|---|
|
| The container compute resources. |
|
|
Defines whether the |
|
|
The name of the |
|
| Defines whether to enforce strict TLS checking on all components when communicating with repo server. |
|
|
Provider to use for setting up TLS for the repo-server’s gRPC TLS certificate. Currently, only the |
|
|
The container image for Argo CD Repo server. This overrides the |
|
same as | The tag to use with the Argo CD Repo server. |
|
|
The log level used by the Argo CD Repo server. Valid options are |
|
|
The log format to be used by the Argo CD Repo server. Valid options are |
|
| Execution timeout in seconds for rendering tools (for example Helm or Kustomize). |
|
| Environment to set for the repository server workloads. |
|
|
The number of replicas for the Argo CD Repo server. Must be greater than or equal to |
2.4. Enabling notifications with Argo CD instance Copiar o linkLink copiado para a área de transferência!
Argo CD notifications allow you to send notifications to external services when events occur in your Argo CD instance. For example, you can send notifications to Slack or email when a sync operation fails. By default, notifications are disabled in Argo CD instances.
Prerequisites
-
You have access to an OpenShift Container Platform cluster with
cluster-admin
privileges and are logged into the web console. - You have installed the Red Hat OpenShift GitOps Operator on your cluster.
Procedure
To enable notifications for an Argo CD instance using the OpenShift Container Platform web console, complete the following steps:
- Navigate to the Operators → Installed Operators page.
- From the list of Installed Operators, select the Red Hat OpenShift GitOps Operator, and then click on the ArgoCD tab.
-
Select the Argo CD instance name you want to enable notifications. For example,
openshift-gitops
. Click on the YAML tab, and then edit and set the
spec.notifications.enabled
parameter totrue
:Example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Click Save.
Alternatively, you can enable notifications by using the oc patch
command in the Openshift CLI. For example:
oc patch argocd openshift-gitops -n openshift-gitops --type merge --patch '{"spec": {"notifications": {"enabled": true}}}'
oc patch argocd openshift-gitops -n openshift-gitops --type merge --patch '{"spec": {"notifications": {"enabled": true}}}'