|
| 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