I am currently getting my kubeconfig files for my GKE clusters via
export KUBECONFIG=<config-path>
gcloud container clusters get-credentials cluster-name --region=region-name
Now I get the config files and I can use them.
However, for some applications it would be helpful to have hardcoded credentials and not those appearing here
...
users:
- name: user-name
user:
auth-provider:
config:
access-token: <access-token>
cmd-args: config config-helper --format=json
cmd-path: /Users/user-name/google-cloud-sdk/bin/gcloud
expiry: "2022-08-13T18:27:44Z"
expiry-key: '{.credential.token_expiry}'
token-key: '{.credential.access_token}'
name: gcp
Is there an elegant way to do it? Could also be via a service account or whatever, I am open to any thoughts. The only thing that matters to me is to have a kubeconfig file that I can share and everyone can make use of it, once the user has it in his hands.