以下是我的kubernetes版本的详细信息:
Client Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.1", GitCommit:"82450d03cb057bab0950214ef122b67c83fb11df", GitTreeState:"clean", BuildDate:"2016-12-14T00:57:05Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"5", GitVersion:"v1.5.1", GitCommit:"82450d03cb057bab0950214ef122b67c83fb11df", GitTreeState:"clean", BuildDate:"2016-12-14T00:52:01Z", GoVersion:"go1.7.4", Compiler:"gc", Platform:"linux/amd64"}kubectl集群-info提供以下输出
Kubernetes master is running at http://localhost:8080kubectl -server=localhost:8080 get pods工作正常:
NAME READY STATUS RESTARTS AGE
nginx-3449338310-sc54z 1/1 Running 0 3d
nginx-3449338310-sfql2 1/1 Running 0 3d
nginx-controller-0hq0n 1/1 Running 0 2h
nginx-controller-sc0nc 1/1 Running 0 2h但是,当通过IP地址:kubectl --服务器=10.10.65.151:8080访问时,这是行不通的。
The connection to the server 10.10.65.151:8080 was refused - did you specify the right host or port?这是我的kube-config:
apiVersion: v1
kind: Config
clusters:
- name: kubernetes
cluster:
certificate-authority: /etc/kubernetes/pki/ca.crt
server: http://10.10.65.151:8080
users:
- name: kubeuser
user:
client-certificate: /etc/kubernetes/pki/kube-master.crt
client-key: /etc/kubernetes/pki/kube-master.key
contexts:
- context:
cluster: kubernetes
user: kubeuser
name: kubeuser-context
current-context: kubeuser-context在试图从远程计算机访问api-服务器时,我也会遇到同样的错误。我能知道缺了什么吗?
发布于 2017-01-17 11:39:51
您正在尝试在集群IP上连接,它仅限于内部。
使用主机的IP
发布于 2017-03-08 06:52:13
我必须向服务提供以下参数,以便能够使用IP地址访问api服务器。
--insecure-bind-address=0.0.0.0现在,我能够使用主机的IP地址访问api。
https://stackoverflow.com/questions/41693745
复制相似问题