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 Router Sharding and mentions how to do so on existing instances or those about to be installed.

Prerequisites
  • The oc and chectl tool is available.

Procedure
  • For a new OperatorHub installation:

    1. Enter the Eclipse Che Cluster using OpenShift Container Platform and create CheCluster Custom Resource (CR). See, Creating an instance of the Eclipse Che Operator

    2. Set the following values in eclipse-che Custom Resource (CR):

      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 chectl installation:

    1. Configure the the chectl installation using:

      $ chectl server:deploy --che-operator-cr-patch-yaml=patch.yaml ...

      patch.yaml must contain the following:

      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 Che installation:

    1. Update eclipse-che CR using the kubectl tool:

      $ 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/cheServerRoute/domain",'\
      '"value": "<ingress domain>"}]'
      $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
      '[{"op": "replace", "path": "/spec/server/pluginRegistryRoute/labels", '\
      '"value": "<labels for a plugin registry route>"}]'
      $ 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/pluginRegistryRoute/domain", '\
      '"value": "<ingress domain>"}]'
      $ 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/devfileRegistryRoute/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_LABELS", '\
      '"value": "<labels for a workspace routes>"}]'
      $ 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>"}]'