Skip to content

Commit 0759f15

Browse files
authored
Merge pull request #89312 from Dhruv-Soni11/RHDEVDOCS-6381
RHDEVDOCS-6381: Content creation for multi-instance Argo CD feature
2 parents 990ac1f + 5be75f8 commit 0759f15

3 files changed

+175
-0
lines changed

argocd_instance/argo-cd-cr-component-properties.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ include::modules/proc_configuring-by-using-the-ocp-web-console.adoc[leveloffset=
2626
// Configuring the NotificationsConfiguration CR by using the CLI
2727
include::modules/proc_configuring-notificationsconfiguration-crd-by-using-the-ocp-cli.adoc[leveloffset=+2]
2828

29+
// Enabling annotation-based resource tracking in Argo CD
30+
include::modules/con_enabling_annotation_based_resource_tracking_in_argo_cd.adoc[leveloffset=+1]
31+
32+
// Configuring annotation-based tracking in multiple Argo CD instances
33+
include::modules/proc_configuring-annotation-based-tracking-in-multiple-argo-cd-instances.adoc[leveloffset=+2]
34+
2935
[role="_additional-resources"]
3036
[id="additional-resources_{context}"]
3137
== Additional resources
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * argocd_instance/argo-cd-cr-component-properties.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="con-enabling-annotation-based-resource-tracking-in-argo-cd_{context}"]
7+
= Enabling annotation-based resource tracking in Argo CD
8+
9+
{gitops-title} Operator enhances multi-instance support by improving annotation-based resource tracking in Argo CD. Previously, multiple Argo CD instances did not differentiate resources with identical application names properly, relying only on legacy label-based tracking. With this enhancement, you can fully leverage annotation-based tracking by assigning each instance a unique `installationID` ID. This prevents resource conflicts, eliminates infinite sync loops, and enables safe parallel operation.
10+
11+
You can perform the following actions by using the {OCP} web console:
12+
13+
* Set up multiple Argo CD instances
14+
* Configure annotation-based tracking by associating them with namespaces
15+
* Verify deployments
16+
17+
[NOTE]
18+
====
19+
* Each Argo CD instance must have a unique `installationID` ID to prevent resource tracking conflicts.
20+
* Ensure that namespaces are labelled accurately because it allows each Argo CD instance to manage only the intended resources.
21+
* If multiple instances have applications with the same name, set resource tracking to `annotation+label`.
22+
* If issues arise, check the *Argo CD Application* status and logs in the {OCP} web console.
23+
====
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * argocd_instance/argo-cd-cr-component-properties.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="configuring-annotation-based-tracking-in-multiple-argo-cd-instances_{context}"]
7+
= Configuring annotation-based tracking in multiple Argo CD instances
8+
9+
You can configure annotation-based tracking in multiple Argo CD instances.
10+
11+
[NOTE]
12+
====
13+
This procedure uses the following example values:
14+
15+
* `repoURL`: `\https://github.com/redhat-developer/gitops-operator`
16+
* `server`: `\https://kubernetes.default.svc`
17+
18+
When you follow these steps, replace the example values with the actual values.
19+
====
20+
21+
.Pre-requisites
22+
23+
* You have logged in to the {OCP} cluster as an administrator.
24+
* You have installed the {gitops-title} Operator on your {OCP} cluster.
25+
26+
.Procedure
27+
28+
. Log in to the {OCP} web console.
29+
30+
. In the *Administrator* perspective of the web console, click *Operators* -> *Installed Operators*.
31+
32+
* In the *Project* list, create or select the project where you want to install the user-defined Argo CD instance.
33+
34+
. Select *{gitops-title}* from the installed Operators list and click the *Argo CD* tab.
35+
36+
. To create two Argo CD instances, click *Create ArgoCD* and create two YAML files similar to the following examples:
37+
+
38+
.Example first Argo CD instance with an annotation label
39+
[source,yaml]
40+
----
41+
apiVersion: argoproj.io/v1beta1
42+
kind: ArgoCD
43+
metadata:
44+
name: argocd-instance-demo-1 # <1>
45+
namespace: argocd-test-demo-1 # <2>
46+
spec:
47+
installationID: "instance-demo-1" # <3>
48+
resourceTrackingMethod: "annotation+label"
49+
----
50+
<1> Specifies the name of the first Argo CD instance.
51+
<2> Specifies the namespace used for the first Argo CD instance.
52+
<3> Specifies the name of the `installationID` object for the first Argo CD instance.
53+
+
54+
.Example second Argo CD instance with an annotation label
55+
[source,yaml]
56+
----
57+
apiVersion: argoproj.io/v1beta1
58+
kind: ArgoCD
59+
metadata:
60+
name: argocd-instance-demo-2 # <1>
61+
namespace: argocd-test-demo-2 # <2>
62+
spec:
63+
installationID: "instance-demo-2" # <3>
64+
resourceTrackingMethod: "annotation+label"
65+
----
66+
+
67+
<1> Specifies the name of the second Argo CD instance.
68+
<2> Specifies the namespace used for the second Argo CD instance.
69+
<3> Specifies the name of the `installationID` object for the second Argo CD instance.
70+
71+
. Configure and label target namespaces to associate namespaces with their Argo CD instances.
72+
.. Navigate to *Administration* -> *Namespaces*.
73+
.. Create namespaces for application deployments, `app-ns-1` and `app-ns-2`.
74+
.. Associate each namespace with their respective Argo CD instance:
75+
... Associate the `app-ns-1` namespace with the `argocd-test-demo-1` Argo CD instance by running the following command:
76+
+
77+
.Example command
78+
[source,terminal]
79+
----
80+
$ oc label namespace app-ns-1 argocd.argoproj.io/managed-by=argocd-test-demo-1
81+
----
82+
... Associate the `app-ns-2` namespace with the `argocd-test-demo-2` Argo CD instance by running the following command:
83+
+
84+
.Example command
85+
[source,terminal]
86+
----
87+
$ oc label namespace app-ns-2 argocd.argoproj.io/managed-by=argocd-test-demo-2
88+
----
89+
+
90+
. Create two applications in Argo CD.
91+
.. In the {OCP} web console, go to *Operators* -> *Installed Operators* -> *OpenShift GitOps Operator*.
92+
.. Select *Argo CD* and navigate to the *Applications* tab.
93+
.. Click *Create Application*.
94+
.. Enter the following YAML snippet to create two applications in Argo CD.
95+
+
96+
.Example first application using Argo CD
97+
[source,yaml]
98+
----
99+
apiVersion: argoproj.io/v1alpha1
100+
kind: Application
101+
metadata:
102+
name: sprint-petclinic # <1>
103+
namespace: argocd-test-demo-1 # <2>
104+
spec:
105+
project: default
106+
source:
107+
repoURL: https://github.com/redhat-developer/gitops-operator
108+
path: test/examples/nginx
109+
targetRevision: HEAD
110+
destination:
111+
server: https://kubernetes.default.svc
112+
namespace: app-ns-1
113+
syncPolicy:
114+
automated: {}
115+
----
116+
<1> Specifies the name of the first application.
117+
<2> Specifies the namespace used for the first application.
118+
+
119+
.Example second application using Argo CD
120+
[source,yaml]
121+
----
122+
apiVersion: argoproj.io/v1alpha1
123+
kind: Application
124+
metadata:
125+
name: sprint-petclinic # <1>
126+
namespace: argocd-test-demo-2 # <2>
127+
spec:
128+
project: default
129+
source:
130+
repoURL: https://github.com/redhat-developer/gitops-operator
131+
path: test/examples/nginx
132+
targetRevision: HEAD
133+
destination:
134+
server: https://kubernetes.default.svc
135+
namespace: app-ns-2
136+
syncPolicy:
137+
automated: {}
138+
----
139+
<1> Specifies the name of the second application that is created with the same name as the first application.
140+
<2> Specifies the namespace used for the second application.
141+
142+
.Verification
143+
. Navigate to *Workloads* -> *Pods* in the {OCP} web console.
144+
. Ensure that the pods for Argo CD instances `argocd-instance-demo-1` and `argocd-instance-demo-2` are running.
145+
. Check the application synchronization status in the *Argo CD Applications* YAML tab.
146+
. Navigate to the `argocd-cm` config map in `argocd-test-demo-1` and `argocd-test-demo-2` namespaces and verify that the `installationID` object is configured successfully.

0 commit comments

Comments
 (0)