无法获取集群配置 - IBM Cloud

Failure to get cluster config - IBM Cloud

我在 IBM Cloud 上创建了一个我无法访问的集群。当我尝试以下命令时

ibmcloud ks cluster-config mycluster

我收到这样的回复:

失败

{"incidentID":"4d426527e73acd83-CDG","code":"A0006","description":"The specified cluster could not be found. Target a region. If you're using resource groups, make sure that you target the correct resource group.","type":"Authentication","recoveryCLI":"To list the clusters you have access to, run 'ibmcloud ks clusters'. To check the resource group ID of the cluster, run 'ibmcloud ks cluster-get \u003ccluster_name_or_ID\u003e'. To list the resource groups that you have access, run 'ibmcloud resource groups'. To target the resource group, run 'ibmcloud target -g \u003cresource_group\u003e'. To target a region, run 'ibmcloud ks region-set'."}

我已尝试联系 IBM 支持团队,但仍然没有对我的问题有帮助的答案。但是当我尝试获取我的集群列表时,它起作用了,我可以看到我的集群确实存在。

我也尝试了 JSON 错误消息中的所有命令,但仍然不起作用。

ibmcloud ks clusters

根据我在 IBM 上看到的,ibmcloud ks cluster-config mycluster 命令应该下载配置文件,但由于它甚至没有找到我的集群,所以我没有得到任何东西。

希望 and/or 之前有人遇到过这个问题可以帮助我解决这个问题,我 运行 没主意了。

更新

我也试过了

ibmcloud ks cluster-config --cluster mycluster

returns 相同的 JSON 错误信息。

我的OS是Ubuntu16.04

更新 2

即使我设法手动获取集群配置并部署了一个 "hello-world" 应用程序,但所有引用集群的命令(例如 ibmcloud ks workers <cluster_name_or_ID>ibmcloud ks cluster-config <cluster_name_or_ID> 仍然不起作用,我坚信,如果这些命令无法正常工作,就无法充分使用 IBM Cloud。

获取集群配置的命令为:

USAGE:
       ibmcloud ks cluster-config --cluster <cluster name or ID> [--admin] [--export] [--yaml] [--network] [--skip-rbac]

您似乎省略了 --cluster 部分。我刚检查了一下,它给出了您报告的错误消息。

ibmcloud ks clusters 列出集群及其资源组。 运行 ibmcloud target 并检查资源组是否与集群的组匹配。否则,运行 ibmcloud target -g the-resource-group 切换到它。

P.S.: 你使用的是最新版的ks插件吗?

编辑:我不再认为唯一命名是问题

也许您应该使用唯一的名称(而不是 "mycluster")重新制作您的集群

如果我没记错的话,当我的集群名称不唯一时,我收到了一条错误消息。我的同事在创建名为 "mycluster" 的集群时没有遇到此错误,但他 运行 遇到了与您相同的问题。

不是解决方案,但您可以通过手动下载和 'exporting' kubeconfig 来绕过失败的命令。下载 link 可以通过转到您在 IBM Cloud 中的集群找到,然后在 Access 下,它是教程的一部分。

我在 eu-gb 区域使用 ibmcloud ks cluster-config 自由集群 时遇到问题。如果这适用于您,请尝试使用适当的区域端点以查看是否有帮助。

例如:

ibmcloud ks init --host https://eu-gb.containers.cloud.ibm.com

https://cloud.ibm.com/docs/containers?topic=containers-regions-and-zones#regions_free

我领导上述 cli 的开发团队。我们推出了新版本的 CLI,您不再需要初始化到特定区域。我们现在支持世界和所有地区的全球视野。你能再试一次吗?

我使用了 cluster config(没有破折号)并且对我有用。所以我的整个命令是 ibmcloud ks cluster config --cluster <cluster_name_or_ID>

在我不得不擦除硬盘驱动器并重新安装 OS 后,我遇到了同样的问题。我安装了 ibmcloud CLI,但 cluster-config 不起作用。我发现我显然没有安装正确的包(或者可能是插件),而且语法也发生了变化。我这样做了(我在 MacOS):

卷曲-sL https://ibm.biz/idt-installer | bash

ibmcloud cs 集群配置 --cluster <集群名称>

它奏效了。我在这里找到的安装命令: https://github.com/IBM-Cloud/ibm-cloud-developer-tools 但随后注意到它也显示在其他网页上。

我不知道新旧命令的行为或副作用之间有什么区别(如果有的话)。