Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access GCP Cloud DNS from pods on GKE

I’m investigating this letsencrypt controller (https://github.com/tazjin/kubernetes-letsencrypt).

It requires pods have permission to make changes to records in Cloud DNS. I thought with the pods running on GKE I’d get that access with the default service account, but the requests are failing. What do I need to do do to allow the pods access to Cloud DNS?

like image 644
Andy Hume Avatar asked Sep 27 '16 09:09

Andy Hume


1 Answers

The Google Cloud DNS API's changes.create call requires either the https://www.googleapis.com/auth/ndev.clouddns.readwrite or https://www.googleapis.com/auth/cloud-platform scope, neither of which are enabled by default on a GKE cluster.

You can add a new Node Pool to your cluster with the DNS scope by running:

gcloud container node-pools create np1 --cluster my-cluster --scopes https://www.googleapis.com/auth/ndev.clouddns.readwrite

Or, you can create a brand new cluster with the scopes you need, either by passing the --scopes flag to gcloud container clusters create, or in the New Cluster dialog in Cloud Console, click "More", and set the necessary scopes to "Enabled".

like image 60
CJ Cullen Avatar answered Sep 23 '22 00:09

CJ Cullen