[Kubernetes] The Future of Kubectl Run 已不推薦使用,在未來版本可能會失效
- The Future of kubectl run
- Right now (1.12-1.15) run is in a stage of flux
- The goal is to reduce to creating Deployments (with the warning)
- Right now it defaults to creating Deployments (with the warning)
- It has lots of generators but they are all deprecated
- The idea is to make it easy like docker run for one-off tasks
- It's not recommended for production
- Use for simple dev/test or troubleshooting pods
- Old Run Confusion 目前已不推薦使用 kubectl run,只是略作介紹
- The generators activate different Controllers based on options
- Using dry-run we can see which generators are used
kubectl run test --image nginx --dry-run
kubectl run test --image nginx --port 80 --expose --dry-run
kubectl run test --image nginx --restart OnFailure --dry-run
kubectl run test --image nginx --restart Never --dry-run
kubectl run test --image nginx --schedule "*/1 * * * *" --dry-run
- End