AliyunContainerService / k8s-for-docker-desktop

为Docker Desktop for Mac/Windows开启Kubernetes和Istio。
https://yq.aliyun.com/articles/672675
4.96k stars 1.12k forks source link

Not enough data to create auth info structure #36

Open wangxm11 opened 5 years ago

wangxm11 commented 5 years ago
image

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

denverdino commented 5 years ago

什么浏览器?

wangxm11 commented 5 years ago

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

image

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

kinjes commented 5 years ago

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

shenyyi commented 5 years ago

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

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

fuxingZhang commented 4 years ago
  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
jiangzm commented 3 years ago
  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重启后会失效, 怎么持久化设置呢