better clusterIP filtering logic, add default services#61
better clusterIP filtering logic, add default services#61memory wants to merge 3 commits intopieterlange:masterfrom
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=Truein 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