palworld-server-docker
palworld-server-docker copied to clipboard
[Kubernetes] backup before a container is terminated
Incorporate backup functionality before the termination of a container due to API requests or management events such as liveness/startup probe failure, preemption, resource contention, and others.
Choices
- Add backup before a container is terminated.
- Addressing https://github.com/thijsvanloef/palworld-server-docker/issues/243#issue-2110148331
- Refer to https://github.com/thijsvanloef/palworld-server-docker/pull/206#issue-2105868641
Test instructions
- I haven't tested it yet. I'll conduct the test in a few days.
Checklist before requesting a review
- [ ] I have performed a self-review of my code
- [ ] I've added documentation about this change to the README.
- [x] I've not introduced breaking changes.
Considering this would need RBAC (and kubectl in the container) it would be probably be better to just execute a script in the container
Considering this would need RBAC (and kubectl in the container) it would be probably be better to just execute a script in the container
I just realized that I am running inside a pod, so there is no need to execute kubectl. Thank you for your advice. But I haven't come up with a better method to determine the pod is unhealthy.
Perhaps a livenessProbe for the RCON port can be configured, but I'm not sure about the correlation between the server and RCON.
livenessProbe:
tcpSocket:
port: 25575
initialDelaySeconds: 30
periodSeconds: 60
Good point 👍🏼 I think we just address the probe(s) in another PR as that may be tricky. I'll try to think about a solution. This looks good! Should we also add a /Shutdown to the rcon commands?
After a liveness probe failure, the pod will be restarted. I think it may not be necessary. I might conduct a test using Minikube in the next few days.
@win5923 Just give me a headsup when it is ready to merge :)
@win5923 Just give me a headsup when it is ready to merge :)
Done!
This doesn't work. exec only takes a command not a command and args
This doesn't work. exec only takes a command not a command and args
Oh, you're right. I forgot to save before applying. No wonder I was able to apply successfully. I will resubmit a new pull request to correct this error. Thank you very much.