I want to use the Kubernetes feature from Gitlab so I bough a VPS and I want to use Rancher to manage all the Docker things on this server.
I'm stuck at the step to import the k8s in Rancher. See bellow.
RKE version:
$ rke --version
rke version v0.1.6 (Darwin)
Docker version: (docker version,docker info preferred)
# docker info
Containers: 24
Running: 17
Paused: 0
Stopped: 7
Images: 16
Server Version: 17.03.2-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log:
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: 949e6fa
Security Options:
seccomp
Profile: default
Kernel Version: 4.9.0-6-amd64
Operating System: Debian GNU/Linux 9 (stretch)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.911GiB
Name: deadlpool
ID: 4L3X:3OO4:IVXL:Q6JX:2GIX:C7CK:MPGM:23IF:XZFU:7HB3:C7XH:SFGY
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
provider=generic
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: No swap limit support
Operating system and kernel: (cat /etc/os-release, uname -r preferred)
# uname -r
4.9.0-6-amd64
Type/provider of hosts: (VirtualBox/Bare-metal/AWS/GCE/DO)
VPS
cluster.yml file:
# default k8s version: v1.8.10-rancher1-1
# default network plugin: canal
nodes:
- address: xx.xx.xxx.xxx
port: xxxxx
ssh_key_path: '~/.ssh/id_rsa'
user: root
role: [controlplane,worker,etcd]
ingress:
provider: none
Steps to Reproduce:
rke on the local machinerke up --config cluster.ymlrancher/rancher:v2.0.0 Docker imageResults:
I have installed Docker (required version for k8s) and installed k8s from my Mac on the VPS using rke. The rke installation works fine and I can see the running containers.
In Rancher I'm importing the existing cluster but after having selected the import option, I have the kubectl apply -f https://.../....yaml command to run. I tried to do a docker exec -it kubelet bash and from here running the command but it fails with the error
The connection to the server localhost:8080 was refused - did you specify the right host or port?
The YAML file is never specifying any 8080 port so I'm lost.
Even a simple command like kubectl api-versions, from the kubelet container is failing with:
error: Couldn't get available api versions from server: Get http://localhost:8080/api: dial tcp 127.0.0.1:8080: getsockopt: connection refused
I'm also trying to follow what's written from the rancher blog article An Introduction To Rancher Kubernetes Engine (RKE), from the section Connecting to the Cluster.
I have installed kubectl on my Mac
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.1", GitCommit:"d4ab47518836c750f9949b9e0d387f20fb92260b", GitTreeState:"clean", BuildDate:"2018-04-13T22:27:55Z", GoVersion:"go1.9.5", Compiler:"gc", Platform:"darwin/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
and copied the generated file kube_config_cluster.yml from the rke command within my ~/.kube/ folder (I just created it) but :
$ kubectl get nodes
The connection to the server localhost:8080 was refused - did you specify the right host or port?
Try kubectl --kubeconfig kube_config_cluster.yml get nodes
Awesome @superseb ! That's solved the mentioned issue 馃憤
Nonetheless nothing appear in Rancher 馃槥
So from Rancher I created a new cluster, as an import, and changed the given command with the --kubeconfig flag that you gave:
curl --insecure -sfL https://k8s.mydonain.co/v3/import/jl9lrw5jflkdxf55vmps4xq65x9d8zh4qjk7swd5m5z89smjnwkqdd.yaml | kubectl --kubeconfig kube_config_cluster.yml apply -f -
namespace "cattle-system" created
serviceaccount "cattle" created
clusterrolebinding.rbac.authorization.k8s.io "cattle" created
secret "cattle-credentials-d147992" created
deployment.extensions "cattle-cluster-agent" created
daemonset.extensions "cattle-node-agent" created
In Rancher the cluster has the following error: Waiting for full cluster configuration.
Do you know shall I do to solve this?
I'm closing this issue as I'm no more using Rancher to deploy Kubernetes.
@zedtux Can you tell me what you are using now?
@dom3k I'm using RKE.
Waiting for full cluster configuration
I have the same problem.
The problem is that you cannot start kube-api-server with 127.0.0.0/8 ip address range. rke up --local will never work because it uses 127.0.0.1 for the kube-api-server which will always refuses to boot.
If you want to up rke locally, assign a private ip address to your local machine (192.168.0.2 for example) and it will work.
Most helpful comment
Awesome @superseb ! That's solved the mentioned issue 馃憤
Nonetheless nothing appear in Rancher 馃槥
So from Rancher I created a new cluster, as an import, and changed the given command with the
--kubeconfigflag that you gave:In Rancher the cluster has the following error:
Waiting for full cluster configuration.Do you know shall I do to solve this?