This repo is used to install Kubernetes on an OrangePI PC2 cluster. The boards are running Armbian.
Download image from:
https://dl.armbian.com/orangepipc2/Ubuntu_xenial_next.7z
Login as root:
Initit script will:
- Ask you to change root password
- Ask you to create a user:
pi
- Set hostname:
hostnamectl set-hostname yourHostName
sudo usermod -aG sudo pi
echo "pi ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/pi
sudo chmod 0440 /etc/sudoers.d/pi
sudo reboot
Login as pi
:
mkdir -p /home/pi/.ssh
curl https://github.com/ewoutp.keys > /home/pi/.ssh/authorized_keys
chmod -R og-rwx /home/pi/.ssh
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y overlayroot
sudo systemctl disable zram-config.service
(
echo t # Set type
echo 83 # Type linux
echo w # Write & exit
) | sudo fdisk /dev/sda
sudo mkfs.ext4 -F /dev/sda1
sudo mkdir -p /mnt/data
echo "UUID=$(sudo blkid /dev/sda1 -s UUID -o value) /mnt/data ext4 defaults,noatime,nodiratime 0" | sudo tee -a /etc/fstab
sudo mount -a
function moveToBind {
src=$1
dst=$2
[ -d $src ] || sudo mkdir -p $src
sudo mkdir -p $(dirname $dst)
sudo mv $src $dst
sudo mkdir -p $src
sudo mount -o bind $dst $src
echo "${dst} ${src} none bind 0 0" | sudo tee -a /etc/fstab
}
moveToBind /var/log /mnt/data/var/log
moveToBind /var/lib/docker /mnt/data/var/lib/docker
moveToBind /var/lib/etcd /mnt/data/var/lib/etcd
Clone this repo and cd into it.
./setup_docker.sh
./setup_kubernetes_tools
on master:
sudo kubeadm init --pod-network-cidr=10.244.0.0/16
echo 'overlayroot="tmpfs:recurse=0"' | sudo tee /etc/overlayroot.conf
sudo reboot