Modify the values.yaml file to set the configuration
We’re going to set the syncthing configuration within the container.
1 2 3
tar -xvf ./syncthing-15.0.1.tgz cd syncting cat values.yamls
Make the data directory
1 2 3 4 5
mkdir /path/to/ chown -R 777 /path/to/
mkdir /path/to/data chown -R 777 /path/to//data
Create Persistent Volumes and Persistent Volume Claims
If the Syncthing configuration files are on a different disk than your files and the harddisk containing your files fails to mount, Syncthing can think you deleted all your files. Syncthing will then tell the other nodes to delete all files in that directory. To prevent this issue, we will store the configuration along with the files. If the harddisk does not mount the entire node will disappear and will not corrupt any other Syncthing nodes.
Error from server (BadRequest): container in pod is waiting to start: ContainerCreating
You probably need to change the permissions on the PV directory. This path is what is written in the PersistentVolume variable. A quick chmod -R 777 to this path will most likely fix the issue. The conatiner should update the permissions once it runs for the first time.
Service yaml file
We need to expose the service to the outside world. Thankfully microk8s has a built in loadbalancer called metallb
PORTA TCP – Webserver/HTTP PORTB TCP/UDP – TCP - TCP based sync protocol traffic, UDP - QUIC based sync protocol traffic PORTC UDP – for discovery broadcasts on IPv4 and multicasts on IPv6
This assumes you are using ufw. ufw is bascally a wrapper for IPTABLES. If you have ever used IPTABLES before you understand why ufw exists. https://docs.syncthing.net/users/firewall.html
1 2 3 4 5 6 7 8 9
sudo ufw default allow routed
sudo ufw allow from A.B.C.D/24 to any port PORTA proto tcp sudo ufw allow from 0.0.0.0/24 to any port PORTB proto tcp sudo ufw allow from 0.0.0.0/24 to any port PORTB proto udp sudo ufw allow from 0.0.0.0/24 to any port PORTC proto udp