From 76b48fb0ceae160ace7ad1fbf3f12ee9c9afcc7e Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Fri, 5 Mar 2021 11:54:10 +0200 Subject: [PATCH 1/4] Configure labels and domains to work with router sharding Signed-off-by: Anatolii Bazko --- ...-openshift-oauth-without-initial-user.adoc | 18 +++++----- modules/installation-guide/nav.adoc | 2 +- .../pages/configuring-labels-for-routes.adoc | 7 ---- .../assembly_advanced-configuration.adoc | 2 +- .../proc_configuring-labels-for-routes.adoc | 35 ------------------- 5 files changed, 11 insertions(+), 53 deletions(-) delete mode 100644 modules/installation-guide/pages/configuring-labels-for-routes.adoc delete mode 100644 modules/installation-guide/partials/proc_configuring-labels-for-routes.adoc diff --git a/modules/administration-guide/partials/proc_configuring-openshift-oauth-without-initial-user.adoc b/modules/administration-guide/partials/proc_configuring-openshift-oauth-without-initial-user.adoc index 57550b683e..a6a46328ed 100644 --- a/modules/administration-guide/partials/proc_configuring-openshift-oauth-without-initial-user.adoc +++ b/modules/administration-guide/partials/proc_configuring-openshift-oauth-without-initial-user.adoc @@ -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"] ---- @@ -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"] ---- diff --git a/modules/installation-guide/nav.adoc b/modules/installation-guide/nav.adoc index d6e950863a..8b1a31c571 100644 --- a/modules/installation-guide/nav.adoc +++ b/modules/installation-guide/nav.adoc @@ -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[] diff --git a/modules/installation-guide/pages/configuring-labels-for-routes.adoc b/modules/installation-guide/pages/configuring-labels-for-routes.adoc deleted file mode 100644 index 4e0230bc4e..0000000000 --- a/modules/installation-guide/pages/configuring-labels-for-routes.adoc +++ /dev/null @@ -1,7 +0,0 @@ -[id="configuring-labels-for-routes"] -// = Configuring Labels -:navtitle: Configuring labels for OpenShift Route -:keywords: installation-guide, configuring-labels -:page-aliases: .:configuring-labels-for-routes - -include::partial$proc_configuring-labels-for-routes.adoc[] diff --git a/modules/installation-guide/partials/assembly_advanced-configuration.adoc b/modules/installation-guide/partials/assembly_advanced-configuration.adoc index 0a3b99c5e4..0146dece66 100644 --- a/modules/installation-guide/partials/assembly_advanced-configuration.adoc +++ b/modules/installation-guide/partials/assembly_advanced-configuration.adoc @@ -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[] diff --git a/modules/installation-guide/partials/proc_configuring-labels-for-routes.adoc b/modules/installation-guide/partials/proc_configuring-labels-for-routes.adoc deleted file mode 100644 index 26b0c86195..0000000000 --- a/modules/installation-guide/partials/proc_configuring-labels-for-routes.adoc +++ /dev/null @@ -1,35 +0,0 @@ - -[id="configuring-labels-for-routes_{context}"] -= Configuring labels for OpenShift Route - -This procedure describes how to configure labels for OpenShift Route to organize and categorize (scope and select) objects. - -.Prerequisites - -* The `{orch-cli}` tool is available. -* An instance of {prod-short} running in OpenShift. - -IMPORTANT: Use comma to separate labels: `key1=value1,key2=value2` - -.Procedure - -. To configure labels for OpenShift Route update the Custom Resource with the following commands: -+ -[subs="+quotes,+attributes"] ----- -$ {orch-cli} patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \ -'[{"op": "replace", "path": "/spec/server/cheServerRoute/labels",'\ -'"value": "____"}]' - -$ {orch-cli} patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \ -'[{"op": "replace", "path": "/spec/auth/identityProviderRoute/labels", '\ -'"value": "____"}]' - -$ {orch-cli} patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \ -'[{"op": "replace", "path": "/spec/server/pluginRegistryRoute/labels", '\ -'"value": "____"}]' - -$ {orch-cli} patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \ -'[{"op": "replace", "path": "/spec/server/devfileRegistryRoute/labels", '\ -'"value": "____"}]' ----- From 5c956c0915f356a3ce4aafc926ddf26fc14b4068 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Tue, 9 Mar 2021 09:09:32 +0200 Subject: [PATCH 2/4] Add missing files Signed-off-by: Anatolii Bazko --- ...iguring-labels-and-domains-for-routes.adoc | 7 + ...iguring-labels-and-domains-for-routes.adoc | 137 ++++++++++++++++++ 2 files changed, 144 insertions(+) create mode 100644 modules/installation-guide/pages/configuring-labels-and-domains-for-routes.adoc create mode 100644 modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc diff --git a/modules/installation-guide/pages/configuring-labels-and-domains-for-routes.adoc b/modules/installation-guide/pages/configuring-labels-and-domains-for-routes.adoc new file mode 100644 index 0000000000..d7460e28d6 --- /dev/null +++ b/modules/installation-guide/pages/configuring-labels-and-domains-for-routes.adoc @@ -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[] diff --git a/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc b/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc new file mode 100644 index 0000000000..5db2be6267 --- /dev/null +++ b/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc @@ -0,0 +1,137 @@ + +[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]. + +.Prerequisites + +* The `oc` tool is available. + +.Procedure + +. When OperatorHub is used to deploy {prod-short} then set the following values in {prod-checluster} Custom Resource (CR): ++ +[source,yaml,subs="+quotes"] +---- +spec: + server: + devfileRegistryRoute: + labels: <1> + domain: <2> + pluginRegistryRoute: + labels: <1> + domain: <2> + cheServerRoute: + labels: <1> + domain: <2> + customCheProperties: + CHE_INFRA_OPENSHIFT_ROUTE_LABELS: <1> + CHE_INFRA_OPENSHIFT_ROUTE_HOST_DOMAIN__SUFFIX: <2> + auth: + identityProviderRoute: + labels: <1> + 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 + ++ +. 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"] +---- +spec: + server: + devfileRegistryRoute: + labels: <1> + domain: <2> + pluginRegistryRoute: + labels: <1> + domain: <2> + cheServerRoute: + labels: <1> + domain: <2> + customCheProperties: + CHE_INFRA_OPENSHIFT_ROUTE_LABELS: <1> + CHE_INFRA_OPENSHIFT_ROUTE_HOST_DOMAIN__SUFFIX: <2> + auth: + identityProviderRoute: + labels: <1> + 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 + ++ +. When {prod-short} is already deployed in the OpenShift cluster then use the following commands: ++ +[subs="+quotes,+attributes"] +---- +$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \ +'[{"op": "replace", "path": "/spec/server/cheServerRoute/labels",'\ +'"value": "____"}]' +---- ++ +[subs="+quotes,+attributes"] +---- +$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \ +'[{"op": "replace", "path": "/spec/server/cheServerRoute/domain",'\ +'"value": "____"}]' +---- ++ +[subs="+quotes,+attributes"] +---- +$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \ +'[{"op": "replace", "path": "/spec/server/pluginRegistryRoute/labels", '\ +'"value": "____"}]' +---- ++ +[subs="+quotes,+attributes"] +---- +$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \ +'[{"op": "replace", "path": "/spec/auth/identityProviderRoute/domain", '\ +'"value": "____"}]' +---- ++ +[subs="+quotes,+attributes"] +---- +$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \ +'[{"op": "replace", "path": "/spec/server/pluginRegistryRoute/domain", '\ +'"value": "____"}]' +---- ++ +[subs="+quotes,+attributes"] +---- +$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \ +'[{"op": "replace", "path": "/spec/server/devfileRegistryRoute/labels", '\ +'"value": "____"}]' +---- ++ +[subs="+quotes,+attributes"] +---- +$ oc patch checluster {prod-checluster} -n {prod-namespace} --type=json -p \ +'[{"op": "replace", "path": "/spec/server/devfileRegistryRoute/domain", '\ +'"value": "____"}]' +---- ++ +[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": "____"}]' +---- ++ +[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": "____"}]' +---- From d4a19b2f3096c040963d695cc08ecfdd3fa0a6df Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Thu, 11 Mar 2021 14:59:36 +0200 Subject: [PATCH 3/4] improvements Signed-off-by: Anatolii Bazko --- ...configuring-labels-and-domains-for-routes.adoc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc b/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc index 5db2be6267..bfb4549864 100644 --- a/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc +++ b/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc @@ -2,7 +2,7 @@ [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]. +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 @@ -10,7 +10,12 @@ This procedure describes how to configure labels and domains for OpenShift Route .Procedure -. When OperatorHub is used to deploy {prod-short} then set the following values in {prod-checluster} Custom Resource (CR): +* 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"] ---- @@ -36,8 +41,9 @@ spec: <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: + -. When `{prod-cli}` tool is used to deploy {prod-short} then use `--che-operator-cr-patch-yaml` flag: +. Configure the the `{prod-cli}` installation using: + [subs="+quotes,+attributes"] ---- @@ -70,8 +76,9 @@ spec: <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: + -. When {prod-short} is already deployed in the OpenShift cluster then use the following commands: +. Update `{prod-checluster}` CR using the `{orch-cli}` tool: + [subs="+quotes,+attributes"] ---- From 86e7a661b7e642398fb7eeb95da9d7e54286fee2 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Thu, 11 Mar 2021 15:01:24 +0200 Subject: [PATCH 4/4] Fix Signed-off-by: Anatolii Bazko --- .../proc_configuring-labels-and-domains-for-routes.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc b/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc index bfb4549864..762153c7fb 100644 --- a/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc +++ b/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc @@ -6,7 +6,7 @@ This procedure describes how to configure labels and domains for OpenShift Route .Prerequisites -* The `oc` tool is available. +* The `oc` and `{prod-cli}` tool is available. .Procedure