aaronkjones / rpi-k8s-node-prep Goto Github PK
View Code? Open in Web Editor NEWPrepares a Raspberry Pi node for Kubernetes
Prepares a Raspberry Pi node for Kubernetes
Switch case input to simple y/n instead of using default.
https://github.com/aaronkjones/rpi-k8s-node-prep/blob/master/prep.sh#L14
However...
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.14.50-v7+ #1122 SMP Tue Jun 19 12:26:26 BST 2018 armv7l GNU/Linux
pi@raspberrypi:~ $ cat /etc/os-release | grep raspbian;
ID=raspbian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@raspberrypi:~ $ echo "exit code zero would mean success-> $?"
exit code zero would mean success-> 0
Running your script with #!/bin/bash -x
shows:
+ uname -a
+ grep hypriot
+ uname -a
+ grep raspbian
+ [[ '' == \r\a\s\p\b\i\a\n ]]
+ [[ '' == \h\y\p\r\i\o\t ]]
+ echo 'OS type not known'
OS type not known
+ exit 1
From your README:
curl -sL https://raw.githubusercontent.com/aaronkjones/rpi-k8s-node-prep/master/prep.sh | sudo sh
but you use [[
in your script (and have a #!/bin/bash
)
In the least, it should be piping to bash
. But really, you shouldn't do that unless everything in the entire script is wrapped in function definitions and the main
function is called at the very end to ensure that none of it runs until and unless all of it is downloaded.
For example, see the very end of the file at https://get.docker.com/ All the "actions" are in functions. The begining of the file has a bunch of "bare" code in the top scope, but it is just defining variables. Nothing gets executed until do_install
.
apt-cache policy kubeadm | grep "Installed" | cut -d ":" -f 2 | awk '{$1=$1;print}'
If script is run more than once, cgroup settings are added multiple times to /boot/cmdline.txt
Actual output:
5 is currently installed.
Correct output:
18.09.03-0raspbian-stretch
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.