Skip to content

Commit 0742000

Browse files
Updated plugin doc for Argo CD rollout feature (#972)
Co-authored-by: [email protected] <[email protected]>
1 parent 1f49de0 commit 0742000

File tree

1 file changed

+153
-0
lines changed

1 file changed

+153
-0
lines changed

artifacts/rhdh-plugins-reference/argocd/argocd-plugin-admin.adoc

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,159 @@ global:
7070
disabled: false
7171
----
7272

73+
== Enabling Argo CD Rollouts
74+
75+
The optional Argo CD Rollouts feature enhances Kubernetes by providing advanced deployment strategies, such as blue-green and canary deployments, for your applications. When integrated into the backstage Kubernetes plugin, it allows developers and operations teams to visualize and manage Argo CD Rollouts seamlessly within the Backstage interface.
76+
77+
.Prerequisites
78+
79+
* The Backstage Kubernetes plugin (`@backstage/plugin-kubernetes`) is installed and configured.
80+
81+
** To install and configure Kubernetes plugin in Backstage, see link:https://backstage.io/docs/features/kubernetes/installation/[Installaltion] and link:https://backstage.io/docs/features/kubernetes/configuration/[Configuration] guide.
82+
83+
* You have access to the Kubernetes cluster with the necessary permissions to create and manage custom resources and `ClusterRoles`.
84+
85+
* The Kubernetes cluster has the `argoproj.io` group resources (for example, Rollouts and AnalysisRuns) installed.
86+
87+
.Procedure
88+
89+
. In the `app-config.yaml` file in your Backstage instance, add the following `customResources` component under the `kubernetes` configuration to enable Argo Rollouts and AnalysisRuns:
90+
91+
+
92+
[source,yaml]
93+
----
94+
kubernetes:
95+
...
96+
customResources:
97+
- group: 'argoproj.io'
98+
apiVersion: 'v1alpha1'
99+
plural: 'Rollouts'
100+
- group: 'argoproj.io'
101+
apiVersion: 'v1alpha1'
102+
plural: 'analysisruns'
103+
----
104+
105+
. Grant `ClusterRole` permissions for custom resources.
106+
107+
+
108+
[NOTE]
109+
====
110+
111+
* If the Backstage Kubernetes plugin is already configured, the `ClusterRole` permissions for Rollouts and AnalysisRuns might already be granted.
112+
113+
* Use the link:https://raw.githubusercontent.com/backstage/community-plugins/main/workspaces/redhat-argocd/plugins/argocd/manifests/clusterrole.yaml[prepared manifest] to provide read-only `ClusterRole` access to both the Kubernetes and ArgoCD plugins.
114+
====
115+
116+
.. If the `ClusterRole` permission is not granted, use the following YAML manifest to create the `ClusterRole`:
117+
118+
+
119+
[source,yaml]
120+
----
121+
apiVersion: rbac.authorization.k8s.io/v1
122+
kind: ClusterRole
123+
metadata:
124+
name: backstage-read-only
125+
rules:
126+
- apiGroups:
127+
- argoproj.io
128+
resources:
129+
- rollouts
130+
- analysisruns
131+
verbs:
132+
- get
133+
- list
134+
----
135+
136+
.. Apply the manifest to the cluster using `kubectl`:
137+
+
138+
[source,bash]
139+
----
140+
kubectl apply -f <your-clusterrole-file>.yaml
141+
----
142+
143+
.. Ensure the `ServiceAccount` accessing the cluster has this `ClusterRole` assigned.
144+
145+
. Add annotations to `catalog-info.yaml` to identify Kubernetes resources for Backstage.
146+
147+
.. For identifying resources by entity ID:
148+
+
149+
[source,yaml]
150+
----
151+
annotations:
152+
...
153+
backstage.io/kubernetes-id: <BACKSTAGE_ENTITY_NAME>
154+
----
155+
156+
.. (Optional) For identifying resources by namespace:
157+
+
158+
[source,yaml]
159+
----
160+
annotations:
161+
...
162+
backstage.io/kubernetes-namespace: <RESOURCE_NAMESPACE>
163+
----
164+
165+
.. For using custom label selectors, which override resource identification by entity ID or namespace:
166+
+
167+
[source,yaml]
168+
----
169+
annotations:
170+
...
171+
backstage.io/kubernetes-label-selector: 'app=my-app,component=front-end'
172+
----
173+
+
174+
[NOTE]
175+
====
176+
Ensure you specify the labels declared in `backstage.io/kubernetes-label-selector` on your Kubernetes resources. This annotation overrides entity-based or namespace-based identification annotations, such as `backstage.io/kubernetes-id` and `backstage.io/kubernetes-namespace`.
177+
====
178+
179+
. Add label to Kubernetes resources to enable Backstage to find the appropriate Kubernetes resources.
180+
181+
.. Backstage Kubernetes plugin label: Add this label to map resources to specific Backstage entities.
182+
+
183+
[source,yaml]
184+
----
185+
labels:
186+
...
187+
backstage.io/kubernetes-id: <BACKSTAGE_ENTITY_NAME>
188+
----
189+
190+
.. GitOps application mapping: Add this label to map Argo CD Rollouts to a specific GitOps application
191+
+
192+
[source,yaml]
193+
----
194+
labels:
195+
...
196+
app.kubernetes.io/instance: <GITOPS_APPLICATION_NAME>
197+
----
198+
199+
+
200+
[NOTE]
201+
====
202+
If using the label selector annotation (backstage.io/kubernetes-label-selector), ensure the specified labels are present on the resources. The label selector will override other annotations like kubernetes-id or kubernetes-namespace.
203+
====
204+
205+
.Verification
206+
207+
. Push the updated configuration to your GitOps repository to trigger a rollout.
208+
209+
. Open {Product} interface and navigate to the entity you configured.
210+
211+
. Select the *CD* tab and then select the *GitOps application*. The side panel opens.
212+
213+
. In the *Resources* table of the side panel, verify that the following resources are displayed:
214+
215+
* Rollouts
216+
217+
* AnalysisRuns (optional)
218+
219+
. Expand a rollout resource and review the following details:
220+
221+
* The Revisions row displays traffic distribution details for different rollout versions.
222+
223+
* The Analysis Runs row displays the status of analysis tasks that evaluate rollout success.
224+
225+
73226
[role="_additional-resources"]
74227
.Additional resources
75228

0 commit comments

Comments
 (0)