Kubectl로 GKE에게 연락하려면 "error executing access token command"
1163 단어 KubernetesGoogle CloudGKEtech
error executing access token command가 나와서 해결했어요.이벤트
오랜만에 Kubectl로 GKE에 연락하려다 다음과 같은 오류가 발생해 곤란했다.
$ kubectl get po --context gke_xxxxx_asia-northeast1_xxxxx
Unable to connect to the server: error executing access token command /snap/google-cloud-sdk/132/bin/gcloud config config-helper --format=json: err=fork/exec /snap/google-cloud-sdk/132/bin/gcloud: no such file or directory output= stderr=
해결하다
~/.kube/config의users.[当該のuser].auth-provider.config.cmd-path는 /snap/google-cloud-sdk/132/bin/gcloud로 수정되었다.이벤트 및 해결 지침
kubectl을 통해 GKE에 연결하려고 할 때,kubectl이 지정한 상하문 인증에 사용할 사용자의 명령을 실행하려고 합니다.
인증용 명령은
/snap/bin/gcloud의 ~/.kube/config에 기록되어 있으며 이것은 오래된 경로입니다.스냅으로 Google Cloud SDK를 설치했기 때문에 각종 포장을 업데이트할 때 낡은 바이너리가 삭제되었지만, 그때
users.[当該のuser].auth-provider.config.cmd-path는 자동으로 고쳐지지 않았을 것 같습니다.(Snap이 Kubernetes를 모르는 것은 당연한 일입니다.)Snap에 설치된 gcloud 명령은
~/.kube/config에서 참조할 수 있기 때문에 명령의 경로를 이렇게 덮어쓰면 앞으로 다시 업데이트할 때도 문제가 발생하지 않는다.
Reference
이 문제에 관하여(Kubectl로 GKE에게 연락하려면 "error executing access token command"), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://zenn.dev/enk/articles/ae70aa04398dc43e3c4a텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)