Build and upload a docker image to the registry of your choice.
docker build -t YOUR_REGISTRY/USERNAME/timemachine:TAGdocker push YOUR_REGISTRY/USERNAME/timemachine:TAG
Note: You should replace the given secret within the Dockerfile (line:31) with something more safe. May consider researching docker BuildKit and secrets.
Make sure to replace the {{USER}} field in the three yamls and define a proper persistentvolumeclaim size. Then run:
kubectl create -n NAMESPACE_NAME -f timemachine-volume-persistentvolumeclaim.yamlkubectl create -n NAMESPACE_NAME -f timemachine-service.yamlkubectl create -n NAMESPACE_NAME -f timemachine-deployment.yaml
In order to allow write rights you have to modifiy the directory permissions right in the volume. Therefore:
kubectl get podsreturns the pod nameskubectl exec -it <POD NAME> sh- In the pod:
cd backup chmod 700 timemachine/chown timemachine timemachine/
After the configuration you can mount the server via finder (cmd+k). You now can enable Timemachine on the Volume. Make sure to auto start/login the server and the volume! (System Preferences -> Users & Groups -> Login Items)
sudo tmutil setdestination /Volumes/<VOLUME NAME>
Set the default limit for timeMachine to specific/defined size to avoid capacity problems.
defaults write /Library/Preferences/com.apple.TimeMachine MaxSize 1000000
The NodePort will be defined automatically. You should manually add the given port to the timemachine-service.yaml after the assign.
Keychain Access may saves the wrong URL, if you click on connect and let TimeMachine automatically set the user and password. Make sure the URL includes the correct port.