kubectl run is deprecated - looking for alternative

后端 未结 7 567
长情又很酷
长情又很酷 2020-12-23 13:48

I\'m using kubectl run with environment parameters to create temporary docker containers for me (e.g. some forwarding for debugging purposes). Since several wee

相关标签:
7条回答
  • 2020-12-23 14:34

    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:

    1. 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.

    2. 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.

    0 讨论(0)
提交回复
热议问题