'Create a gke pod from a google cloud function

I want to create a google cloud function to create pods on my gke cluster. I use the python kubernetes client to create them (I don't know if there is a better way to achive this).

Normally I would use the command: gcloud container clusters get-credentials cluster_name --region=cluster_region but cloud sdk is not installed in the cloud function environment.

I've read the python api documentation and I found that it is possible to pass the path to the kubeconfig file, but I didn't found how to create that file



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source