尝试访问 Kubernetes Dashboard 路由到企业代理错误页面

Attempting to access Kubernetes Dashboard routes to corporate proxy error page

我一直在关注 this guide 以使用 kubeadm 启动 kubernetes。我已经完成了,现在在 Centos7 VM 上有一个单机集群 运行ning。我安装了一个 pod 网络(Weave Net),我还安装了 Kubernetes Dashboard。接下来,我 运行 kubectl proxy 它以 Starting to serve on 127.0.0.1:8001.

响应

但是,每当我尝试使用 localhost:8001/ui 或 127.0.0.1:8001/ui 访问仪表板时,我都会被重定向到链接到我的公司代理的错误页面尝试到达 http://10.32.0.4/.

时通知我网关超时

现在,我发现有些配置中 10.32.0.4 没有包含在某些异常中,所以我开始将它添加到 no_proxy 和 NO_PROXY 中的 env,我在GUI 中的实际代理设置,我已确保 docker 设置为具有相同的异常。我什至(据我所知)完全删除了代理设置的任何痕迹,希望它不会尝试通过公司代理到达应该是内部地址的地方。附加信息:

[root@localhost ~]# kubectl get nodes
NAME                    STATUS    AGE       VERSION
localhost.localdomain   Ready     22h       v1.6.4

[root@localhost ~]# kubectl get pods --namespace=kube-system
NAME                                            READY     STATUS    RESTARTS   AGE
etcd-localhost.localdomain                      1/1       Running   0          22h
kube-apiserver-localhost.localdomain            1/1       Running   0          22h
kube-controller-manager-localhost.localdomain   1/1       Running   0          22h
kube-dns-3913472980-8zm51                       3/3       Running   0          22h
kube-proxy-3wslb                                1/1       Running   0          22h
kube-scheduler-localhost.localdomain            1/1       Running   0          22h
kubernetes-dashboard-2039414953-79zbr           1/1       Running   0          22h
weave-net-z6kml                                 2/2       Running   0          22h

[root@localhost ~]# kubectl describe svc kubernetes-dashboard --namespace=kube-system
Name:           kubernetes-dashboard
Namespace:      kube-system
Labels:         k8s-app=kubernetes-dashboard
Annotations:        <none>
Selector:       k8s-app=kubernetes-dashboard
Type:           ClusterIP
IP:         10.96.33.253
Port:           <unset> 80/TCP
Endpoints:      10.32.0.4:9090
Session Affinity:   None
Events:         <none>

[root@localhost ~]# kubectl get deployment kubernetes-dashboard --namespace=kube-system
NAME                   DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
kubernetes-dashboard   1         1         1            1           22h

[root@localhost ~]# kubectl --namespace=kube-system get ep kubernetes-dashboard
NAME                   ENDPOINTS        AGE
kubernetes-dashboard   10.32.0.4:9090   22h

[root@localhost ~]# kubectl cluster-info
Kubernetes master is running at https://192.168.181.130:6443
KubeDNS is running at https://192.168.181.130:6443/api/v1/proxy/namespaces/kube-system/services/kube-dns

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

[root@localhost ~]# kubectl get ns
NAME          STATUS    AGE
default       Active    22h
kube-public   Active    22h
kube-system   Active    22h

[root@localhost ~]# kubectl get ep
NAME         ENDPOINTS              AGE
kubernetes   192.168.181.130:6443   22h

我真的不知道从这里到哪里去。这里有很多活动部件,我找不到一种方法来查看重定向发生时出了什么问题。

代理设置由 kubeadm 在节点创建时复制,不反映之后执行的更改。您应该在 /etc/kubernetes/manifests/kube-apiserver.yaml

中更新代理设置