17.4. AWS へのホステッドクラスターの手動インポート
コマンドラインインターフェイスを使用して、Amazon Web Services (AWS) にホステッドクラスターをインポートすることもできます。
手順
以下のサンプル YAML ファイルを使用して、
ManagedClusterリソースを作成します。apiVersion: cluster.open-cluster-management.io/v1 kind: ManagedCluster metadata: annotations: import.open-cluster-management.io/hosting-cluster-name: local-cluster import.open-cluster-management.io/klusterlet-deploy-mode: Hosted open-cluster-management/created-via: hypershift labels: cloud: auto-detect cluster.open-cluster-management.io/clusterset: default name: <hosted_cluster_name>1 vendor: OpenShift name: <hosted_cluster_name> spec: hubAcceptsClient: true leaseDurationSeconds: 60- 1
<hosted_cluster_name>は、ホステッドクラスターの名前に置き換えます。
以下のコマンドを実行してリソースを適用します。
$ oc apply -f <file_name>1 - 1
<file_name>は、前のステップで作成した YAML ファイル名に置き換えます。
Red Hat Advanced Cluster Management がインストールされている場合は、次のサンプル YAML ファイルを使用して
KlusterletAddonConfigリソースを作成します。multicluster engine Operator のみをインストールした場合は、この手順を省略します。apiVersion: agent.open-cluster-management.io/v1 kind: KlusterletAddonConfig metadata: name: <hosted_cluster_name>1 namespace: <hosted_cluster_namespace>2 spec: clusterName: <hosted_cluster_name> clusterNamespace: <hosted_cluster_namespace> clusterLabels: cloud: auto-detect vendor: auto-detect applicationManager: enabled: true certPolicyController: enabled: true iamPolicyController: enabled: true policyController: enabled: true searchCollector: enabled: false以下のコマンドを実行してリソースを適用します。
$ oc apply -f <file_name>1 - 1
<file_name>は、前のステップで作成した YAML ファイル名に置き換えます。
インポートプロセスが完了すると、ホステッドクラスターがコンソールに表示されます。以下のコマンドを実行して、ホステッドクラスターのステータスを確認することもできます。
$ oc get managedcluster <hosted_cluster_name>