As the author of the problem let me explain a little bit the intention behind this deprecation. Just like Brendan explains in his answer, kubectl run
per se is not being deprecated, only all the generators, except for the one that creates a Pod for you.
The reason for this change is two folds:
The vast majority of input parameters for kubectl run
command is overwhelming for newcomers, as well as for the old timers. It's not that easy to figure out what will be the result of your invocation. You need to take into consideration several passed options as well as the server version.
The code behind it is also a mess to maintain given the matrix of possibilities is growing faster than we can handle.
That's why we're trying to move people away from using kubectl run
for their daily workflows and convince them that using explicit kubectl create
commands is more straightforward. Finally, we want to make the newcomers that played with docker or any other container engine, where they run a container, to have the same experience with Kubernetes where kubectl run
will just run a Pod in a cluster.
Sorry for the initial confusion and I hope this will clear things up.
UPDATE (2020/01/10): As of https://github.com/kubernetes/kubernetes/pull/87077 kubectl run
will ONLY create Pods. All generators will be removed entirely.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…