1.17.2. 問題の解決: ローカルクラスターが選択されていない問題のトラブルシューティング
この問題を解決するには、local-cluster namespace に deployable 管理パーミッションを付与する必要があります。以下の手順を実行してください。
マネージドクラスターのリストに
local-clusterが含まれ、配置ルールのdecisionsリストにローカルクラスターが表示されないことを確認します。以下のコマンドを実行して結果を表示します。% oc get managedclustersNAME HUB ACCEPTED MANAGED CLUSTER URLS JOINED AVAILABLE AGE local-cluster true True True 56d cluster1 true True True 16hapiVersion: apps.open-cluster-management.io/v1 kind: PlacementRule metadata: name: all-ready-clusters namespace: default spec: clusterSelector: {} status: decisions: - clusterName: cluster1 clusterNamespace: cluster1.yamlファイルにRoleを作成し、local-clusternamespace に deployable 管理パーミッションを付与します。以下の例を参照してください。apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: deployables-admin-user-zisis namespace: local-cluster rules: - apiGroups: - apps.open-cluster-management.io resources: - deployables verbs: - '*'RoleBindingリソースを作成し、配置ルールユーザーにlocal-clusternamespace へのアクセスを許可します。以下の例を参照してください。apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: deployables-admin-user-zisis namespace: local-cluster roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: deployables-admin-user-zisis namespace: local-cluster subjects: - kind: User name: zisis apiGroup: rbac.authorization.k8s.io