itzg / minecraft-server-charts

MIT License
267 stars 142 forks source link

Fix: Make rclone config folder writable #214

Closed FawenYo closed 1 month ago

FawenYo commented 2 months ago

Description

Since Kubernetes will make Secrets volume to be mounted as read-only, when mc-backup is trying to run mkdir in this line, our pod will show the following error:

2024-06-22T00:59:20+0800 INFO sleeping 24h...
2024/06/22 00:59:24 ERROR : Failed to save config after 10 tries: failed to create temp file for new config: open /config/rclone/rclone.conf59648627: read-only file system

To fix this issue, we can create a new empty volume and use InitContainer to copy the content of the Secrets volume to the new volume. Then we can mount the new volume as read-write in the main container.

Proven Image

I've tested this on my environment and now my mc-backup pod can successfully upload the backup to my drive using rclone.

image
FawenYo commented 1 month ago

Hi @itzg, the Helm Chart version is bumped in the commit https://github.com/itzg/minecraft-server-charts/pull/214/commits/bb7dca3de9fdb3988819bda5f98f297c1f31661e