From 023993e57ad2870281d468ec3b10d0ac82b67613 Mon Sep 17 00:00:00 2001 From: Anatolii Bazko Date: Tue, 16 Mar 2021 18:22:54 +0200 Subject: [PATCH] Configure labels and domains to work with router sharding (#1887) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Configure labels and domains to work with router sharding Signed-off-by: Anatolii Bazko * Add missing files Signed-off-by: Anatolii Bazko * improvements Signed-off-by: Anatolii Bazko * Fix Signed-off-by: Anatolii Bazko Co-authored-by: Fabrice Flore-Thébault Co-authored-by: Michal Maléř <48474054+MichalMaler@users.noreply.github.com> --- ...-openshift-oauth-without-initial-user.adoc | 18 +-- modules/installation-guide/nav.adoc | 2 +- ...iguring-labels-and-domains-for-routes.adoc | 7 + .../pages/configuring-labels-for-routes.adoc | 7 - .../assembly_advanced-configuration.adoc | 2 +- ...iguring-labels-and-domains-for-routes.adoc | 144 ++++++++++++++++++ .../proc_configuring-labels-for-routes.adoc | 35 ----- 7 files changed, 162 insertions(+), 53 deletions(-) create mode 100644 modules/installation-guide/pages/configuring-labels-and-domains-for-routes.adoc delete mode 100644 modules/installation-guide/pages/configuring-labels-for-routes.adoc create mode 100644 modules/installation-guide/partials/proc_configuring-labels-and-domains-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 31ba5163e6..14d8bd103c 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-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/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 98670ee430..c8192bcb09 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-and-domains-for-routes.adoc b/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc new file mode 100644 index 0000000000..762153c7fb --- /dev/null +++ b/modules/installation-guide/partials/proc_configuring-labels-and-domains-for-routes.adoc @@ -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: <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 + +* 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: <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 + +* 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": "____"}]' +---- ++ +[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": "____"}]' +---- 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": "____"}]' -----