k8s-for-docker-desktop icon indicating copy to clipboard operation
k8s-for-docker-desktop copied to clipboard

Not enough data to create auth info structure

Open wangxm11 opened this issue 5 years ago • 6 comments

image MAC 配置了Token还是不好用,求指教!!!

wangxm11 avatar May 28 '19 12:05 wangxm11

什么浏览器?

denverdino avatar May 28 '19 13:05 denverdino

跟这个文件有关系么,我是从.kube目录下copy出来选中的 google和safari12.1都不好用! image

在 2019年5月28日,21:10,Li Yi [email protected] 写道:

什么浏览器?

— 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.

wangxm11 avatar May 28 '19 13:05 wangxm11

对于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}"

kinjes avatar Jun 26 '19 15:06 kinjes

看一下 config 文件中 current-context 是docker-desktop, 还是 docker-for-desktop, 确认下 token 是加在正确 context 下.

ps: Mac 下显示隐藏目录可以用 "CMD+SHIFT+.", 就可以选择.kube 目录了

shenyyi avatar Oct 03 '19 05:10 shenyyi

  1. run in shell
kubectl config current-context

print: "docker-for-desktop" or "docker-desktop"

  1. 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

fuxingZhang avatar Apr 13 '20 08:04 fuxingZhang

  1. run in shell
kubectl config current-context

print: "docker-for-desktop" or "docker-desktop"

  1. 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重启后会失效, 怎么持久化设置呢

jiangzm avatar Oct 06 '21 10:10 jiangzm