在 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