16.4. 在 AWS 上手动导入托管集群


您还可以使用命令行界面在 Amazon Web Services (AWS)上导入托管集群。

流程

  1. 使用以下 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
    Copy to Clipboard Toggle word wrap
    1
    <hosted_cluster_name> 替换为托管集群的名称。
  2. 运行以下命令以应用资源:

    $ oc apply -f <file_name> 
    1
    Copy to Clipboard Toggle word wrap
    1
    <file_name> 替换为您在上一步中创建的 YAML 文件名。
  3. 如果安装了 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
    Copy to Clipboard Toggle word wrap
    1
    <hosted_cluster_name> 替换为托管集群的名称。
    2
    <hosted_cluster_namespace> 替换为托管集群命名空间的名称。
  4. 运行以下命令以应用资源:

    $ oc apply -f <file_name> 
    1
    Copy to Clipboard Toggle word wrap
    1
    <file_name> 替换为您在上一步中创建的 YAML 文件名。
  5. 导入过程完成后,您的托管集群在控制台中可见。您还可以运行以下命令来检查托管集群的状态:

    $ oc get managedcluster <hosted_cluster_name>
    Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部