69,00 zł Sandisk Extreme Pro A2 64GB https://www.x-kom.pl/p/451874-karta-pamieci-microsd-sandisk-64gb-microsdxc-extreme-pro-170mb-s-a2-c10-v30.html
https://www.armbian.com/odroid-n2/ Armbian_21.08.1_Odroidn2_bullseye_current_5.10.60.img.xz https://forum.armbian.com/topic/9057-install-script-gen-new-machine-id-and-ssh-host-keys-and-maybe-other-machine-specific-items/
(follow armbian documentation) Setup root password and user account
- hostname
- timezone
- apt mirror sources
- install docker
sudo usermod -aG docker $USER
- In cfdisk change partition type to Linux and write
- disconnect/connect USB cable
mkfs.ext4 /dev/sdb1
e2label /dev/sda1 TOSHIBA_2TB
- get UUID:
blkid
- prepare mount dir
sudo mkdir /mnt/hdd
- prepare entry
UUID="54785f3a-061e-43c8-8745-2a1fa28f3682" /mnt/hdd ext4 defaults,noatime 0 1
- mount
sudo mount /mnt/hdd
- allow writes for user
sudo chmod 777 /mnt/hdd
- create exported dir
sudo mkdir -p /mnt/hdd/exported
sudo chmod -R ugo+rwX /mnt/hdd/exported
sudo chown -R nobody:nogroup /mnt/hdd/exported/
sudo setfacl -Rm u::rwX,g::rwX,o::rwX,d:u::rwX,d:g::rwX,d:o::rwX /mnt/hdd/exported
https://wiki.debian.org/NFSServerSetup
https://forum.armbian.com/topic/1482-howto-nfs-server-and-client-configuration/
https://zsitko.com/nfs-file-sharing-server-raspberry-pi/
https://ubuntu.com/server/docs/service-nfs
apt install nfs-common nfs-kernel-server
# apt install nfs-common nfs-kernel-server portmap
# echo "portmap: 192.168.1." >> /etc/hosts.allow
# systemctl restart portmap
# echo "/mnt/hdd/exported 192.168.1.0/24(rw,all_squash,nohide,insecure,async,no_subtree_check)" >> /etc/exports
echo "/mnt/hdd/exported *(rw,all_squash,anonuid=1000,anongid=1000,nohide,insecure,async,no_subtree_check)" >> /etc/exports
exportfs -a
systemctl restart nfs-kernel-server
apt install nfs-common
mkdir /tmp/nfs_test
mount -t nfs -o vers=4 odroid1.lan:/mnt/hdd/exported /tmp/nfs_test
apt install nfs-common
mkdir -p /mnt/hdd/exported
fstab entry
odroid1.lan:/mnt/hdd/exported /mnt/hdd/exported nfs defaults,noatime 0 0
https://wiki.debian.org/Samba/ServerSimple install with armbian config
- add share to config vim /etc/samba/smb.conf
[exported]
comment = Whole read-only storage
path = /mnt/hdd/exported
public = yes
guest ok = yes
browseable = yes
writable = no
[writable_smb]
comment = Storage writable from samba
path = /mnt/hdd/exported/writable_smb
public = yes
guest ok = yes
browseable = yes
writable = yes
create mask = 0666
directory mask = 0777
[custom_dir]
comment = readable custom_dir
path = /mnt/hdd/exported/custom_dir/
public = yes
guest ok = yes
browseable = yes
writable = no
- restart server
systemctl restart smbd
sudo apt install samba sudo usermod -aG adm,dialout,fax,cdrom,floppy,tape,sudo,audio,dip,video,plugdev,netdev,lpadmin,scanner,sambashare,docker $USER
https://wiki.debian.org/vsftpd
- install
apt install vsftpd
- configure uncomment write_enable=YES and enable access for other users (nobody:nogroup) from nfs
vim /etc/vsftpd.conf
...
uncomment write_enable=YES
ucomment local_umask=000
....
systemctl restart vsftpd
https://k3s.io/ https://www.polarsparc.com/xhtml/Practical-K8S-N2.html
- prepare machine id
root@odroid1 /m/h/e/shared_odroid# cat setup_hostname.sh
#!/bin/bash
rm -f /etc/machine-id
dbus-uuidgen --ensure=/etc/machine-id
rm /var/lib/dbus/machine-id
dbus-uuidgen --ensure
cat /etc/machine-id
- disable swap
vim /etc/default/armbian-zram-config
uncomment SWAP=false
reboot
- install master node
curl -sfL https://get.k3s.io | sh -
k3s kubectl get node
cat setup_k3s_master.sh
#!/bin/bash
K3S_KUBECONFIG_MODE="644"
curl -sfL https://get.k3s.io | sh -
echo ""
ip addr show dev eth0
echo ""
echo "K3S_TOKEN=$(cat /var/lib/rancher/k3s/server/node-token)"
cat setup_k3s_worker.sh
#!/bin/bash
K3S_KUBECONFIG_MODE="644"
K3S_TOKEN=<COPY FROM MASTER NODE>
K3S_URL=https://192.168.1.31:6433
curl -sfL https://get.k3s.io | sh -
scp root@odroid1.lan:/etc/rancher/k3s/k3s.yaml ~/.kube/config
vim ~/.kube/config
change server address server: https://odroid1.lan:6443