Skip to content

Commit 6bb6b6e

Browse files
committed
Added a reference for setting up environment labels.
miner update to address 2nd peer review. update to address peer review. Update to remove build errors Update to address merge reviews.
1 parent 40a721e commit 6bb6b6e

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

cicd/gitops/health-information-for-resources-deployment.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ The *Application environments* page in the *Developer* perspective of the {produ
1212

1313
The environments pages in the *Developer* perspective of the {product-title} web console are decoupled from the {gitops-title} Application Manager command-line interface (CLI), `kam`. You do not have to use `kam` to generate Application Environment manifests for the environments to show up in the *Developer* perspective of the {product-title} web console. You can use your own manifests, but the environments must still be represented by namespaces. In addition, specific labels and annotations are still needed.
1414

15+
include::modules/go-settings-for-environment-labels-and-annotations.adoc[leveloffset=+1]
1516
include::modules/go-health-monitoring.adoc[leveloffset=+1]
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * /gitops/health-information-for-resources-deployment.adoc
4+
5+
:_content-type: REFERENCE
6+
[id="go-settings-for-environment-labels-and-annotations_{context}"]
7+
= Settings for environment labels and annotations
8+
9+
This section provides reference settings for environment labels and annotations required to display an environment application in the *Environments* page, in the *Developer* perspective of the {product-title} web console.
10+
11+
[discrete]
12+
== Environment labels
13+
14+
The environment application manifest must contain `labels.openshift.gitops/environment` and `destination.namespace` fields. You must set identical values for the `<environment_name>` variable and the name of the environment application manifest.
15+
16+
.Specification of the environment application manifest
17+
[source,yaml]
18+
----
19+
spec:
20+
labels:
21+
openshift.gitops/environment: <environment_name>
22+
destination:
23+
namespace: <environment_name>
24+
...
25+
----
26+
27+
.Example of an environment application manifest
28+
[source,yaml]
29+
----
30+
apiVersion: argoproj.io/v1alpha1
31+
kind: Application
32+
metadata:
33+
name: dev-env <1>
34+
namespace: openshift-gitops
35+
spec:
36+
labels:
37+
openshift.gitops/environment: dev-env
38+
destination:
39+
namespace: dev-env
40+
...
41+
----
42+
<1> The name of the environment application manifest. The value set is the same as the value of the `<environment_name>` variable.
43+
44+
[discrete]
45+
== Environment annotations
46+
The environment namespace manifest must contain the `annotations.app.openshift.io/vcs-uri` and `annotations.app.openshift.io/vcs-ref` fields to specify the version controller code source of the application. You must set identical values for the `<environment_name>` variable and the name of the environment namespace manifest.
47+
48+
.Specification of the environment namespace manifest
49+
[source,yaml]
50+
----
51+
apiVersion: v1
52+
kind: Namespace
53+
metadata:
54+
annotations:
55+
app.openshift.io/vcs-uri: <application_source_url>
56+
app.openshift.io/vcs-ref: <branch_reference>
57+
name: <environment_name> <1>
58+
...
59+
----
60+
<1> The name of the environment namespace manifest. The value set is the same as the value of the `<environment_name>` variable.
61+
62+
.Example of an environment namespace manifest
63+
[source,yaml]
64+
----
65+
apiVersion: v1
66+
kind: Namespace
67+
metadata:
68+
annotations:
69+
app.openshift.io/vcs-uri: https://example.com/<your_domain>/<your_gitops.git>
70+
app.openshift.io/vcs-ref: main
71+
labels:
72+
argocd.argoproj.io/managed-by: openshift-gitops
73+
name: dev-env
74+
...
75+
----

0 commit comments

Comments
 (0)