Connect to remote Kubernetes cluster in private LAN from Windows 10

1/31/2019

EDIT: I'm going to leave this up but I moved away from Canonical Kubernetes to a microk8 install and everything "just worked." I would not recommend Canonical Kubernetes at this time (early 2019).

Goal: I want to connect to the Canonical Kubernetes cluster running on Ubuntu 18.04 box (192.168.2.148) on my Windows machine (192.168.2.40). I installed the cluster via conjure-up.

Problem: running kubectl cluster-info on windows machine gives me:

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.

I have ssh'd to the ubuntu box and copied the ~/.kube/config file to 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

Background:

I have a spare Ubuntu 18.04 LTS server (192.168.2.148) on my home LAN that I've used conjure-up to install the Canonical Kubernetes Install.

I've successfully installed the cluster and it seems to be working. I can ssh and see kubectl cluster-info and see the Master, Heapster, KubeDNS, Metrics-server, Grafana and InfluxDB all running.

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

along with juju status looking like everything is up and running:

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
-- TangoAlee
kubernetes
ubuntu
windows

0 Answers