我有一个kubernetes Config文件,如:
apiVersion: v1
kind: Config
preferences: {}
contexts:
- context:
cluster: test-sim-development
namespace: test-sim
user: developer
name: test-sim当我发出命令时,例如:
kubectl config --kubeconfig infra_k8/config.yaml set-context test-sim && kubectl config use-context test-sim我得到以下错误输出:
Context "test-sim" modified.
error: no context exists with the name: "test-sim"为什么它找不到"test-sim“的名字?它是根据库伯奈茨医生。明确引用的
发布于 2020-08-30 05:50:15
您似乎试图通过设置上下文来更改配置,而不是将配置提供给context命令。所以做这个
kubectl config --kubeconfig=infra_k8/config.yaml use-context test-sim当您想要向配置文件中添加更多条目时,将使用setter,因此在更改上下文时不需要该命令。
https://devops.stackexchange.com/questions/12303
复制相似问题