{"version":"1.0","type":"rich","title":"Obtain GKE Basic Auth Credentials and use them","description":"This example demonstrates how to obtain GKE basic authentication credentials from a cluster’s metadata and use them to construct a kubeconfig file for subsequent kubectl commands. The script fetches the cluster metadata via `gcloud container clusters describe`, then uses `jq` to extract the CA certificate, endpoint, and password. It writes a kubeconfig file with the admin username and password, then runs `kubectl get clusterroles` against that config to verify access. The code relies on the Google Cloud CLI and `jq` for JSON parsing.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-f64667074b6c647c69d9890a30d624e2?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}