-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
better clusterIP filtering logic, add default services #61
base: master
Are you sure you want to change the base?
Conversation
- 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](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) 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 a few more default resource types to back up: - [backendconfigs](https://cloud.google.com/kubernetes-engine/docs/concepts/backendconfig) - [serviceaccount](https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/)
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. |
- remove backendconfig from default resource set; it's a gke-only thing presently - add "EXTRA" env vars for the resource list variables so that they can be appended to as well as overwritten.
@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? |
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() sothat 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