kutectl的使用

2019-11-04  本文已影响0人  无知者云
kubectl config set-cluster my-other-cluster 
\ --server=https://k8s.example.com:6443
\ --certificate-authority=path/to/the/cafile
kubectl config set-credentials foo --username=foo --password=pass
kubectl config set-context some-context 
\ --cluster=my-other-cluster 
\ --user=foo 
\ --namespace=bar
kubectl config current-context
kubectl config use-context my-other-context
kubectl config set-context minikube --namespace=another-namespace
alias kcd='kubectl config set-context $(kubectl config current-context) --namespace '

You can then switch between namespaces with kcd some- namespace.

kubectl config get-clusters
kubectl config get-contexts
export KUBECONFIG=~/.kube/config2
上一篇 下一篇

猜你喜欢

热点阅读