http://wiki.friendlyarm.com/wiki/index.php/NanoPi_NEO2#UbuntuCore_16.04
Follow instructions to download image - nanopi-neo2_sd_friendlycore-xenial_4.14_arm64_20181011.img
Write it to SD card (8 GB Min) with Win32 disk imager and put it into NanoPi. Connect to network, boot up and login with root/fa
adduser username
# ^^ Do not forget to assign this user to sudoers.
usermod -a -G sudo username
usermod -a -G ssh username
# change root password
passwd
# change hostname of node. With NanoPi you can do it with utility:
sudo npi-config
# from your workstation
ssh-copy-id username@node
Next you have to assign your node fixed IP address. Make sure you write this address in file - /etc/hosts
# as root user
apt-get update && apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb https://apt.kubernetes.io/ kubernetes-xenial main
EOF
apt-get update
apt-get install -y kubectl
-
Download binary from https://github.com/rancher/k3s/releases/download/v0.1.0/k3s-arm64
-
Follow instructions here
https://github.com/rancher/k3s
sudo vim /lib/systemd/system/k3s.service
# Add next file (add "agent" option to slave nodes)
[Unit]
Description=Lightweight Kubernetes
Documentation=https://k3s.io
After=network.target
[Service]
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/bin/k3s server
KillMode=process
Delegate=yes
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
[Install]
WantedBy=multi-user.target
# End of file
# Enable and start service
sudo chmod 755 /lib/systemd/system/k3s.service
sudo systemctl enable k3s.service
sudo systemctl start k3s.service
sudo journalctl -f -u k3s.service