Kubernetes on Novena

From Studio Kousagi Wiki
Revision as of 10:54, 14 March 2017 by Xobs (talk | contribs)
Jump to: navigation, search

Some steps I've taken to install Kubernetes on Debian.

1. Update the key.

 wget http://repo.novena.io/debian/pool/main/k/kosagi-repo/kosagi-repo_1.2-r1_all.deb
 sudo dpkg -i kosagi-repo_1.2-r1_all.deb
 apt-get update
 DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade
 apt-get install apt-transport-https # Used for accessing the newer repos

2. At this point, it's probably a good idea to move to a SATA disk.

 dd if=/dev/mmcblk0 of=/dev/sda bs=1M count=1
 fdisk /dev/sda
 # Re-create partitions 2 and 3.  Make partition 2 at least 6GB
 # for swap (type 82), and make partition 3 the rest of the disk.
 # Type "x" for Expert mode, then "i", and change the ID to 0x4e6f7653.
 # Then "r" to return to the main menu, and "w" to write it to disk.
 mkfs.ext4 /dev/sda3 # or install btrfs-tools or xfsprogs and make a different type
 mount /dev/sda3 /mnt
 rsync -avxHAX --progress / /mnt/
 novena-eeprom -w -f es8328,pcie,gbit,hdmi,eepromoops,sataroot
 reboot

3. Install Docker (borrowed from https://github.com/hypriot/image-builder-odroid-c1/blob/master/builder/chroot-script.sh)

 wget -q https://packagecloud.io/gpg.key -O - | apt-key add -
 echo 'deb https://packagecloud.io/Hypriot/Schatzkiste/debian/ jessie main' > /etc/apt/sources.list.d/hypriot.list
 apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 2C52609D
 echo 'deb [arch=armhf] https://apt.dockerproject.org/repo debian-jessie main' > /etc/apt/sources.list.d/docker.list
 apt-get update
 export DOCKER_ENGINE_VERSION="17.03.0~ce-0~debian-jessie"
 export DOCKER_COMPOSE_VERSION="1.9.0-23"
 export DOCKER_MACHINE_VERSION="0.9.0-39"
 DEBIAN_FRONTEND=noninteractive apt-get install \
   libltdl7 \
   docker-engine="${DOCKER_ENGINE_VERSION}" \
   docker-compose="${DOCKER_COMPOSE_VERSION}" \
   docker-machine="${DOCKER_MACHINE_VERSION}"

4. Install kubeadm

 curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
 echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
 apt-get update && apt-get install -y kubeadm

5. Run kubeadm on the master device to start the cluster. As of this moment, we need to skip preflight checks due to changes in Docker version numbering.

 kubeadm init --pod-network-cidr 10.244.0.0/16 --skip-preflight-checks