mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
75 lines
2.4 KiB
Plaintext
75 lines
2.4 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * /gitops/health-information-for-resources-deployment.adoc
|
|
|
|
:_mod-docs-content-type: REFERENCE
|
|
[id="go-settings-for-environment-labels-and-annotations_{context}"]
|
|
= Settings for environment labels and annotations
|
|
|
|
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.
|
|
|
|
|
|
== Environment labels
|
|
|
|
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.
|
|
|
|
.Specification of the environment application manifest
|
|
[source,yaml]
|
|
----
|
|
spec:
|
|
labels:
|
|
openshift.gitops/environment: <environment_name>
|
|
destination:
|
|
namespace: <environment_name>
|
|
...
|
|
----
|
|
|
|
.Example of an environment application manifest
|
|
[source,yaml]
|
|
----
|
|
apiVersion: argoproj.io/v1alpha1
|
|
kind: Application
|
|
metadata:
|
|
name: dev-env <1>
|
|
namespace: openshift-gitops
|
|
spec:
|
|
labels:
|
|
openshift.gitops/environment: dev-env
|
|
destination:
|
|
namespace: dev-env
|
|
...
|
|
----
|
|
<1> The name of the environment application manifest. The value set is the same as the value of the `<environment_name>` variable.
|
|
|
|
|
|
== Environment annotations
|
|
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.
|
|
|
|
.Specification of the environment namespace manifest
|
|
[source,yaml]
|
|
----
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
annotations:
|
|
app.openshift.io/vcs-uri: <application_source_url>
|
|
app.openshift.io/vcs-ref: <branch_reference>
|
|
name: <environment_name> <1>
|
|
...
|
|
----
|
|
<1> The name of the environment namespace manifest. The value set is the same as the value of the `<environment_name>` variable.
|
|
|
|
.Example of an environment namespace manifest
|
|
[source,yaml]
|
|
----
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
annotations:
|
|
app.openshift.io/vcs-uri: https://example.com/<your_domain>/<your_gitops.git>
|
|
app.openshift.io/vcs-ref: main
|
|
labels:
|
|
argocd.argoproj.io/managed-by: openshift-gitops
|
|
name: dev-env
|
|
...
|
|
---- |