4.10. OpenShift ルートの設定

OpenShift Route のラベルおよびアノテーションを設定することで、オブジェクトをスコープ操作および選択することで編成し、分類できます。

前提条件

  • oc ツールが利用できる。
  • OpenShift で実行される CodeReady Workspaces のインスタンス。

手順

  1. OpenShift Route のラベルを設定するには、カスタムリソースを更新します。

    重要

    コンマを使用して、ラベルを区切ります(key1=value1,key2=value2)。

    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/server/cheServerIngress/labels", '\
    '"value": "<labels for a codeready-workspaces server ingress>"}]'
    
    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/auth/identityProviderIngress/labels", '\
    '"value": "<labels for a RH-SSO ingress>"}]'
    
    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/server/pluginRegistryIngress/labels", '\
    '"value": "<labels for a plug-ins registry ingress>"}]'
    
    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/server/devfileRegistryIngress/labels",'\
    '"value": "<labels for a devfile registry ingress>"}]'
    
    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/server/dashboardIngress/labels",'\
    '"value": "<labels for a dashboard ingress>"}]'
    
    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/server/customCheProperties/CHE_INFRA_KUBERNETES_INGRESS_LABELS", '\
    '"value": "<labels for a workspace ingress>"}]'
  2. OpenShift Route のアノテーションを設定するには、以下のコマンドを使用してカスタムリソースを更新します。

    重要

    オブジェクトを使用してアノテーションを指定します({"key1": "value1", "key2" : "value2"})。

    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/server/cheServerIngress/annotations", '\
    '"value": <annotations for a codeready-workspaces server ingress>}]'
    
    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/auth/identityProviderIngress/annotations", '\
    '"value": <annotations for a RH-SSO ingress>}]'
    
    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/server/pluginRegistryIngress/annotations", '\
    '"value": <annotations for a plug-ins registry ingress>}]'
    
    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/server/devfileRegistryIngress/annotations",'\
    '"value": <annotations for a devfile registry ingress>}]'
    
    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/server/dashboardIngress/annotations",'\
    '"value": <annotations for a dashboard ingress>}]'
    
    $ oc patch checluster/codeready-workspaces -n openshift-workspaces --type=json -p \
    '[{"op": "replace", "path": "/spec/server/customCheProperties/CHE_INFRA_KUBERNETES_INGRESS_ANNOTATIONS__JSON", '\
    '"value": "<annotations for a workspace ingress in json format>"}]'