update scripts for ubuntu
diff --git a/scripts/network-config b/scripts/network-config
new file mode 100644
index 0000000..bfd94c5
--- /dev/null
+++ b/scripts/network-config
@@ -0,0 +1,22 @@
+# This file contains a netplan-compatible configuration which cloud-init
+# will apply on first-boot. Please refer to the cloud-init documentation and
+# the netplan reference for full details:
+#
+# https://cloudinit.readthedocs.io/
+# https://netplan.io/reference
+#
+# Some additional examples are commented out below
+
+network:
+ version: 2
+ ethernets:
+ eth0:
+ dhcp4: true
+ optional: true
+ wifis:
+ wlan0:
+ optional: true
+ dhcp4: true
+ access-points:
+ "SSID":
+ password: "PSSWD"
diff --git a/rpi/setup.sh b/scripts/raspberry-pi.sh
similarity index 61%
rename from rpi/setup.sh
rename to scripts/raspberry-pi.sh
index 1565d8a..3743ca1 100644
--- a/rpi/setup.sh
+++ b/scripts/raspberry-pi.sh
@@ -1,8 +1,11 @@
+### Ubuntu 18.04 https://dev.to/wesleybatista/setup-raspberry-pi-3-model-b-with-ubuntu-server-and-ssh-over-wifi-4d41
+
### setup rpi connectivity
## enable wifi and ssh
# host
-# set ssid/psswd in wpa_suplicant.conf
-cp wpa_supplicant.conf /Volumes/boot/
+# set ssid/psswd in wpa_suplicant.conf/network-config
+# Raspbian - cp wpa_supplicant.conf /Volumes/boot/
+# Ubuntu - sudoedit /etc/netplan/50-cloud-init.yaml and copy network-config into it
touch /Volumes/boot/ssh
## attach rpi to ip address
# sudo add rpi to /etc/hosts
@@ -14,21 +17,20 @@
# rpi
sudo adduser pcloud
sudo usermod -aG sudo pcloud
+sudoedit /boot/firmware/cmdline.txt # append cgroup_memory=1 cgroup_enable=memory
+sudo shutdown -r now
## install k3s without traefik
# pcloud@rpi
-curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --no-deploy traefik" sh
+curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --no-deploy traefik" K3S_KUBECONFIG_MODE="644" sh
## copy kubeconfig on host
# pcloud@rpi
-sudo cp /etc/rancher/k3s/k3s.yaml ~/
-sudo chown pcloud k3s.yaml
+sudo chown pcloud /etc/rancher/k3s/k3s.yaml
# host
-scp pcloud@rpi:k3s.yaml ~/.k3s.kubeconfig
+scp pcloud@rpi:/etc/rancher/k3s/k3s.yaml ~/.k3s.kubeconfig
sed -i -e 's/127\.0\.0\.1/rpi/g' ~/.k3s.kubeconfig
printf "\n\n#k3s kubeconfig\nexport KUBECONFIG=~/.k3s.kubeconfig\n" >> ~/.bash_profile
source ~/.bash_profile
kubectl get pods -A
-# pcloud@rpi
-rm k3s.yaml
diff --git a/rpi/wpa_supplicant.conf b/scripts/wpa_supplicant.conf
similarity index 100%
rename from rpi/wpa_supplicant.conf
rename to scripts/wpa_supplicant.conf