kubectl version 错误 The connection to the server localhost:8080 was refused

michael01s-Mac:ibmcloud michael01$ kubectl version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.6", GitCommit:"9f8ebd171479bec0ada837d7ee641dec2f8c6dd1", GitTreeState:"clean", BuildDate:"2018-03-21T15:21:50Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?

michael01s-Mac:ibmcloud michael01$ 

出现这个错误是因为没有设置Kubenetes的配置文件,当执行网命令“bx cs cluster-config cloudnativedev”后,会有一个export的设置环境变量,之后再执行kubectl version就没有错误了,例如:

michael01s-Mac:~ michael01$ kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.6", GitCommit:"6260bb08c46c31eea6cb538b34a9ceb3e406689c", GitTreeState:"clean", BuildDate:"2017-12-21T06:34:11Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?

michael01s-Mac:~ michael01$

你可能感兴趣的:(Trouble,shooting,Micro,Service)