blog icon indicating copy to clipboard operation
blog copied to clipboard

post/setup-kubernetes-raspberry-pi-cluster needs a bit of updating

Open miekg opened this issue 7 years ago • 15 comments

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 -n option didn't work for me (got an error after flashing, assumed it was ok), but the hostname was still the default.

miekg avatar Dec 14 '17 14:12 miekg

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.

MathiasRenner avatar Dec 14 '17 15:12 MathiasRenner

@miekg Thanks for the feedback. Regarding the flash -n option: which SD card image have you used?

StefanScherer avatar Dec 16 '17 07:12 StefanScherer

[ 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

miekg avatar Dec 16 '17 08:12 miekg

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 :-)

StefanScherer avatar Dec 17 '17 14:12 StefanScherer

Thanks for double checking.

  • What does the -f option 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...

miekg avatar Dec 17 '17 15:12 miekg

uh, second one needs to be /etc/hosts, but that also lists black-pearl as 127.0.1.1

miekg avatar Dec 17 '17 15:12 miekg

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.

StefanScherer avatar Dec 17 '17 16:12 StefanScherer

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.

StefanScherer avatar Dec 18 '17 18:12 StefanScherer

[ 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

miekg avatar Dec 18 '17 18:12 miekg

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.

StefanScherer avatar Dec 18 '17 20:12 StefanScherer

[ 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.

miekg avatar Dec 18 '17 21:12 miekg

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.

dvdmuckle avatar Dec 24 '17 00:12 dvdmuckle

The next HypriotOS release will have UART disabled by default ;-)

StefanScherer avatar Mar 22 '18 08:03 StefanScherer

@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

johnwyles avatar Mar 26 '19 22:03 johnwyles

Thanks @johnwyles that is awesome!

StefanScherer avatar Mar 27 '19 10:03 StefanScherer