blog
blog copied to clipboard
post/setup-kubernetes-raspberry-pi-cluster needs a bit of updating
Hi,
I went through setup-kubernetes-raspberry-pi-cluster (which is super handy). But it needs some upgrading: In random order:
- I've used current released flannel, 0.9.1, so no need to warn about 0.7.1 being bad
- My nodes came up NotReady when I used --pod-network-cidr (only after flannel install they were OK)
- flannel rbac is not(?) needed anymore (didn't double check)
- Default flannel defaults to amd64 which is manually changed into arm. There is a not about this, but that it references is old, so I forgot to do it (took me a while to figure out this mistake)
- the flash's
-noption didn't work for me (got an error after flashing, assumed it was ok), but the hostname was still the default.
Thanks for your suggestions!! It would be awesome if you could hand in some PRs for each suggestion :-) I am sorry but I won't take more time for this other than approving PRs if they seem OK - in the best case, one other person tests and confirms it.
@miekg Thanks for the feedback. Regarding the flash -n option: which SD card image have you used?
[ Quoting [email protected] in "Re: [hypriot/blog] post/setup-kuber..." ]
@miekg Thanks for the feedback. Regarding the flash -n option: which SD card image have you used?
latest release at the time: v1.7.1 (got an error on both my laptop and workstation at the end of the flashing process)
/Miek
-- Miek Gieben
Thanks. I checked flash -n both on macOS and Linux (only in a Vagrant VM), but couldn't find a problem with
flash -f -n mynode https://github.com/hypriot/image-builder-rpi/releases/download/v1.7.1/hypriotos-rpi-v1.7.1.img.zip
On both platforms the user-data file had the updated hostname in it.
I've merged some PR's into flash recently, also added some tests running on Circle (for Linux) and Travis (for macOS, but work is in progress here) to keep the tool working for hopefully all our users :-)
Thanks for double checking.
- What does the
-foption do? A new flag? - And what's user data?
I've just executed the above (minus -f) command and flashed a sd:
flash -n miek ....
% cd /media/miek
% more root/etc/hostname
black-pearl
% more root/etc/hostname
black-pearl
And these get never overwritten on boot...
uh, second one needs to be /etc/hosts, but that also lists black-pearl as 127.0.1.1
Yes, -f is new. I had to add it to automate some BATS tests to skip the prompt. I‘ll add it to the readme.
I only tried flashing and looked at the user-data file in the FAT partition and the script has updated it.
I‘ll boot an RPi with it later and will check if it boots with the modified hostname.
With Hypriot 1.7 we switched from our own device-init to cloud-init to have more options on first boot.
I tried two RPi3 today, one with --hostname, another with --userdata and --bootconf to spin it up with WiFi enabled. Both first start booting with black-pearl, but when I then log in the new name is activated. The user-data will be executed during the first boot and the hostname will be adjusted.
So it would be good to know if the /boot/user-data got updated after you executed the flash tool to see if it is something in the flash tool or has something to do with the cloud-init first boot.
[ Quoting [email protected] in "Re: [hypriot/blog] post/setup-kuber..." ]
I tried two RPi3 today, one with --hostname, another with --userdata and --bootconf to spin it up with WiFi enabled. Both first start booting with black-pearl, but when I then log in the new name is activated. The user-data will be executed during the first boot and the hostname will be adjusted.
Thanks!
But how do you log in? I think a major use case is SSH. I couldn't find the Pis on my network with the new hostname, which (now) makes sense they were all called black-pearl.
So it would be good to know if the /boot/user-data got updated after you executed the flash tool to see if it is something in the flash tool or has something to do with the cloud-init first boot.
I don't understand why things are kicked off afer a login and not actually on first boot?
/Miek
-- Miek Gieben
Well I watched the output of the serial console. And there (probably before having network) the machine hostname is black-pearl. The serial login prompt also shows black-pearl in the prompt. But I waited a little and then logged in over serial cable and the bash prompt then shows the new hostname. So it‘s happening during the first boot and probably before you can SSH into it. For the WiFi test I had to use SSH as the UART has to be disabled for onboard WiFi.
[ Quoting [email protected] in "Re: [hypriot/blog] post/setup-kuber..." ]
Well I watched the output of the serial console. And there (probably before having network) the machine hostname is black-pearl. The serial login prompt also shows black-pearl in the prompt. But I waited a little and then logged in over serial cable and the bash prompt then shows the new hostname. So it‘s happening during the first boot and probably before you can SSH into it. For the WiFi test I had to use SSH as the UART has to be disabled for onboard WiFi.
Strange... this def. did not happen here. After I lugged my monitor and keyboard to the room and logged in everything still had black-pearl.
Just came by to say, seconding the use of v0.9.1 for Flannel. Fixed an issue I was having with kube-dns!
EDIT: Well, maybe it didn't fix it, but, kube-dns was fixed after kubeadm reseting for the third time and using v0.9.1. Could be a coincidence, but I don't think it was.
The next HypriotOS release will have UART disabled by default ;-)
@alexellis @StefanScherer I have created this perhaps that someone will find useful:
- https://johnwyles.github.io/posts/setting-up-kubernetes-and-openfaas-on-a-raspberry-pi-cluster-using-hypriot/
Which goes along with some updated YAML and stuff here:
- https://github.com/johnwyles/raspberry-pi-kubernetes-cluster
Thanks @johnwyles that is awesome!