1.7. ハブクラスターへのターゲットのマネージドクラスターのインポート
別の Kubernetes クラウドプロバイダーからクラスターをインポートできます。インポートすると、ターゲットクラスターは Red Hat Advanced Cluster Management for Kubernetes ハブクラスターのマネージドクラスターになります。指定されていない場合は、ハブクラスターとターゲットのマネージドクラスターにアクセスできる場所で、インポートタスクを実行します。
ハブクラスターは 他 のハブクラスターの管理はできず、自己管理のみが可能です。ハブクラスターは、自動的にインポートして自己管理できるように設定されています。ハブクラスターは手動でインポートする必要はありません。
ただし、ハブクラスターを削除して、もう一度インポートする場合は、local-cluster:true
ラベルを追加する必要があります。
コンソールまたは CLI からのマネージドクラスターの設定は、以下の手順から選択します。
必要なユーザータイプまたはアクセスレベル: クラスター管理者
1.7.1. コンソールを使用した既存クラスターのインポート
Red Hat Advanced Cluster Management for Kubernetes をインストールすると、管理するクラスターをインポートする準備が整います。コンソールと CLI の両方からインポートできます。
コンソールからインポートするには、以下の手順に従います。この手順では、認証用にターミナルが必要です。
1.7.1.1. 前提条件
- Red Hat Advanced Cluster Management for Kubernetes のハブクラスターをデプロイしている。ベアメタルクラスターをインポートする場合には、ハブクラスターを Red Hat OpenShift Container Platform バージョン 4.8 以降にインストールする必要があります。
- 管理するクラスターとインターネット接続が必要である。
-
kubectl
をインストールしておく必要がある。kubectl
のインストール手順は、Kubernetes ドキュメント の Install and Set Up kubectl を参照してください。 -
Base64
コマンドラインツールが必要である。 注意: OpenShift Container Platform によって作成されていないクラスターをインポートする場合は、
multiclusterhub.spec.imagePullSecret
を定義する必要があります。このシークレットは、Red Hat Advanced Cluster Management のインストール時に作成される場合があります。新しいものを作成する必要がある場合は、次の手順を実行します。
- cloud.redhat.com から Kubernetes プルシークレットをダウンロードします。
- プルシークレットをハブクラスターの namespace に追加します。
次のコマンドを実行して、ハブクラスターの namespace に新しいシークレットを作成します。
oc create secret generic pull-secret -n <open-cluster-management> --from-file=.dockerconfigjson=<path-to-pull-secret> --type=kubernetes.io/dockerconfigjson
open-cluster-management
をハブクラスターの namespace の名前に置き換えます。ハブクラスターのデフォルトの名前空間はopen-cluster-management
です。path-to-pull-secret
を、ダウンロードしたプルシークレットへのパスに置き換えます。シークレットは、インポート時にマネージドクラスターに自動的にコピーされます。
プルシークレットの詳細は、イメージプルシークレットの使用 または サービスアカウントの概要および作成 を参照してください。
このシークレットを定義する方法の詳細については、カスタムイメージプルシークレット を参照してください。
-
インポートするクラスターでエージェントが削除されていることを確認します。エラーを避けるために、
open-cluster-management-agent
およびopen-cluster-management-agent-addon
namespace を削除する必要があります。 Red Hat OpenShift Dedicated 環境にインポートする場合には、以下の注意点を参照してください。
- ハブクラスターを Red Hat OpenShift Dedicated 環境にデプロイしている必要があります。
-
Red Hat OpenShift Dedicated のデフォルトパーミッションは dedicated-admin ですが、namespace を作成するためのパーミッションがすべて含まれているわけではありません。Red Hat Advanced Cluster Management for Kubernetes でクラスターをインポートして管理するには
cluster-admin
パーミッションが必要です。
必要なユーザータイプまたはアクセスレベル: クラスター管理者
1.7.1.2. クラスターのインポート
利用可能なクラウドプロバイダーごとに、Red Hat Advanced Cluster Management for Kubernetes コンソールから既存のクラスターをインポートできます。
注記: ハブクラスターは別のハブクラスターを管理できません。ハブクラスターは、自動的にインポートおよび自己管理するように設定されるため、ハブクラスターを手動でインポートして自己管理する必要はありません。
- ナビゲーションメニューから Infrastructure > Clusters を選択します。
- マネージドクラスター タブで、Import cluster をクリックします。
- クラスターの名前を指定します。デフォルトで、namespace はクラスター名と namespace に使用されます。
重要: クラスターを作成すると、Red Hat Advanced Cluster Management コントローラーがクラスターとそのリソースの名前空間を作成します。その名前空間には、そのクラスターインスタンスのリソースのみを含めるようにしてください。クラスターを破棄すると、名前空間とその中のすべてのリソースが削除されます。
cluster-admin
権限が割り当てられた既存のクラスターセットに追加する場合には、クラスターセット を指定します。クラスターの作成時にcluster-admin
権限がない場合に、clusterset-admin
パーミッションがあるクラスターセットを選択する必要があります。指定されたクラスターセットに対して適切なパーミッションがないと、クラスターの作成に失敗します。選択するクラスターセットが存在しない場合は、クラスター管理者に連絡して、クラスターセットへのclusterset-admin
権限を受け取ってください。マネージドクラスターはすべて、マネージドクラスターセットに関連付けられている必要があります。マネージドクラスターを
ManagedClusterSet
に割り当てない場合は、デフォルト
のマネージドクラスターセットに自動的に追加されます。オプション: ラベル を追加します。
注記: Red Hat OpenShift Dedicated クラスターをインポートし、
vendor=OpenShiftDedicated
のラベルを追加してベンダーが指定されないようにする場合、またはvendor=auto-detect
のラベルを追加する場合は、managed-by=platform
ラベルがクラスターに自動的に追加されます。この追加ラベルを使用して、クラスターを Red Hat OpenShift Dedicated クラスターとして識別し、Red Hat OpenShift Dedicated クラスターをグループとして取得できます。以下のオプションからインポートするクラスター特定に使用する インポートモード を選択します。
import コマンドを手動で実行する: 指定した情報に基づいてコピーして実行できるインポートコマンドを生成します。Save import and generate code をクリックし、
open-cluster-management-agent-addon
のデプロイに使用するコマンドを生成します。確認メッセージが表示されます。Import an existing cluster ウィンドウで Copy command を選択し、生成されたコマンドおよびトークンをクリップボードにコピーします。
重要: コマンドには、インポートした各クラスターにコピーされるプルシークレット情報が含まれます。インポートしたクラスターにアクセスできるユーザーであれば誰でも、プルシークレット情報を表示することもできます。https://cloud.redhat.com/ で 2 つ目のプルシークレットを作成することを検討するか、サービスアカウントを作成して個人の認証情報を保護してください。
- インポートするマネージドクラスターにログインします。
Red Hat OpenShift Dedicated 環境のみ対象 : 以下の手順を実行します。
-
マネージドクラスターで
open-cluster-management-agent
およびopen-cluster-management
namespace またはプロジェクトを作成します。 - OpenShift Container Platform カタログで klusterlet Operator を検索します。
作成した
open-cluster-management
namespace またはプロジェクトにインストールします。重要:
open-cluster-management-agent
namespace に Operator をインストールしないでください。以下の手順を実行して、import コマンドからブートストラップシークレットを展開します。
import コマンドを生成します。
- Red Hat Advanced Cluster Management コンソールで、Infrastructure > Clusters を選択します。
- Add a cluster > Import an existing cluster を選択します。
- クラスター情報を追加し、Save import and generate code を選択します。
- import コマンドをコピーします。
-
import-command
という名前で作成したファイルに、import コマンドを貼り付けます。 以下のコマンドを実行して、新しいファイルにコンテンツを挿入します。
cat import-command | awk '{split($0,a,"&&"); print a[3]}' | awk '{split($0,a,"|"); print a[1]}' | sed -e "s/^ echo //" | base64 -d
-
出力で
bootstrap-hub-kubeconfig
という名前のシークレットを見つけ、コピーします。 -
シークレットをマネージドクラスターの
open-cluster-management-agent
namespace に適用します。 インストールした Operator の例を使用して klusterlet リソースを作成します。clusterName は、インポート中に設定されたクラスター名と同じ名前に変更する必要があります。
注記:
managedcluster
リソースがハブに正しく登録されると、2 つの klusterlet Operator がインストールされます。klusterlet Operator の 1 つはopen-cluster-management
namespace に、もう 1 つはopen-cluster-management-agent
namespace にあります。Operator が複数あっても klusterlet の機能には影響はありません。
-
マネージドクラスターで
Red Hat OpenShift Dedicated 環境に含まれていないクラスターのインポート: 以下の手順を実行します。
必要な場合は、マネージドクラスターの
kubectl
コマンドを設定します。kubectl
コマンドラインインターフェイスの設定方法は、サポート対象のプロバイダー を参照してください。-
マネージドクラスターに
open-cluster-management-agent-addon
をデプロイするには、コピーしたトークンでコマンドを実行します。
- View cluster をクリックして Overview ページのクラスターの概要を表示します。
- 既存のクラスターのサーバー URL および API トークンを入力する: インポートするクラスターの サーバー URL および API トークンを指定します。
-
kubeconfig: インポートしているクラスターの
kubeconfig
ファイルの内容をコピーし、貼り付けます。
オプション:
oc get managedcluster
コマンドを実行する際に、テーブルに表示される URL を設定して、クラスターの詳細ページにある Cluster API アドレス を設定します。-
cluster-admin
パーミッションがある ID でハブクラスターにログインします。 ターゲットのマネージドクラスターの
kubectl
を設定します。kubectl
の設定方法は、サポート対象のプロバイダー を参照してください。以下のコマンドを入力して、インポートしているクラスターのマネージドクラスターエントリーを編集します。
oc edit managedcluster <cluster-name>
cluster-name
は、マネージドクラスターの名前に置き換えます。以下の例のように、YAML ファイルの
ManagedCluster
仕様にmanageClusterClientConfigs
セクションを追加します。spec: hubAcceptsClient: true managedClusterClientConfigs: - url: https://multicloud-console.apps.new-managed.dev.redhat.com
URL の値を、インポートするマネージドクラスターへの外部アクセスを提供する URL に置き換えます。
-
クラスターがインポートされました。Import another を選択すると、さらにインポートできます。
1.7.1.3. インポートされたクラスターの削除
以下の手順を実行して、インポートされたクラスターと、マネージドクラスターで作成された open-cluster-management-agent-addon
を削除します。
Clusters ページで、Actions > Detach cluster をクリックしてマネージメントからクラスターを削除します。
注記: local-cluster
という名前のハブクラスターをデタッチしようとする場合は、デフォルトの disableHubSelfManagement
設定が false
である点に注意してください。この設定が原因で、ハブクラスターがデタッチされると、自身を再インポートして管理し、MultiClusterHub
コントローラーが調整されます。ハブクラスターがデタッチプロセスを完了して再インポートするのに時間がかかる場合があります。プロセスが終了するのを待たずにハブクラスターを再インポートする場合は、以下のコマンドを実行して multiclusterhub-operator
Pod を再起動して、再インポートの時間を短縮できます。
oc delete po -n open-cluster-management `oc get pod -n open-cluster-management | grep multiclusterhub-operator| cut -d' ' -f1`
disableHubSelfManagement
の値を true
に指定して、自動的にインポートされないように、ハブクラスターの値を変更できます。詳細は、disableHubSelfManagement トピックを参照してください。
1.7.2. CLI を使用したマネージドクラスターのインポート
Red Hat Advanced Cluster Management for Kubernetes をインストールすると、Red Hat OpenShift Container Platform CLI を使用して管理するクラスターをインポートする準備が整います。インポートしているクラスターの kubeconfig
ファイルを使用してクラスターをインポートするか、インポートしているクラスターで import コマンドを手動で実行できます。どちらの手順も文書化されています。
重要: ハブクラスターは別のハブクラスターを管理できません。ハブクラスターは、自動でインポートおよび自己管理するように設定されます。ハブクラスターは、手動でインポートして自己管理する必要はありません。
ただし、ハブクラスターを削除して、もう一度インポートする場合は、local-cluster:true
ラベルを追加する必要があります。
1.7.2.1. 前提条件
- Red Hat Advanced Cluster Management for Kubernetes のハブクラスターをデプロイしている。ベアメタルクラスターをインポートする場合は、ハブクラスターを Red Hat OpenShift Container Platform バージョン 4.6 以降にインストールする必要があります。
- インターネットに接続できる、管理する別のクラスターが必要です。
-
oc
コマンドを実行するには、Red Hat OpenShift Container Platform の CLI バージョン 4.6 以降が必要である。Red Hat OpenShift Container Platform CLI (oc
) のインストールおよび設定の詳細は、Getting started with the OpenShift CLI を参照してください。 Kubernetes CLI (
kubectl
) をインストールする必要がある。kubectl
のインストール手順は、Kubernetes ドキュメント の Install and Set Up kubectl を参照してください。注記: コンソールから CLI ツールのインストールファイルをダウンロードします。
-
OpenShift Container Platform によって作成されていないクラスターをインポートする場合は、
multiclusterhub.spec.imagePullSecret
を定義する必要があります。このシークレットは、Red Hat Advanced Cluster Management for Kubernetes のインストール時に作成されている場合もあります。シークレットの定義の詳細は、カスタムイメージプルシークレット を参照してください。
1.7.2.2. サポートされているアーキテクチャー
- Linux (x86_64, s390x, ppc64le)
- macOS
1.7.2.3. インポートの準備
以下のコマンドを実行して ハブクラスター にログインします。
oc login
ハブクラスターで以下のコマンドを実行し、プロジェクトおよび namespace を作成します。注記:
CLUSTER_NAME
で定義したクラスター名は、YAML ファイルおよびコマンドでクラスターの namespace としても使用します。oc new-project ${CLUSTER_NAME}
重要:
cluster.open-cluster-management.io/managedCluster
ラベルは、マネージドクラスターの namespace に対して自動的に追加および削除されます。マネージドクラスターに手動で追加したり、クラスターから削除したりしないでください。以下の内容例で
managed-cluster.yaml
という名前のファイルを作成します。apiVersion: cluster.open-cluster-management.io/v1 kind: ManagedCluster metadata: name: ${CLUSTER_NAME} labels: cloud: auto-detect vendor: auto-detect spec: hubAcceptsClient: true
cloud
およびvendor
の値をauto-detect
する場合、Red Hat Advanced Cluster Management はインポートしているクラスターからクラウドおよびベンダータイプを自動的に検出します。オプションで、auto-detect
の値をクラスターのクラウドおよびベンダーの値に置き換えることができます。以下の例を参照してください。cloud: Amazon vendor: OpenShift
以下のコマンドを入力して、YAML ファイルを
ManagedCluster
リソースに適用します。oc apply -f managed-cluster.yaml
自動インポートシークレットを使用したクラスターのインポート または 手動コマンドを使用したクラスターのインポート に進みます。
1.7.2.4. 自動インポートシークレットを使用したクラスターのインポート
自動インポートシークレットでインポートするには、クラスターの kubeconfig
ファイルを参照するか、またはクラスターの kube API サーバーおよびトークンのペアのいずれかの参照を含むシークレットを作成する必要があります。
-
インポートしているクラスターの
kubeconfig
ファイルまたは kube API サーバーおよびトークンを取得します。kubeconfig
ファイルまたは kube API サーバーおよびトークンの場所を特定する方法については、Kubernetes クラスターのドキュメントを参照してください。 ${CLUSTER_NAME} namespace に
auto-import-secret.yaml
ファイルを作成します。以下のテンプレートのようなコンテンツが含まれる
auto-import-secret.yaml
という名前の YAML ファイルを作成します。apiVersion: v1 kind: Secret metadata: name: auto-import-secret namespace: <cluster_name> stringData: autoImportRetry: "5" # If you are using the kubeconfig file, add the following value for the kubeconfig file # that has the current context set to the cluster to import: kubeconfig: |- <kubeconfig_file> # If you are using the token/server pair, add the following two values instead of # the kubeconfig file: token: <Token to access the cluster> server: <cluster_api_url> type: Opaque
次のコマンドを使用して、${CLUSTER_NAME} 名前空間の YAML ファイルを適用します。
oc apply -f auto-import-secret.yaml
注記: デフォルトでは、自動インポートシークレットは 1 回使用され、インポートプロセスの完了時に削除されます。自動インポートシークレットを保持する場合は、
managedcluster-import-controller.open-cluster-management.io/keeping-auto-import-secret
をシークレットに追加します。これを追加するには、以下のコマンドを実行します。
oc -n <cluster_name> annotate secrets auto-import-secret managedcluster-import-controller.open-cluster-management.io/keeping-auto-import-secret=""
インポートしたクラスターのステータス (
JOINED
およびAVAILABLE
) を確認します。ハブクラスターから以下のコマンドを実行します。oc get managedcluster ${CLUSTER_NAME}
管理対象クラスターで次のコマンドを実行して、管理対象クラスターにログインします。
oc login
次のコマンドを実行して、インポートするクラスターの Pod ステータスを検証します。
oc get pod -n open-cluster-management-agent
klusterlet アドオンのインポート に進みます。
1.7.2.5. 手動コマンドを使用したクラスターのインポート
重要: import コマンドには、インポートした各クラスターにコピーされるプルシークレット情報が含まれます。インポートしたクラスターにアクセスできるユーザーであれば誰でも、プルシークレット情報を表示することもできます。
以下のコマンドを実行して、ハブクラスターでインポートコントローラーによって生成された
klusterlet-crd.yaml
ファイルを取得します。oc get secret ${CLUSTER_NAME}-import -n ${CLUSTER_NAME} -o jsonpath={.data.crds\\.yaml} | base64 --decode > klusterlet-crd.yaml
以下のコマンドを実行して、ハブクラスターにインポートコントローラーによって生成された
import.yaml
ファイルを取得します。oc get secret ${CLUSTER_NAME}-import -n ${CLUSTER_NAME} -o jsonpath={.data.import\\.yaml} | base64 --decode > import.yaml
インポートするクラスターで次の手順を実行します。
次のコマンドを入力して、インポートする管理対象クラスターにログインします。
oc login
以下のコマンドを実行して、手順 1 で生成した
klusterlet-crd.yaml
を適用します。oc apply -f klusterlet-crd.yaml
以下のコマンドを実行して、以前に生成した
import.yaml
ファイルを適用します。oc apply -f import.yaml
インポートしているクラスターの
JOINED
およびAVAILABLE
のステータスを検証します。ハブクラスターから以下のコマンドを実行します。oc get managedcluster ${CLUSTER_NAME}
klusterlet アドオンのインポート に進みます。
1.7.2.6. klusterlet アドオンのインポート
以下の手順を実行して、klusterlet アドオン設定ファイルを作成および適用できます。
以下の例のような YAML ファイルを作成します。
apiVersion: agent.open-cluster-management.io/v1 kind: KlusterletAddonConfig metadata: name: <cluster_name> namespace: <cluster_name> spec: applicationManager: enabled: true certPolicyController: enabled: true iamPolicyController: enabled: true policyController: enabled: true searchCollector: enabled: true
-
ファイルは
klusterlet-addon-config.yaml
として保存します。 以下のコマンドを実行して YAML を適用します。
oc apply -f klusterlet-addon-config.yaml
ManagedCluster-Import-Controller は
${CLUSTER_NAME}-import
という名前のシークレットを生成します。${CLUSTER_NAME}-import
シークレットには、import.yaml
が含まれており、このファイルをユーザーがマネージドクラスターに適用して klusterlet をインストールします。アドオンは、インポートするクラスターの
AVAILABLE
の後にインストールされます。次のコマンドを実行して、インポートするクラスター上のアドオンの Pod ステータスを検証します。
oc get pod -n open-cluster-management-agent-addon
クラスターがインポートされました。
1.7.2.7. CLI でのインポートされたクラスターの削除
クラスターを削除するには、以下のコマンドを実行します。
oc delete managedcluster ${CLUSTER_NAME}
cluster_name
は、クラスターの名前に置き換えます。
これでクラスターが削除されます。
1.7.3. カスタム ManagedClusterImageRegistry CRD を使用したクラスターのインポート
インポートするマネージドクラスターのイメージレジストリーをオーバーライドする必要がある場合があります。この方法は、ManagedClusterImageRegistry
カスタムリソース定義 (CRD) を作成して実行できます。
ManagedClusterImageRegistry
CRD は namespace スコープのリソースです。
ManagedClusterImageRegistry
CRD は、配置が選択するマネージドクラスターのセットを指定しますが、カスタムイメージレジストリーとは異なるイメージが必要になります。マネージドクラスターが新規イメージで更新されると、識別用に各マネージドクラスターに、open-cluster-management.io/image-registry=<namespace>.<managedClusterImageRegistryName>
のラベルが追加されます。
以下の例は、ManagedClusterImageRegistry
CRD を示しています。
apiVersion: imageregistry.open-cluster-management.io/v1alpha1 kind: ManagedClusterImageRegistry metadata: name: <imageRegistryName> namespace: <namespace> spec: placementRef: group: cluster.open-cluster-management.io resource: placements name: <placementName> pullSecret: name: <pullSecretName> registries: - mirror: <mirrored-image-registry-address> source: <image-registry-address> - mirror: <mirrored-image-registry-address> source: <image-registry-address>
spec
セクション:
-
placementName
は、マネージドクラスターセットを選択する同じ namespace の Placement 名に置き換えます。 -
pullSecretName
は、カスタムイメージレジストリーからイメージをプルするために使用されるプルシークレットの名前に置き換えます。 ソース
およびミラー
レジストリーのそれぞれの値を一覧表示します。mirrored-image-registry-address
およびimage-registry-address
は、レジストリーの各ミラー
およびソース
値に置き換えます。例 1:
registry.redhat.io/rhacm2
という名前のソースイメージレジストリーをlocalhost:5000/rhacm2
に、registry.redhat.io/multicluster-engine
をlocalhost:5000/multicluster-engine
に置き換えるには、以下の例を使用します。registries: - mirror: localhost:5000/rhacm2/ source: registry.redhat.io/rhacm2 - mirror: localhost:5000/multicluster-engine source: registry.redhat.io/multicluster-engine
例 2: ソースイメージ
registry.redhat.io/rhacm2/registration-rhel8-operator
をlocalhost:5000/rhacm2-registration-rhel8-operator
に置き換えるには、以下の例を使用します。registries: - mirror: localhost:5000/rhacm2-registration-rhel8-operator source: registry.redhat.io/rhacm2/registration-rhel8-operator
1.7.3.1. ManagedClusterImageRegistry CRD を使用したクラスターのインポート
ManagedClusterImageRegistry CRD でクラスターをインポートするには、以下の手順を実行します。
クラスターをインポートする必要のある namespace にプルシークレットを作成します。これらの手順では、これは
myNamespace
です。$ kubectl create secret docker-registry myPullSecret \ --docker-server=<your-registry-server> \ --docker-username=<my-name> \ --docker-password=<my-password>
作成した namespace に Placement を作成します。
apiVersion: cluster.open-cluster-management.io/v1beta1 kind: Placement metadata: name: myPlacement namespace: myNamespace spec: clusterSets: - myClusterSet tolerations: - key: "cluster.open-cluster-management.io/unreachable" operator: Exists
注記: Placement がクラスターを選択できるようにするには、Toleration を
unreachable
に指定する必要があります。ManagedClusterSet
リソースを作成し、これを namespace にバインドします。apiVersion: cluster.open-cluster-management.io/v1beta1 kind: ManagedClusterSet metadata: name: myClusterSet --- apiVersion: cluster.open-cluster-management.io/v1beta1 kind: ManagedClusterSetBinding metadata: name: myClusterSet namespace: myNamespace spec: clusterSet: myClusterSet
namespace に
ManagedClusterImageRegistry
CRD を作成します。apiVersion: imageregistry.open-cluster-management.io/v1alpha1 kind: ManagedClusterImageRegistry metadata: name: myImageRegistry namespace: myNamespace spec: placementRef: group: cluster.open-cluster-management.io resource: placements name: myPlacement pullSecret: name: myPullSecret registry: myRegistryAddress
- Red Hat Advanced Cluster Management コンソールからマネージドクラスターをインポートして、マネージドクラスターセットに追加します。
-
open-cluster-management.io/image-registry=myNamespace.myImageRegistry
ラベルをマネージドクラスターに追加した後に、マネージドクラスターで import コマンドをコピーして実行します。
1.7.4. クラスターの klusterlet アドオン設定の変更
ハブクラスターを使用して設定を変更するには、KlusterletAddonConfig
の設定を変更します。
KlusterletAddonConfig
コントローラーは、klusterletaddonconfigs.agent.open-cluster-management.io
Kubernetes リソースの設定に合わせて有効化/無効化される機能を管理します。以下で KlusterletAddonConfig
を参照してください。
apiVersion: agent.open-cluster-management.io/v1 kind: KlusterletAddonConfig metadata: name: <cluster-name> namespace: <cluster-name> spec: clusterName: <cluster-name> clusterNamespace: <cluster-name> clusterLabels: cloud: auto-detect vendor: auto-detect applicationManager: enabled: true certPolicyController: enabled: true iamPolicyController: enabled: true policyController: enabled: true searchCollector: enabled: false version: 2.5.0
1.7.4.1. klusterlet アドオン設定の説明
以下の設定は、klusterletaddonconfigs.agent.open-cluster-management.io
の Kubernetes リソースで更新できます。
設定名 | 値 | 説明 |
---|---|---|
applicationmanager |
| このコントローラーは、マネージドクラスターでアプリケーションのサブスクリプションライフサイクルを管理します。 |
certPolicyController |
| このコントローラーは、マネージドクラスターで証明書ベースのポリシーを有効にします。 |
iamPolicyController |
| このコントローラーは、マネージドクラスターで IAM ベースのポリシーライフサイクルを有効にします。 |
policyController |
| このコントローラーは、マネージドクラスターの他の全ポリシールールを有効にします。 |
searchCollector |
| このコントローラーを使用して、リソースインデックスデータをハブクラスターに定期的に戻します。 |
1.7.4.2. ハブクラスターのコンソールを使用した変更
ハブクラスターを使用して、klusterletaddonconfigs.agent.open-cluster-management.io
リソースの設定を変更できます。設定の変更には、以下の手順を実行します。
- ハブクラスターの Red Hat Advanced Cluster Management for Kubernetes コンソールにログインします。
- ハブクラスターコンソールのヘッダーメニューから Search アイコンを選択します。
-
検索パラメーターに、
kind:klusterletaddonconfigs
の値を入力します。 - 更新するエンドポイントリソースを選択します。
-
spec
セクションから、Edit を選択してコンテンツを編集します。 - 設定を変更します。
- Save を選択して変更を適用します。
1.7.4.3. ハブクラスターのコマンドラインを使用した変更
ハブクラスターを使用して設定を変更するには、cluster-name
namespace へのアクセス権が必要です。以下の手順を実行します。
- ハブクラスターにログインします。
以下のコマンドを入力してリソースを編集します。
kubectl edit klusterletaddonconfigs.agent.open-cluster-management.io <cluster-name> -n <cluster-name>
-
spec
セクションを検索します。 - 必要に応じて設定を変更します。