从Windows 10连接到专用LAN中的远程Kubernetes群集

时间:2019-01-31 02:11:57

标签: windows ubuntu kubernetes

编辑:我将保留这一点,但是我从Canonical Kubernetes转到了microk8安装,一切都“正常”了。我目前不建议使用Canonical Kubernetes(2019年初)。

目标: 我想连接到Windows计算机(192.168.2.148)上的Ubuntu 18.04 Box (192.168.2.40)上运行的Canonical Kubernetes群集。我通过conjure-up安装了集群。

问题: 在Windows计算机上运行kubectl cluster-info会给我:

Unable to connect to the server: dial tcp 10.91.211.64:443: connectex: A connection attempt 
failed because the connected party did not properly respond after a period of time, 
or established connection failed because connected host has failed to respond.

我已将ssh'd到ubuntu框中,并将~/.kube/config文件复制到Windows。

~/.kube/config

 apiVersion: v1
 clusters:
 - cluster:
    certificate-authority-data: <BIG LONG STRING O STUFF>
    server: https://10.91.211.64:443
  name: conjure-canonical-kubern-931
contexts:
- context:
    cluster: conjure-canonical-kubern-931
    user: conjure-canonical-kubern-931
  name: conjure-canonical-kubern-931
current-context: conjure-canonical-kubern-931
kind: Config
preferences: {}
users:
- name: conjure-canonical-kubern-931
  user:
    password: <Smaller String>
    username: admin

背景

我的家庭局域网上有一个备用的Ubuntu 18.04 LTS服务器(192.168.2.148),我曾使用conjure-up安装了Canonical Kubernetes Install。

我已经成功安装了群集,并且似乎可以正常工作。我可以ssh并查看kubectl cluster-info,并看到Master,Heapster,KubeDNS,Metrics-server,Grafana和InfluxDB都在运行。

Kubernetes master is running at https://10.91.211.64:443
Heapster is running at https://10.91.211.64:443/api/v1/namespaces/kube-system/services/heapster/proxy
KubeDNS is running at https://10.91.211.64:443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://10.91.211.64:443/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy
Grafana is running at https://10.91.211.64:443/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
InfluxDB is running at https://10.91.211.64:443/api/v1/namespaces/kube-system/services/monitoring-influxdb:http/proxy

juju status一样,一切都已启动并运行:

Model                         Controller                Cloud/Region         
Version  SLA          Timestamp
conjure-canonical-kubern-931  conjure-up-localhost-673  localhost/localhost  2.4.3    unsupported  02:01:00Z

App                    Version  Status  Scale  Charm                  Store       Rev  OS      Notes
easyrsa                3.0.1    active      1  easyrsa                jujucharms  195  ubuntu
etcd                   3.2.10   active      3  etcd                   jujucharms  378  ubuntu
flannel                0.10.0   active      5  flannel                jujucharms  351  ubuntu
kubeapi-load-balancer  1.14.0   active      1  kubeapi-load-balancer  jujucharms  525  ubuntu  exposed
kubernetes-master      1.13.2   active      2  kubernetes-master      jujucharms  542  ubuntu
kubernetes-worker      1.13.2   active      3  kubernetes-worker      jujucharms  398  ubuntu  exposed

Unit                      Workload  Agent  Machine  Public address  Ports           Message
easyrsa/0*                active    idle   0        10.91.211.138                   Certificate Authority connected.
etcd/0                    active    idle   1        10.91.211.120   2379/tcp        Healthy with 3 known peers
etcd/1*                   active    idle   2        10.91.211.205   2379/tcp        Healthy with 3 known peers
etcd/2                    active    idle   3        10.91.211.41    2379/tcp        Healthy with 3 known peers
kubeapi-load-balancer/0*  active    idle   4        10.91.211.64    443/tcp         Loadbalancer ready.
kubernetes-master/0       active    idle   5        10.91.211.181   6443/tcp        Kubernetes master running.
  flannel/0*              active    idle            10.91.211.181                   Flannel subnet 10.1.50.1/24
kubernetes-master/1*      active    idle   6        10.91.211.218   6443/tcp        Kubernetes master running.
  flannel/1               active    idle            10.91.211.218                   Flannel subnet 10.1.85.1/24
kubernetes-worker/0*      active    idle   7        10.91.211.29    80/tcp,443/tcp  Kubernetes worker running.
  flannel/4               active    idle            10.91.211.29                    Flannel subnet 10.1.94.1/24
kubernetes-worker/1       active    idle   8        10.91.211.70    80/tcp,443/tcp  Kubernetes worker running.
  flannel/3               active    idle            10.91.211.70                    Flannel subnet 10.1.46.1/24
kubernetes-worker/2       active    idle   9        10.91.211.167   80/tcp,443/tcp  Kubernetes worker running.
  flannel/2               active    idle            10.91.211.167                   Flannel subnet 10.1.30.1/24

Entity  Meter status  Message
model   amber         user verification pending

Machine  State    DNS            Inst id        Series  AZ  Message
0        started  10.91.211.138  juju-86bdea-0  bionic      Running
1        started  10.91.211.120  juju-86bdea-1  bionic      Running
2        started  10.91.211.205  juju-86bdea-2  bionic      Running
3        started  10.91.211.41   juju-86bdea-3  bionic      Running
4        started  10.91.211.64   juju-86bdea-4  bionic      Running
5        started  10.91.211.181  juju-86bdea-5  bionic      Running
6        started  10.91.211.218  juju-86bdea-6  bionic      Running
7        started  10.91.211.29   juju-86bdea-7  bionic      Running
8        started  10.91.211.70   juju-86bdea-8  bionic      Running
9        started  10.91.211.167  juju-86bdea-9  bionic      Running

0 个答案:

没有答案