From 1e2b9a65ecc1ed50a10cc17622533339af865d81 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 22 Nov 2023 09:29:25 +0100 Subject: [PATCH 1/8] feat: Customizing OpenShift Eclipse Che ConsoleLink Signed-off-by: Anatolii Bazko --- .../pages/configuring-dashboard.adoc | 3 + ...customizing-openshift-che-consolelink.adoc | 41 +++++++ ...environment-variable-into-a-container.adoc | 2 + ...nfigmap-as-a-subpath-into-a-container.adoc | 100 ++++++++++++++++++ ...environment-variable-into-a-container.adoc | 2 +- ...ecret-or-a-configmap-into-a-container.adoc | 2 +- 6 files changed, 148 insertions(+), 2 deletions(-) create mode 100644 modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc create mode 100644 modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc diff --git a/modules/administration-guide/pages/configuring-dashboard.adoc b/modules/administration-guide/pages/configuring-dashboard.adoc index f5452252f1..f6c4f8ae73 100644 --- a/modules/administration-guide/pages/configuring-dashboard.adoc +++ b/modules/administration-guide/pages/configuring-dashboard.adoc @@ -8,3 +8,6 @@ = Configuring dashboard * xref:configuring-getting-started-samples.adoc[] + +* xref:customizing-openshift-che-consolelink.adoc[] + diff --git a/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc b/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc new file mode 100644 index 0000000000..4c43ebdbd7 --- /dev/null +++ b/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc @@ -0,0 +1,41 @@ +:_content-type: PROCEDURE +:description: Customizing OpenShift Eclipse Che ConsoleLink +:keywords: administration guide, customizing, consolelink +:navtitle: Customizing OpenShift Eclipse Che ConsoleLink +:page-aliases: installation-guide:customizing-openshift-che-consolelink.adoc + +[id="customizing-openshift-che-consolelink"] += Customizing {ocp} {prod} ConsoleLink + +This procedure describes how to customize {prod} ConsoleLink. + +.Prerequisites + +* An active `{orch-cli}` session with administrative permissions to the {orch-name} cluster. See {orch-cli-link}. + +.Procedure + +. Create a Secret: ++ +[source,shell,subs="+quotes,+attributes"] +---- +{orch-cli} apply -f - <__ <1> +type: Opaque +EOF +---- +<1> Base64 encoding with disabled line wrapping. + +. Wait until the rollout of {prod-deployment}-dashboard finishes. diff --git a/modules/administration-guide/pages/mounting-a-secret-as-a-file-or-an-environment-variable-into-a-container.adoc b/modules/administration-guide/pages/mounting-a-secret-as-a-file-or-an-environment-variable-into-a-container.adoc index 455148a470..dfacaf2559 100644 --- a/modules/administration-guide/pages/mounting-a-secret-as-a-file-or-an-environment-variable-into-a-container.adoc +++ b/modules/administration-guide/pages/mounting-a-secret-as-a-file-or-an-environment-variable-into-a-container.adoc @@ -26,5 +26,7 @@ The mounting process uses the standard {platforms-name} mounting mechanism, but include::partial$proc_mounting-a-secret-or-a-configmap-as-a-file-into-a-container.adoc[leveloffset=+1] +include::partial$proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc[leveloffset=+1] + include::partial$proc_mounting-a-secret-or-a-configmap-as-an-environment-variable-into-a-container.adoc[leveloffset=+1] diff --git a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc new file mode 100644 index 0000000000..56317d24e3 --- /dev/null +++ b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc @@ -0,0 +1,100 @@ +// Module included in the following assemblies: +// +// mounting-a-secret-or-a-configmap-as-a-file-or-an-environment-variable-into-a-container + + +[id="mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container"] += Mounting a Secret or a ConfigMap as a subPath into a {prod-short} container + + +.Prerequisites + +* A running instance of {prod}. + +.Procedure + +include::partial$snip_mounting-a-secret-or-a-configmap-into-a-container.adoc[leveloffset=+1] + +Annotations must indicate that the given object is mounted as a subPath. + +. Configure the annotation values: ++ +* `che.eclipse.org/mount-as: subpath` - To indicate that an object is mounted as a subPath. +* `che.eclipse.org/mount-path: __` - To provide a required mount path. + +.Example: +==== +[source,yaml] +---- +apiVersion: v1 +kind: Secret +metadata: + name: custom-data + annotations: + che.eclipse.org/mount-as: subpath + che.eclipse.org/mount-path: /data + labels: +... +---- +or +[source,yaml] +---- +apiVersion: v1 +kind: ConfigMap +metadata: + name: custom-data + annotations: + che.eclipse.org/mount-as: subpath + che.eclipse.org/mount-path: /data + labels: +... +---- +==== + +The {orch-name} object can contain several items whose names must match the desired file name mounted into the container. + +.Example: +==== +[source,yaml,subs="+quotes,attributes"] +---- +apiVersion: v1 +kind: Secret +metadata: + name: custom-data + labels: + app.kubernetes.io/part-of: che.eclipse.org + app.kubernetes.io/component: {prod-deployment}-secret + annotations: + che.eclipse.org/mount-as: subpath + che.eclipse.org/mount-path: /data +data: + ca.crt: ____ +---- +or +[source,yaml,subs="+quotes,attributes"] +---- +apiVersion: v1 +kind: ConfigMap +metadata: + name: custom-data + labels: + app.kubernetes.io/part-of: che.eclipse.org + app.kubernetes.io/component: {prod-deployment}-configmap + annotations: + che.eclipse.org/mount-as: subpath + che.eclipse.org/mount-path: /data +data: + ca.crt: ____ +---- +==== + +This results in a file named `ca.crt` being mounted at the `/data` path of {prod-short} container. + +IMPORTANT: To make the changes in a {prod-short} container visible, recreate the object entirely. + +.Additional resources + +* xref:using-chectl-to-configure-the-checluster-custom-resource-during-installation.adoc[] + +* xref:using-the-cli-to-configure-the-checluster-custom-resource.adoc[] + diff --git a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-an-environment-variable-into-a-container.adoc b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-an-environment-variable-into-a-container.adoc index d02ab37ea5..4f43713ac6 100644 --- a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-an-environment-variable-into-a-container.adoc +++ b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-an-environment-variable-into-a-container.adoc @@ -15,7 +15,7 @@ include::partial$snip_mounting-a-secret-or-a-configmap-into-a-container.adoc[leveloffset=+1] -Annotations must indicate that the given object is mounted as a environment variable. +Annotations must indicate that the given object is mounted as an environment variable. . Configure the annotation values: + diff --git a/modules/administration-guide/partials/snip_mounting-a-secret-or-a-configmap-into-a-container.adoc b/modules/administration-guide/partials/snip_mounting-a-secret-or-a-configmap-into-a-container.adoc index e326fa844e..fd3943cad7 100644 --- a/modules/administration-guide/partials/snip_mounting-a-secret-or-a-configmap-into-a-container.adoc +++ b/modules/administration-guide/partials/snip_mounting-a-secret-or-a-configmap-into-a-container.adoc @@ -13,7 +13,7 @@ + * The `` corresponds to the one following deployments: -** `keycloak` +** `{prod-deployment}-dashboard` ** `devfile-registry` ** `plugin-registry` ** `{prod-deployment}` From b463845c8b5252483490ea3e5ada9661d946b629 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 22 Nov 2023 09:31:59 +0100 Subject: [PATCH 2/8] fixup Signed-off-by: Anatolii Bazko --- modules/administration-guide/nav.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/administration-guide/nav.adoc b/modules/administration-guide/nav.adoc index b1312d9fae..9c1c6fdd81 100644 --- a/modules/administration-guide/nav.adoc +++ b/modules/administration-guide/nav.adoc @@ -64,6 +64,7 @@ *** xref:configuring-storage-sizes.adoc[] ** xref:configuring-dashboard.adoc[] *** xref:configuring-getting-started-samples.adoc[] +*** xref:customizing-openshift-che-consolelink.adoc[] ** xref:managing-identities-and-authorizations.adoc[] *** xref:configuring-oauth-for-git-providers.adoc[] **** xref:configuring-oauth-2-for-github.adoc[] From 569560bf0309c8d91f6c85818bc7a3237e099d6f Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 22 Nov 2023 11:46:59 +0100 Subject: [PATCH 3/8] Update modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc Co-authored-by: Jana Vrbkova --- ...g-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc index 56317d24e3..fd10105352 100644 --- a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc +++ b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc @@ -90,7 +90,7 @@ data: This results in a file named `ca.crt` being mounted at the `/data` path of {prod-short} container. -IMPORTANT: To make the changes in a {prod-short} container visible, recreate the object entirely. +IMPORTANT: To make the changes in a {prod-short} container visible, re-create the object entirely. .Additional resources From 81d0b167499b6b2c90dd181219f936dcd1cf1ee1 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 22 Nov 2023 11:47:05 +0100 Subject: [PATCH 4/8] Update modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc Co-authored-by: Jana Vrbkova --- ...g-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc index fd10105352..e081869e1d 100644 --- a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc +++ b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc @@ -51,7 +51,7 @@ metadata: ---- ==== -The {orch-name} object can contain several items whose names must match the desired file name mounted into the container. +The {orch-name} object can contain several items whose names must match the file name mounted into the container. .Example: ==== From 14ccff0952b2e6007564fcfd3a3c97bef28e3e09 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 22 Nov 2023 17:25:45 +0100 Subject: [PATCH 5/8] Update modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc Co-authored-by: Ilya Buziuk --- .../pages/customizing-openshift-che-consolelink.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc b/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc index 4c43ebdbd7..daaa85ffb8 100644 --- a/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc +++ b/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc @@ -1,5 +1,5 @@ :_content-type: PROCEDURE -:description: Customizing OpenShift Eclipse Che ConsoleLink +:description: Customizing OpenShift Eclipse Che ConsoleLink icon :keywords: administration guide, customizing, consolelink :navtitle: Customizing OpenShift Eclipse Che ConsoleLink :page-aliases: installation-guide:customizing-openshift-che-consolelink.adoc From 6c80d2863dbd05d45c9cd3499603dd7637ceb811 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 22 Nov 2023 17:25:54 +0100 Subject: [PATCH 6/8] Update modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc Co-authored-by: Ilya Buziuk --- .../pages/customizing-openshift-che-consolelink.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc b/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc index daaa85ffb8..b7bf602d3c 100644 --- a/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc +++ b/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc @@ -1,7 +1,7 @@ :_content-type: PROCEDURE :description: Customizing OpenShift Eclipse Che ConsoleLink icon :keywords: administration guide, customizing, consolelink -:navtitle: Customizing OpenShift Eclipse Che ConsoleLink +:navtitle: Customizing OpenShift Eclipse Che ConsoleLink icon :page-aliases: installation-guide:customizing-openshift-che-consolelink.adoc [id="customizing-openshift-che-consolelink"] From 883fd760f15a43f977e5e252d7844a7deb75d4fe Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Wed, 22 Nov 2023 17:26:03 +0100 Subject: [PATCH 7/8] Update modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc Co-authored-by: Ilya Buziuk --- .../pages/customizing-openshift-che-consolelink.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc b/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc index b7bf602d3c..df8600f124 100644 --- a/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc +++ b/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc @@ -5,7 +5,7 @@ :page-aliases: installation-guide:customizing-openshift-che-consolelink.adoc [id="customizing-openshift-che-consolelink"] -= Customizing {ocp} {prod} ConsoleLink += Customizing {ocp} {prod} ConsoleLink icon This procedure describes how to customize {prod} ConsoleLink. From dbd58dd4855964bfb88bfcc017fb2e992122c67f Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Thu, 23 Nov 2023 10:58:09 +0100 Subject: [PATCH 8/8] Address remarks Signed-off-by: Anatolii Bazko --- modules/administration-guide/nav.adoc | 2 +- .../pages/configuring-dashboard.adoc | 2 +- ...izing-openshift-che-consolelink-icon.adoc} | 12 ++++++--- ...-configmap-as-a-file-into-a-container.adoc | 14 +++++----- ...nfigmap-as-a-subpath-into-a-container.adoc | 14 +++++----- ...environment-variable-into-a-container.adoc | 26 ++++++++++--------- 6 files changed, 40 insertions(+), 30 deletions(-) rename modules/administration-guide/pages/{customizing-openshift-che-consolelink.adoc => customizing-openshift-che-consolelink-icon.adoc} (66%) diff --git a/modules/administration-guide/nav.adoc b/modules/administration-guide/nav.adoc index 9c1c6fdd81..3ace172f32 100644 --- a/modules/administration-guide/nav.adoc +++ b/modules/administration-guide/nav.adoc @@ -64,7 +64,7 @@ *** xref:configuring-storage-sizes.adoc[] ** xref:configuring-dashboard.adoc[] *** xref:configuring-getting-started-samples.adoc[] -*** xref:customizing-openshift-che-consolelink.adoc[] +*** xref:customizing-openshift-che-consolelink-icon.adoc[] ** xref:managing-identities-and-authorizations.adoc[] *** xref:configuring-oauth-for-git-providers.adoc[] **** xref:configuring-oauth-2-for-github.adoc[] diff --git a/modules/administration-guide/pages/configuring-dashboard.adoc b/modules/administration-guide/pages/configuring-dashboard.adoc index f6c4f8ae73..db942a92a0 100644 --- a/modules/administration-guide/pages/configuring-dashboard.adoc +++ b/modules/administration-guide/pages/configuring-dashboard.adoc @@ -9,5 +9,5 @@ * xref:configuring-getting-started-samples.adoc[] -* xref:customizing-openshift-che-consolelink.adoc[] +* xref:customizing-openshift-che-consolelink-icon.adoc[] diff --git a/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc b/modules/administration-guide/pages/customizing-openshift-che-consolelink-icon.adoc similarity index 66% rename from modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc rename to modules/administration-guide/pages/customizing-openshift-che-consolelink-icon.adoc index df8600f124..b9bfbab583 100644 --- a/modules/administration-guide/pages/customizing-openshift-che-consolelink.adoc +++ b/modules/administration-guide/pages/customizing-openshift-che-consolelink-icon.adoc @@ -1,13 +1,13 @@ :_content-type: PROCEDURE :description: Customizing OpenShift Eclipse Che ConsoleLink icon -:keywords: administration guide, customizing, consolelink +:keywords: administration guide, customizing, consolelink, icon :navtitle: Customizing OpenShift Eclipse Che ConsoleLink icon -:page-aliases: installation-guide:customizing-openshift-che-consolelink.adoc +:page-aliases: installation-guide:customizing-openshift-che-consolelink-icon.adoc -[id="customizing-openshift-che-consolelink"] +[id="customizing-openshift-che-consolelink-icon"] = Customizing {ocp} {prod} ConsoleLink icon -This procedure describes how to customize {prod} ConsoleLink. +This procedure describes how to customize {prod} link:https://docs.openshift.com/container-platform/{ocp4-ver}/rest_api/console_apis/consolelink-console-openshift-io-v1.html[ConsoleLink] icon. .Prerequisites @@ -39,3 +39,7 @@ EOF <1> Base64 encoding with disabled line wrapping. . Wait until the rollout of {prod-deployment}-dashboard finishes. + +.Additional resources + +* link:https://docs.openshift.com/container-platform/{ocp4-ver}/web_console/customizing-the-web-console.html#creating-custom-links_customizing-web-console[Creating custom links in the web console] \ No newline at end of file diff --git a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-file-into-a-container.adoc b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-file-into-a-container.adoc index 0a9af35ad0..49840b81bf 100644 --- a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-file-into-a-container.adoc +++ b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-file-into-a-container.adoc @@ -15,16 +15,14 @@ include::partial$snip_mounting-a-secret-or-a-configmap-into-a-container.adoc[leveloffset=+1] -Annotations must indicate that the given object is mounted as a file. - -. Configure the annotation values: +. Configure the annotation values. Annotations must indicate that the given object is mounted as a file: + * `che.eclipse.org/mount-as: file` - To indicate that a object is mounted as a file. * `che.eclipse.org/mount-path: __` - To provide a required mount path. .Example: ==== -[source,yaml] +[source,yaml,subs="+quotes,attributes"] ---- apiVersion: v1 kind: Secret @@ -34,10 +32,12 @@ metadata: che.eclipse.org/mount-as: file che.eclipse.org/mount-path: /data labels: + app.kubernetes.io/part-of: che.eclipse.org + app.kubernetes.io/component: {prod-deployment}-secret ... ---- or -[source,yaml] +[source,yaml,subs="+quotes,attributes"] ---- apiVersion: v1 kind: ConfigMap @@ -47,6 +47,8 @@ metadata: che.eclipse.org/mount-as: file che.eclipse.org/mount-path: /data labels: + app.kubernetes.io/part-of: che.eclipse.org + app.kubernetes.io/component: {prod-deployment}-configmap ... ---- ==== @@ -90,7 +92,7 @@ data: This results in a file named `ca.crt` being mounted at the `/data` path of {prod-short} container. -IMPORTANT: To make the changes in a {prod-short} container visible, recreate the object entirely. +IMPORTANT: To make the changes in a {prod-short} container visible, re-create the Secret or the ConfigMap object entirely. .Additional resources diff --git a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc index e081869e1d..169c0401b7 100644 --- a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc +++ b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-a-subpath-into-a-container.adoc @@ -15,16 +15,14 @@ include::partial$snip_mounting-a-secret-or-a-configmap-into-a-container.adoc[leveloffset=+1] -Annotations must indicate that the given object is mounted as a subPath. - -. Configure the annotation values: +. Configure the annotation values. Annotations must indicate that the given object is mounted as a subPath.: + * `che.eclipse.org/mount-as: subpath` - To indicate that an object is mounted as a subPath. * `che.eclipse.org/mount-path: __` - To provide a required mount path. .Example: ==== -[source,yaml] +[source,yaml,subs="+quotes,attributes"] ---- apiVersion: v1 kind: Secret @@ -34,10 +32,12 @@ metadata: che.eclipse.org/mount-as: subpath che.eclipse.org/mount-path: /data labels: + app.kubernetes.io/part-of: che.eclipse.org + app.kubernetes.io/component: {prod-deployment}-secret ... ---- or -[source,yaml] +[source,yaml,subs="+quotes,attributes"] ---- apiVersion: v1 kind: ConfigMap @@ -47,6 +47,8 @@ metadata: che.eclipse.org/mount-as: subpath che.eclipse.org/mount-path: /data labels: + app.kubernetes.io/part-of: che.eclipse.org + app.kubernetes.io/component: {prod-deployment}-configmap ... ---- ==== @@ -90,7 +92,7 @@ data: This results in a file named `ca.crt` being mounted at the `/data` path of {prod-short} container. -IMPORTANT: To make the changes in a {prod-short} container visible, re-create the object entirely. +IMPORTANT: To make the changes in a {prod-short} container visible, re-create the Secret or the ConfigMap object entirely. .Additional resources diff --git a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-an-environment-variable-into-a-container.adoc b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-an-environment-variable-into-a-container.adoc index 4f43713ac6..f0a1820e53 100644 --- a/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-an-environment-variable-into-a-container.adoc +++ b/modules/administration-guide/partials/proc_mounting-a-secret-or-a-configmap-as-an-environment-variable-into-a-container.adoc @@ -15,16 +15,14 @@ include::partial$snip_mounting-a-secret-or-a-configmap-into-a-container.adoc[leveloffset=+1] -Annotations must indicate that the given object is mounted as an environment variable. - -. Configure the annotation values: +. Configure the annotation values. Annotations must indicate that the given object is mounted as an environment variable: + * `che.eclipse.org/mount-as: env` - to indicate that a object is mounted as an environment variable * `che.eclipse.org/env-name: __` - to provide an environment variable name, which is required to mount a object key value .Example: ==== -[source,yaml] +[source,yaml,subs="+quotes,attributes"] ---- apiVersion: v1 kind: Secret @@ -34,12 +32,13 @@ metadata: che.eclipse.org/env-name: FOO_ENV che.eclipse.org/mount-as: env labels: - ... + app.kubernetes.io/part-of: che.eclipse.org + app.kubernetes.io/component: {prod-deployment}-secret data: mykey: myvalue ---- or -[source,yaml] +[source,yaml,subs="+quotes,attributes"] ---- apiVersion: v1 kind: ConfigMap @@ -49,7 +48,8 @@ metadata: che.eclipse.org/env-name: FOO_ENV che.eclipse.org/mount-as: env labels: - ... + app.kubernetes.io/part-of: che.eclipse.org + app.kubernetes.io/component: {prod-deployment}-configmap data: mykey: myvalue ---- @@ -67,7 +67,7 @@ If the object provides more than one data item, the environment variable name mu .Example: ==== -[source,yaml] +[source,yaml,subs="+quotes,attributes"] ---- apiVersion: v1 kind: Secret @@ -78,13 +78,14 @@ metadata: che.eclipse.org/mykey_env-name: FOO_ENV che.eclipse.org/otherkey_env-name: OTHER_ENV labels: - ... + app.kubernetes.io/part-of: che.eclipse.org + app.kubernetes.io/component: {prod-deployment}-secret stringData: mykey: ____ otherkey: ____ ---- or -[source,yaml] +[source,yaml,subs="+quotes,attributes"] ---- apiVersion: v1 kind: ConfigMap @@ -95,7 +96,8 @@ metadata: che.eclipse.org/mykey_env-name: FOO_ENV che.eclipse.org/otherkey_env-name: OTHER_ENV labels: - ... + app.kubernetes.io/part-of: che.eclipse.org + app.kubernetes.io/component: {prod-deployment}-configmap data: mykey: ____ otherkey: ____ @@ -112,7 +114,7 @@ being provisioned into a {prod-short} container. NOTE: The maximum length of annotation names in a {orch-name} object is 63 characters, where 9 characters are reserved for a prefix that ends with `/`. This acts as a restriction for the maximum length of the key that can be used for the object. -IMPORTANT: To make the changes in a {prod-short} container visible, recreate the object entirely. +IMPORTANT: To make the changes in a {prod-short} container visible, re-create the Secret or the ConfigMap object entirely. .Additional resources