Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/kubernetes/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kubernetes 无法远程访问kube apiserver_Kubernetes - Fatal编程技术网

Kubernetes 无法远程访问kube apiserver

Kubernetes 无法远程访问kube apiserver,kubernetes,Kubernetes,以下是我的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:

以下是我的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 cluster info给出以下输出

Kubernetes master is running at http://localhost:8080
kubectl--server=localhost:8080getpods工作正常:

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--server=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配置:

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服务器时遇到相同的错误。我可以知道缺少了什么吗?

您正在尝试通过群集IP进行连接,群集IP只是内部的


使用主机的IP

我必须向kube apiserver服务提供以下参数,以便使用IP地址访问api服务器

--insecure-bind-address=0.0.0.0

现在我可以使用主机的IP地址访问api。

问题在于主机的IP。