Closed Sayrus closed 5 days ago
Thanks for opening this issue. As we discussed async on ~Slack~ Email, I agree with that probes should be manageable via flag because I don't think --custom
flag will ever be able to support removal of fields;
/triage accepted
/priority backlog
This is fixed by https://github.com/kubernetes/kubernetes/pull/123149
The referenced PR seems to be merged. I'm closing this. Feel free to reopen, if I'm missing something. Thank you.
/close
@ardaguclu: Closing this issue.
What would you like to be added: A way to remove fields from containers when using
kubectl debug --copy-to
using--custom
patches.Why is this needed: When using
kubectl debug
with the--copy-to
option, everything from the original pod is copied. In my case, this includes livenessProbe and readinessProbe. In many cases, these probes fail. For instance:--image
or simplyCOMMAND [args...]
)Thanks to KEP-4292 implemented behind a flag here, it is now possible to rewrite fields so we can "disable" probes by setting a very high initial delay instead. It also allows overwriting environment variable and other stuffs. Unfortunately, since we can't unset fields, we can't do things such as adding an
exec
probe to a pod withhttpGet
probe (as it results in a spec with bothhttpGet
andexec
which is invalid)The specific case of probes can be mitigated by using a profile that automatically removes probes (such as
general
) but this introduces some other limitations if your debugging job requires other capabilities.I saw https://github.com/kubernetes/kubernetes/pull/123149 which implements this using
--keep-*
parameters. For my use-case and I would prefer being able to distribute custom profiles as YAML or JSON as it allows non power-user to use different debugging profiles without changing several kubectl arguments.For client-side patching, Strategic Merge Patch directives are used (or used to? I know it exists as well in Kustomize.). Following this document, a patch to remove probes and a specific env variable could look like: