Configuring Kubernetes Ingress

By configuring labels and annotations for Kubernetes Ingress you can organize and categorize objects by scoping and selecting.

Prerequisites
  • The kubectl tool is available.

  • An instance of Che running in Kubernetes.

Procedure
  1. To configure labels for Kubernetes Ingress, update the Custom Resource:

    Use commas to separate labels: key1=value1,key2=value2.
    $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
    '[{"op": "replace", "path": "/spec/server/cheServerIngress/labels", '\
    '"value": "<labels for a che server ingress>"}]'
    
    $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
    '[{"op": "replace", "path": "/spec/auth/identityProviderIngress/labels", '\
    '"value": "<labels for a Keycloak ingress>"}]'
    
    $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
    '[{"op": "replace", "path": "/spec/server/pluginRegistryIngress/labels", '\
    '"value": "<labels for a plug-ins registry ingress>"}]'
    
    $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
    '[{"op": "replace", "path": "/spec/server/devfileRegistryIngress/labels",'\
    '"value": "<labels for a devfile registry ingress>"}]'
    
    $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
    '[{"op": "replace", "path": "/spec/server/dashboardIngress/labels",'\
    '"value": "<labels for a dashboard ingress>"}]'
    
    $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
    '[{"op": "replace", "path": "/spec/server/customCheProperties/CHE_INFRA_KUBERNETES_INGRESS_LABELS", '\
    '"value": "<labels for a workspace ingress>"}]'
  2. To configure annotations for Kubernetes Ingress, update the Custom Resource with the following commands:

    Use objects to specify annotations: {"key1": "value1", "key2" : "value2"}.
    $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
    '[{"op": "replace", "path": "/spec/server/cheServerIngress/annotations", '\
    '"value": <annotations for a che server ingress>}]'
    
    $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
    '[{"op": "replace", "path": "/spec/auth/identityProviderIngress/annotations", '\
    '"value": <annotations for a Keycloak ingress>}]'
    
    $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
    '[{"op": "replace", "path": "/spec/server/pluginRegistryIngress/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/devfileRegistryIngress/annotations",'\
    '"value": <annotations for a devfile registry ingress>}]'
    
    $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
    '[{"op": "replace", "path": "/spec/server/dashboardIngress/annotations",'\
    '"value": <annotations for a dashboard ingress>}]'
    
    $ kubectl patch checluster/eclipse-che -n eclipse-che --type=json -p \
    '[{"op": "replace", "path": "/spec/server/customCheProperties/CHE_INFRA_KUBERNETES_INGRESS_ANNOTATIONS__JSON", '\
    '"value": "<annotations for a workspace ingress in json format>"}]'