Connect local instance of kubectl to GKE cluster without using gcloud tool?

后端 未结 3 713
猫巷女王i
猫巷女王i 2021-02-05 21:24

Does anyone know how to connect a local instance of kubectl to a Google Kubernetes Engine (GKE) cluster, without using the gcloud tool locally?

3条回答
  •  心在旅途
    2021-02-05 22:03

    So I have created this tool called gke-kubeconfig to do so. I basically reverse engineered gcloud and did the same. It requests a short term token first and then use it to get the cluster data and create kube config.

    You need to make sure that the token does not expire while you are using the config file, it currently expires after 1 hour so usually it shouldn't be a problem.

    I have also created mie00/gke-kubeconfig to use in my CI pipeline.

提交回复
热议问题