×

您可以使用命令行界面 (CLI) 销毁 AWS (Amazon Web Services) 上的托管集群及其托管集群资源。

使用 CLI 销毁 AWS 上的托管集群

您可以使用命令行界面 (CLI) 销毁 Amazon Web Services (AWS) 上的托管集群。

步骤
  1. 通过运行以下命令删除多集群引擎运算符上的托管集群资源

    $ oc delete managedcluster <hosted_cluster_name> (1)
    1 <hosted_cluster_name> 替换为您的集群名称。
  2. 通过运行以下命令删除托管集群及其后端资源

    $ hcp destroy cluster aws  \
      --name <hosted_cluster_name> \(1)
      --infra-id <infra_id> \(2)
      --role-arn <arn_role> \(3)
      --sts-creds <path_to_sts_credential_file> \(4)
      --base-domain <basedomain> (5)
    1 指定托管集群的名称,例如 example
    2 指定托管集群的基础架构名称。
    3 指定 Amazon 资源名称 (ARN),例如 arn:aws:iam::820196288204:role/myrole
    4 指定 AWS 安全令牌服务 (STS) 凭据文件的路径,例如 /home/user/sts-creds/sts-creds.json
    5 指定您的基本域名,例如 example.com

    如果您的 AWS 安全令牌服务 (STS) 会话令牌已过期,请通过运行以下命令在名为 sts-creds.json 的 JSON 文件中检索 STS 凭据

    $ aws sts get-session-token --output json > sts-creds.json