4.10. OpenShift ルートの設定
- この手順では、オブジェクトを整理して分類 (スコープおよび選択)するように、OpenShift Route のラベルを設定する方法を説明します。
前提条件
-
oc
ツールが利用できる。 - OpenShift で実行される CodeReady Workspaces のインスタンス。
手順
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>"}]'
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>"}]'