Closed calphool closed 8 years ago
Thanks for trying out this setup. Things might go wrong since its still a complex scenario.
So what happens here is that the Kubernetes API server didn't start up. You should examine the following:
kubelet
is running.sudo journalctl -ua kubelet
and check the logsDoes this help ?
BTW, I'm currently about to switch to hypriot OS, where the modification can be found in branch hypriot
, which I will soon merge to master.
ssh to the master and check with ps whether kubelet is running.
pi@n0:~ $ ps -aux | grep kubelet
root 902 3.3 4.7 937408 45376 ? Ssl 20:08 0:28 /usr/bin/kubelet --api-servers=http://master:8080 --allow-privileged=true --pod_infra_container_image=gcr.io/google_containers/pause-arm:3.0 --config=/etc/kubernetes/manifests --cluster-dns=10.200.100.10 --cluster-domain=cluster.local --v=2
Check that you can reach out from within your Pis by doing a 'sudo ping ...'. Its mandatory that you internet access from your cluster, so you might check the README how to do this.
pi@n0:~ $ ping cisco.com
PING cisco.com (72.163.4.161) 56(84) bytes of data.
64 bytes from www1.cisco.com (72.163.4.161): icmp_seq=1 ttl=245 time=51.2 ms
I think something is supposed to be running on the master listening on port 8080... but:
pi@n0:~ $ netstat -a | grep 8080
returns nothing...
I'm not sure which ansible script was supposed to install things like the kubernetes-api listener, but I don't think it's there.
Here's why I think there's something wrong with the startup. This is the /var/log/syslog on the master node (n0):
Yes, the connection refused
messages are annoying (so I typically check the logs with | grep -v refused
)
Could you please also do a sudo journalctl -au kubelet | grep -v refused
on the master (n0) ?
Also interesting: "docker ps". You should see some containers from the hyperkube image. Could it be downloaded ? --> "docker images | grep hyperkube". (All these commands performed on the pis).
Some background info:
The kubelet is a process which works a little bit like small systemd. It start and manages certain containers which are defined in /etc/kubernetes/manifests
. If you look into this, you see that several containers are started, i.e. the apiserver (this is the one listening on 8080).
So we must ensure that the hyperkube containers are running on the master.
Another thing: Since I'm currently actively working on the hypriot branch, will be the default quite soon, would it be possible to switch to Hypriot as a base image ?
For this checkout the "hypriot" branch, check the README (the initial setup is much easier) and possibly reflash your SD cards.
BTW, I'm on the road next week so it might take a bit to answer.
It looks like it might have been caused because I didn't have this:
cgroup_enable=cpuset
in boot/cmdline.txt
The sudo journalctl -au kubelet | grep -v refused
showed that it was repeatedly failing because the cgroup "cpuset" didn't exist. Now I see it downloading images, and docker info
shows stuff appearing... let's see what happens here in a few minutes... ;-)
Yes, that's mandatory. However the setup
playbook should take care about. Of course, you need a restart after this (as said in the README).
Good luck ;-) !
Hmmm... maybe something wrong with:
- name: Add cgroup for Memory limits to bootparams lineinfile: dest: /boot/cmdline.txt regexp: '^(.*?)(\s*cgroup_enable.*swapaccount=\d+)?$' line: '\1 cgroup_enable=memory swapaccount=1' backrefs: true state: present
this is in /roles/base/tasks/system.yml
Is this where you thought it should be setting that cgroup? I don't see "cpuset" in there.
cgroup_enable=cpuset
I could probably fix that and send a pull request if you like.
Sorry, as said, I'm currently on the hypriot branch, and it might be that some fixed didn't made it into master.
Here's the relevant code on hypriot
--> https://github.com/Project31/ansible-kubernetes-openshift-pi3/blob/hypriot/roles/base/tasks/system.yml#L1-L7
I always love PRs ;-). The plan is to move the current master later on to a raspbian
branch and merge the hypriot branch to master. The main reason for choosing hypriot is, that it allows a headless setup.
Okay... so now that I'm running... what do I do with this crazy contraption?
:stuck_out_tongue_winking_eye::stuck_out_tongue_winking_eye::stuck_out_tongue_winking_eye::stuck_out_tongue_winking_eye:
(Oh, FYI, if anybody else runs into this little gotcha, you do need to update /boot/cmdline.txt on ALL the nodes, not just the master, and then reboot the cluster).
Awesome !!! Have fun ...
I followed the instructions, and I've definitely got docker up and running on the nodes. However, the Kubernetes install seems incomplete or something (no kubernetes master binaries?)
When I run kubectl cluster-info I get this:
The connection to the server master:8080 was refused - did you specify the right host or port?
However I can ping master just fine.
When I run:
netstat -a | grep 8080 on the master node, I get nothing back, so it seems that something was supposed to be installed, but it didn't get installed. When I look at the ansible scripts however I don't see where anything like the API listener was included.
What am I missing here?