1

到目前为止(v2.1 Beta)的解决方案是:

1) 转到右上角并单击用户配置文件(例如管理员)。
2) 将展开一个菜单,其中包含 4 个选项:注销、更改密码、配置客户端和关于。
3) 单击配置客户端,它将向您显示一个包含 4-5 个 kubectl 调用的对话框,其中包括用户特定的令牌等。
4) 将该文本复制并粘贴到您的命令行终端,然后按 Enter。

你应该已经准备好了。如果您遇到一个空白对话框,然后刷新整个浏览器页面并重试,它将填充。

但是,我想知道是否有人找到了更好的方法来做到这一点?

4

2 回答 2

0

使用 ICp 2.1 beta,用户实际上可以从 App Center 安装一个应用程序,该应用程序提供 kubectl、helm 和 calicoctl 的 Web 终端,详细步骤为: 1. install `local-charts/web-terminal` from App center 2. go to Workload->Application->default-web-terminal-web 3. click to open the Endpoint page 4. admin/admin as credential

于 2017-09-25T20:22:04.287 回答
0

在 2.1.0 Beta3 中,命令行工具的第一个版本可用于 IBM Cloud Private。

这些工具可以通过 web 控制台中的“工具 > 命令行”选项安装在您选择的平台上。

bx pr login -a https://mycluster.icp:8443 -u admin --skip-ssl-validation
Login method invokedAPI endpoint: https://mycluster.icp:8443

Password> 
Authenticating...
OK

Select an account:
1. ICP Account (9335b8949793c6fb1b96cf2a103a9d50)
Enter a number> 1
Targeted account: ICP Account (9335b8949793c6fb1b96cf2a103a9d50)

bx pr clusters
OK
Name        ID                                 State      Created                    Masters   Workers   Datacenter   
mycluster   00000000000000000000000000000001   deployed   2017-10-13T03:28:53+0000   1         3         default   

bx pr cluster-config mycluster
Configuring kubectl: /Users/mdelder/.bluemix/plugins/icp/clusters/mycluster/kube-config
Cluster "master.cfc" set.
Context "master.cfc-context" set.
User "master.cfc-user" set.
Context "master.cfc-context" set.
Switched to context "master.cfc-context".

OK
Cluster mycluster configured successfully.

现在您可以使用kubectl

kubectl get nodes
NAME          STATUS    AGE       VERSION
10.10.25.27   Ready     2d        v1.7.3-7+154699da4767fd
10.10.25.28   Ready     2d        v1.7.3-7+154699da4767fd
10.10.25.72   Ready     2d        v1.7.3-7+154699da4767fd
10.10.25.73   Ready     2d        v1.7.3-7+154699da4767fd

您还可以发现有关集群的信息:

bx pr help

NAME:
   bx pr - IBM Cloud Private Service.
USAGE:
   bx pr command [arguments...] [command options]

COMMANDS:
   api                View or set the API endpoint and API version for the service.
   cluster-config     Download the Kubernetes configuration and configure kubectl for a specified cluster.
   cluster-get        View details for a cluster.
   clusters           List all the clusters in your account.
   init               Initialize the IBM Cloud Private plugin with the API endpoint.
   load-helm-chart    Loads a Helm chart archive to an IBM Cloud Private cluster.
   load-ppa-archive   Load Docker images and Helm charts compressed file that you downloaded from Passport Advantage.
   login              Log user in.
   master-get         View the details about a master node.
   masters            List all master nodes in an existing cluster.
   worker-get         View the details about a worker node.
   workers            List all worker nodes in an existing cluster.
   help               

Enter 'bx pr help [command]' for more information about a command.

bx pr masters mycluster
OK
ID                      Public IP     Private IP    State   
mycluster-00000000-m1   10.10.25.73   10.10.25.73   deployed 
于 2017-10-13T03:34:06.073 回答