Open wangxm11 opened 5 years ago
什么浏览器?
跟这个文件有关系么,我是从.kube目录下copy出来选中的 google和safari12.1都不好用!
在 2019年5月28日,21:10,Li Yi notifications@github.com 写道:
什么浏览器?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AliyunContainerService/k8s-for-docker-desktop/issues/36?email_source=notifications&email_token=AH7HNDBGGQQ4PNC5REFWEX3PXUVMPA5CNFSM4HQDDUCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWMCF3I#issuecomment-496509677, or mute the thread https://github.com/notifications/unsubscribe-auth/AH7HNDHQTUBIXIFFWQARHTDPXUVMPANCNFSM4HQDDUCA.
对于Mac环境
TOKEN=$(kubectl -n kube-system describe secret default| awk '$1=="token:"{print $2}') kubectl config set-credentials docker-for-desktop --token="${TOKEN}" 对于Windows环境
$TOKEN=((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1] kubectl config set-credentials docker-for-desktop --token="${TOKEN}"
看一下 config 文件中 current-context 是docker-desktop, 还是 docker-for-desktop, 确认下 token 是加在正确 context 下.
ps: Mac 下显示隐藏目录可以用 "CMD+SHIFT+.", 就可以选择.kube 目录了
run in shell
kubectl config current-context
print: "docker-for-desktop" or "docker-desktop"
$TOKEN=((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1]
kubectl config set-credentials docker-for-desktop --token="${TOKEN}"
echo $TOKEN
$TOKEN=((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1]
kubectl config set-credentials docker-desktop --token="${TOKEN}"
echo $TOKEN
- run in shell
kubectl config current-context
print: "docker-for-desktop" or "docker-desktop"
- switch(print)
- case: docker-for-desktop
$TOKEN=((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1] kubectl config set-credentials docker-for-desktop --token="${TOKEN}" echo $TOKEN
- case: docker-desktop
$TOKEN=((kubectl -n kube-system describe secret default | Select-String "token:") -split " +")[1] kubectl config set-credentials docker-desktop --token="${TOKEN}" echo $TOKEN
这样设置的token重启后会失效, 怎么持久化设置呢
MAC 配置了Token还是不好用,求指教!!!