Skip to content

Commit

Permalink
Configure labels and domains to work with router sharding (#1887)
Browse files Browse the repository at this point in the history
* Configure labels and domains to work with router sharding

Signed-off-by: Anatolii Bazko <abazko@redhat.com>

* Add missing files

Signed-off-by: Anatolii Bazko <abazko@redhat.com>

* improvements

Signed-off-by: Anatolii Bazko <abazko@redhat.com>

* Fix

Signed-off-by: Anatolii Bazko <abazko@redhat.com>

Co-authored-by: Fabrice Flore-Thébault <ffloreth@redhat.com>
Co-authored-by: Michal Maléř <48474054+MichalMaler@users.noreply.github.com>
  • Loading branch information
3 people committed Mar 16, 2021
1 parent cfad5d3 commit 023993e
Show file tree
Hide file tree
Showing 7 changed files with 162 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@ The following procedure describes how to configure OpenShift OAuth without provi

.Procedure

. Deploy and update {prod-short} instance using OperatorHub and wait for the process to finish:
+
[subs="+quotes,+attributes"]
----
$ {prod-cli} server:deploy --che-operator-cr-patch-yaml=patch.yaml ...
----
+
`patch.yaml` must contain the following:
. When OperatorHub is used to deploy {prod-short} then set the following values in {prod-checluster} Custom Resource (CR):
+
[source,yaml,subs="+quotes"]
----
Expand All @@ -26,7 +19,14 @@ spec:
initialOpenShiftOAuthUser: ''
----
+
. Set the following values in {prod-checluster} Custom Resource (CR):
. When `{prod-cli}` tool is used to deploy {prod-short} then use `--che-operator-cr-patch-yaml` flag:
+
[subs="+quotes,+attributes"]
----
$ {prod-cli} server:deploy --che-operator-cr-patch-yaml=patch.yaml ...
----
+
`patch.yaml` must contain the following:
+
[source,yaml,subs="+quotes"]
----
Expand Down
2 changes: 1 addition & 1 deletion modules/installation-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
** xref:configuring-workspaces-nodeselector.adoc[]
** xref:configuring-che-hostname.adoc[]
** xref:configuring-labels-for-ingresses.adoc[]
** xref:configuring-labels-for-routes.adoc[]
** xref:configuring-labels-and-domains-for-routes.adoc[]
** xref:deploying-che-with-support-for-git-repositories-with-self-signed-certificates.adoc[]
** xref:installing-che-using-storage-classes.adoc[]
** xref:importing-untrusted-tls-certificates.adoc[]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[id="configuring-labels-and-domains-for-routes"]
// = Configuring Labels
:navtitle: Configuring labels and domains for OpenShift Route
:keywords: installation-guide, configuring-labels, configuring-domains
:page-aliases: .:configuring-labels-and-domains-for-routes

include::partial$proc_configuring-labels-and-domains-for-routes.adoc[]

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The next sections describe some specific user stories.

* xref:configuring-labels-for-ingresses.adoc[]

* xref:configuring-labels-for-routes.adoc[]
* xref:configuring-labels-and-domains-for-routes.adoc[]

* xref:deploying-che-with-support-for-git-repositories-with-self-signed-certificates.adoc[]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@

[id="configuring-labels-for-routes_{context}"]
= Configuring labels and domains for OpenShift Route to work with Router Sharding

This procedure describes how to configure labels and domains for OpenShift Route to work with link:https://docs.openshift.com/container-platform/4.7/networking/ingress-operator.html#nw-ingress-sharding_configuring-ingress[Router Sharding] and mentions how to do so on existing instances or those about to be installed.

.Prerequisites

* The `oc` and `{prod-cli}` tool is available.

.Procedure

* For a new OperatorHub installation:
+
. Enter the {prod} Cluster using {ocp} and create CheCluster Custom Resource (CR). See, xref:installing-che-on-openshift-4-using-operatorhub#creating-an-instance-of-the-{prod-id-short}-operator_{context}[Creating an instance of the {prod} Operator]

+
. Set the following values in {prod-checluster} Custom Resource (CR):
+
[source,yaml,subs="+quotes"]
----
spec:
server:
devfileRegistryRoute:
labels: <labels> <1>
domain: <domain> <2>
pluginRegistryRoute:
labels: <labels> <1>
domain: <domain> <2>
cheServerRoute:
labels: <labels> <1>
domain: <domain> <2>
customCheProperties:
CHE_INFRA_OPENSHIFT_ROUTE_LABELS: <labels> <1>
CHE_INFRA_OPENSHIFT_ROUTE_HOST_DOMAIN__SUFFIX: <domain> <2>
auth:
identityProviderRoute:
labels: <labels> <1>
domain: <domain> <2>
----
<1> comma separated list of labels that are used by the target ingress controller to filter the set of Routes to service
<2> DNS name serviced by the target ingress controller

* For a new `{prod-cli}` installation:
+
. Configure the the `{prod-cli}` installation using:
+
[subs="+quotes,+attributes"]
----
$ {prod-cli} server:deploy --che-operator-cr-patch-yaml=patch.yaml ...
----
+
`patch.yaml` must contain the following:
+
[source,yaml,subs="+quotes"]
----
spec:
server:
devfileRegistryRoute:
labels: <labels> <1>
domain: <domain> <2>
pluginRegistryRoute:
labels: <labels> <1>
domain: <domain> <2>
cheServerRoute:
labels: <labels> <1>
domain: <domain> <2>
customCheProperties:
CHE_INFRA_OPENSHIFT_ROUTE_LABELS: <labels> <1>
CHE_INFRA_OPENSHIFT_ROUTE_HOST_DOMAIN__SUFFIX: <domain> <2>
auth:
identityProviderRoute:
labels: <labels> <1>
domain: <domain> <2>
----
<1> comma separated list of labels that are used by the target ingress controller to filter the set of Routes to service
<2> DNS name serviced by the target ingress controller

* For already existing {prod-short} installation:
+
. Update `{prod-checluster}` CR using the `{orch-cli}` tool:
+
[subs="+quotes,+attributes"]
----
$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \
'[{"op": "replace", "path": "/spec/server/cheServerRoute/labels",'\
'"value": "__<labels for a {prod-id-short} server route>__"}]'
----
+
[subs="+quotes,+attributes"]
----
$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \
'[{"op": "replace", "path": "/spec/server/cheServerRoute/domain",'\
'"value": "__<ingress domain>__"}]'
----
+
[subs="+quotes,+attributes"]
----
$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \
'[{"op": "replace", "path": "/spec/server/pluginRegistryRoute/labels", '\
'"value": "__<labels for a plugin registry route>__"}]'
----
+
[subs="+quotes,+attributes"]
----
$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \
'[{"op": "replace", "path": "/spec/auth/identityProviderRoute/domain", '\
'"value": "__<ingress domain>__"}]'
----
+
[subs="+quotes,+attributes"]
----
$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \
'[{"op": "replace", "path": "/spec/server/pluginRegistryRoute/domain", '\
'"value": "__<ingress domain>__"}]'
----
+
[subs="+quotes,+attributes"]
----
$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \
'[{"op": "replace", "path": "/spec/server/devfileRegistryRoute/labels", '\
'"value": "__<labels for a devfile registry route>__"}]'
----
+
[subs="+quotes,+attributes"]
----
$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \
'[{"op": "replace", "path": "/spec/server/devfileRegistryRoute/domain", '\
'"value": "__<ingress domain>__"}]'
----
+
[subs="+quotes,+attributes"]
----
$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \
'[{"op": "replace", "path": "/spec/server/customCheProperties/CHE_INFRA_OPENSHIFT_ROUTE_LABELS", '\
'"value": "__<labels for a workspace routes>__"}]'
----
+
[subs="+quotes,+attributes"]
----
$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \
'[{"op": "replace", "path": "/spec/server/customCheProperties/CHE_INFRA_OPENSHIFT_ROUTE_HOST_DOMAIN______SUFFIX", '\
'"value": "__<ingress domain>__"}]'
----

This file was deleted.

0 comments on commit 023993e

Please sign in to comment.