kube-backup
kube-backup copied to clipboard
better clusterIP filtering logic, add default services
-
pull the inline python one-liner out into a separate script so that we can:
-
apply better logic around filtering out service.spec.clusterIP: if the value is "None" that's a headless service and not preserving the value will result in the creation of a NON-headless service, which is likely to be extremely wrong.
-
set
explicit_start=True
in the call to pyyaml.safe_dump() so that backup files can be safely concatenated together -
add serviceaccount to the list of default resources
-
update the README with the current defaults
-
add
EXTRA_
env vars for the resource lists so that they can be appended to as well as overwritten
n.b. I spent a little bit of time trying to figure out if there was a straightforward way of doing a conditional key deletion in JQ's query language and did not make much progress, but I won't claim that it's not possible.
Excellent, good catch on the headless services! This script was written before those existed..
Could you remove backendconfigs from the default resources though? Its not portable.
Fair enough about the backendconfig, and this reminded me that I wanted to also make it a little easier to simply append to the resource list rather than overwrite it.
@pieterlange comments addressed, look good?
Sorry for the delay. Looks good, but i'm gonna try to catch this logic in jq instead so we don't deviate too much from the "this is just a shellscript project" concept. Will merge after i've done that.
Ping? :)
Poke -- did you have any luck trying to port this logic into jq?