[SOLVED] K8s Core on top of OpenStack

You have to run kubectl proxy from the same host as you are accessing your browser on.

I try that on same host where is installed MAAS/JUJU not on instance.

Ubuntu 18.04 Maas Server Edition
$:kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2", GitCommit:"66049e3b21efe110454d67df4fa62b08ea79a19b", GitTreeState:"clean", BuildDate:"2019-05-16T16:23:09Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2", GitCommit:"66049e3b21efe110454d67df4fa62b08ea79a19b", GitTreeState:"clean", BuildDate:"2019-05-16T16:14:56Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}

$:kubectl cluster-info
Kubernetes master is running at https://10.20.81.223:6443
Heapster is running at https://10.20.81.223:6443/api/v1/namespaces/kube-system/services/heapster/proxy
CoreDNS is running at https://10.20.81.223:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://10.20.81.223:6443/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy
Grafana is running at https://10.20.81.223:6443/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
InfluxDB is running at https://10.20.81.223:6443/api/v1/namespaces/kube-system/services/monitoring-influxdb:http/proxy

I try to open Grafana but dashboard ui nothing!

run kubectl proxy on the machine your browser is running on and access

http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy

in your browser

I’ve installed that on windows 10 and Mac, using this link, and in both case the result is the same:

Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.

here is tasks on win

cd ~
PS C:\Users\rm> mkdir .kube
PS C:\Users\rm> cd .\Downloads
PS C:\Users\rm\Downloads> .\kubectl.exe config get-clusters
NAME
PS C:\Users\rm\Downloads>

inside the .kube dir there is any file and not returns the name of the cluster, then I tried

PS C:\Users\rm\Downloads> .\kubectl.exe version -o yaml
clientVersion:
  buildDate: "2019-03-25T15:53:57Z"
  compiler: gc
  gitCommit: 641856db18352033a0d96dbc99153fa3b27298e5
  gitTreeState: clean
  gitVersion: v1.14.0
  goVersion: go1.12.1
  major: "1"
  minor: "14"
  platform: windows/amd64

Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.

While on Maas

Ubuntu 18.04 Maas Server Edition
$:kubectl config get-clusters
NAME
juju-cluster

I think, my idea, being my lab built using this schema

+-------------------------------------------------------------+
                              Switch 
  +-------------------------------------------------------------+
        |                   |                   || | | |
+--------------+     +-------------+       +------------------+
|Maas+Juju           |Juju Gui             |Openstack
|10.20.81.1          |10.20.81.2           |10.20.81.21-24
+--------------+     +-------------+       +------------------+
                                                     |
                                +----------------------------------------+
                                Private Subnet-1           Public Subnet-2
                                 10.1.0.0/24                10.20.81.0/24
                                  +--+--+--+                +---+------+
                                  |        |
                                  |        |
                                +-+-+    +-+-+       
                               |    |    |   |
                               |Juju|    |K8s|  
                               |Gui |    |   |
                               |    |    |   |
                               +----+    +---+

when I run the deploy of K8s, Juju creates on Openstack of the Grp policy with its own policy. Maybe that one blocks same requests from my Pc???

Looks like your kubeconfig isn’t setup and is preventing the rest from working. Scp the kubeconfig to ~/.kube/config similar to how it’s done in the kubernetes-core readme using juju scp. Get kubectl working correctly (put the config in the ~/.kube/ ) then the rest will work.

1 Like

Yes Yes Yes…:+1::+1::+1::+1::+1::+1::+1::+1::+1:

in summary on Maas/Juju we’ve to run that:

Ubuntu 18.04 Maas Server Edition
$: mkdir -p ~/.kube
$: juju scp kubernetes-master/0:config ~/.kube/config

then on our Pc we need to Install kubectl locally and copy the config file from Maas to that in .kube dir.

PS C:\Users\rm\Downloads> .\kubectl.exe version -o yaml
clientVersion:
  buildDate: "2019-03-25T15:53:57Z"
  compiler: gc
  gitCommit: 641856db18352033a0d96dbc99153fa3b27298e5
  gitTreeState: clean
  gitVersion: v1.14.0
  goVersion: go1.12.1
  major: "1"
  minor: "14"
  platform: windows/amd64
serverVersion:
  buildDate: "2019-05-16T16:14:56Z"
  compiler: gc
  gitCommit: 66049e3b21efe110454d67df4fa62b08ea79a19b
  gitTreeState: clean
  gitVersion: v1.14.2
  goVersion: go1.12.5
  major: "1"
  minor: "14"
  platform: linux/amd64

PS C:\Users\rm\Downloads> .\kubectl.exe proxy
Starting to serve on 127.0.0.1:8001

thanks

2 Likes