Configuring OpenShift Route to work with Router Sharding
This procedure describes how to configure labels, annotations, and domains for OpenShift Route to work with Router Sharding. The chapter then mentions the configuration process for existing instances or those about to be installed.
-
The
oc
andchectl
tool is available.
-
For a new OperatorHub installation:
-
Enter the Che Cluster using OpenShift Container Platform and create CheCluster Custom Resource (CR). See, Creating an instance of the Eclipse Che Operator
-
Set the following values in eclipse-che Custom Resource (CR):
spec: server: devfileRegistryRoute: labels: <labels> (1) domain: <domain> (2) annotations: (3) key1: value1 key2: value2 pluginRegistryRoute: labels: <labels> (1) domain: <domain> (2) annotations: (3) key1: value1 key2: value2 dashboardRoute: labels: <labels> (1) domain: <domain> (2) annotations: (3) key1: value1 key2: value2 cheServerRoute: labels: <labels> (1) domain: <domain> (2) annotations: (3) key1: value1 key2: value2 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) annotations: (3) key1: value1 key2: value2
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 3 unstructured key value map stored with a resource
-
-
For a new
chectl
installation:-
Configure the installation using:
$ chectl server:deploy --che-operator-cr-patch-yaml=patch.yaml ...
The
patch.yaml
file must contain the following:spec: server: devfileRegistryRoute: labels: <labels> (1) domain: <domain> (2) annotations: (3) key1: value1 key2: value2 pluginRegistryRoute: labels: <labels> (1) domain: <domain> (2) annotations: (3) key1: value1 key2: value2 dashboardRoute: labels: <labels> (1) domain: <domain> (2) annotations: (3) key1: value1 key2: value2 cheServerRoute: labels: <labels> (1) domain: <domain> (2) annotations: (3) key1: value1 key2: value2 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) annotations: (3) key1: value1 key2: value2
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 3 unstructured key value map stored with a resource
-
-
For already existing Che installation:
-
Update
eclipse-che
CR using thekubectl
tool:-
To configure labels:
Use comma to separate labels: key1=value1,key2=value2
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/cheServerRoute/labels",'\ '"value": "<labels for a che server route>"}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/pluginRegistryRoute/labels", '\ '"value": "<labels for a plug-ins registry route>"}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/devfileRegistryRoute/labels", '\ '"value": "<labels for a devfile registry route>"}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/dashboardRoute/labels", '\ '"value": "<labels for a dashboard route>"}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/auth/identityProviderRoute/labels", '\ '"value": "<labels for a Keycloak route>"}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/customCheProperties/CHE_INFRA_OPENSHIFT_ROUTE_LABELS", '\ '"value": "<labels for a workspace routes>"}]'
-
To configure domains:
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/cheServerRoute/domain",'\ '"value": "<ingress domain>"}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/pluginRegistryRoute/domain", '\ '"value": "<ingress domain>"}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/devfileRegistryRoute/domain", '\ '"value": "<ingress domain>"}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/dashboardRoute/domain", '\ '"value": "<ingress domain>"}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/auth/identityProviderRoute/domain", '\ '"value": "<ingress domain>"}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/customCheProperties/CHE_INFRA_OPENSHIFT_ROUTE_HOST_DOMAIN__SUFFIX", '\ '"value": "<ingress domain>"}]'
-
To configure annotations:
Use object to specify annotations: {"key1": "value1", "key2" : "value2"}
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/cheServerRoute/annotations",'\ '"value": <annotations for a che ingress>}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/pluginRegistryRoute/annotations", '\ '"value": <annotations for a plug-ins registry ingress>}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/devfileRegistryRoute/annotations", '\ '"value": <annotations for a devfile registry ingress>}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/server/dashboardRoute/annotations", '\ '"value": <annotations for a dashboard ingress>}]'
$ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \ '[{"op": "replace", "path": "/spec/auth/identityProviderRoute/annotations", '\ '"value": <annotations for a Keycloak ingress>}]'
-
-