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

Configure labels and domains to work with router sharding #1887

Merged
merged 14 commits into from
Mar 16, 2021
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.