Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Customizing OpenShift Eclipse Che ConsoleLink #2666

Merged
merged 8 commits into from
Dec 4, 2023
1 change: 1 addition & 0 deletions modules/administration-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
= Configuring dashboard

* xref:configuring-getting-started-samples.adoc[]

* xref:customizing-openshift-che-consolelink.adoc[]

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
:_content-type: PROCEDURE
:description: Customizing OpenShift Eclipse Che ConsoleLink
tolusha marked this conversation as resolved.
Show resolved Hide resolved
:keywords: administration guide, customizing, consolelink
:navtitle: Customizing OpenShift Eclipse Che ConsoleLink
tolusha marked this conversation as resolved.
Show resolved Hide resolved
:page-aliases: installation-guide:customizing-openshift-che-consolelink.adoc

[id="customizing-openshift-che-consolelink"]
= Customizing {ocp} {prod} ConsoleLink
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tolusha just wondering if Red Hap Application dropdown menu is also using ConsoleLink object or is it called smth. differently?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, which dropdown menu we are talking about?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-11-17 at 15 41 16

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Red Hap Application dropdown menu is based on ConsoleLink objects

tolusha marked this conversation as resolved.
Show resolved Hide resolved

This procedure describes how to customize {prod} ConsoleLink.
tolusha marked this conversation as resolved.
Show resolved Hide resolved
tolusha marked this conversation as resolved.
Show resolved Hide resolved

.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 - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: {prod-deployment}-dashboard-customization
namespace: {prod-namespace}
annotations:
che.eclipse.org/mount-as: subpath
che.eclipse.org/mount-path: /public/dashboard/assets/branding
labels:
app.kubernetes.io/component: {prod-deployment}-dashboard-secret
app.kubernetes.io/part-of: che.eclipse.org
data:
loader.svg: __<Base64_encoded_content_of_the_image>__ <1>
type: Opaque
EOF
----
<1> Base64 encoding with disabled line wrapping.

. Wait until the rollout of {prod-deployment}-dashboard finishes.
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Original file line number Diff line number Diff line change
@@ -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: _<TARGET_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:
tolusha marked this conversation as resolved.
Show resolved Hide resolved
...
----
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 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: __<base64 encoded data content here>__
----
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: __<data content here>__
----
====

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.
tolusha marked this conversation as resolved.
Show resolved Hide resolved

.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[]

Original file line number Diff line number Diff line change
Expand Up @@ -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:
+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
+
* The `<DEPLOYMENT_NAME>` corresponds to the one following deployments:

** `keycloak`
** `{prod-deployment}-dashboard`
** `devfile-registry`
** `plugin-registry`
** `{prod-deployment}`
Expand Down