kubectl-aliases
kubectl-aliases copied to clipboard
kubectl exec [POD] [COMMAND] is DEPRECATED
When running a command like kexn test varnish-529679cb57-mjn62 bash
it translates to kubectl exec -i -t --namespace test varnish-529679cb57-mjn62 bash
and kubectl returns a deprecation warning:
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl kubectl exec [POD] -- [COMMAND] instead.
The problem is that --namespace
is a positional argument, but to fix this issue it will need to not be last, but come before the --
. See https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#exec
I believe this is something we cannot fix. Take this for example:
alias kex='kubectl exec -i -t'
Because you need to provide POD
before --
, alias cannot add that --
for you. We need a bash function for that.
Though, I'm not planning to add bash functions, and I might actually remove exec functionality from this since there are only 2 aliases about this kex
and kexn
. Thoughts?
@ahmetb , I think kex
and kexn
are great aliases. If the user adds the -- between pod's name and the command, then the deprecation warning is not shown. Maybe you could just add a note in README.md about this issue