1 个回答

有时候我们希望在操作kubernetes命令的时候,所有的操作都是基于同一个namespace来操作,这时我们可以直接设置下当前默认的namespace。操作命令是:
当看到Context "kubernetes-admin@cluster.local" modified.的提示就代表当前默认的名称空间设置完了。

kubectl config set-context --current --namespace=${namespace}
例如: kubectl config set-context --current --namespace=kuboard
当看到Context "kubernetes-admin@cluster.local" modified.的提示就代表当前默认的名称空间设置完了。

发布于:3年前 (2022-10-26) IP属地:四川省
我来回答
您需要 登录 后回答此问题!