Connecting to cluster nodes through google cloud functions

3/5/2019

So I've been looking into simplifying some of our project solutions and by the look of it, google cloud functions has the potential to simplify some of our current structure. The main thing I'm curious about is if GCF is able to connect to internal nodes in a Kubernetes cluster hosted in google cloud?

I'm quite the rookie on this so any input is greatly appreciated.

-- Coss
google-cloud-functions
google-cloud-platform
kubernetes

1 Answer

10/18/2019

Google Cloud has a beta (as of this writing) feature called Serverless VPC Access that allows you to connect your serverless features (Cloud Functions, App Engine Standard) to the VPC network where your GKE cluster is. This would allow you to access private IPs of your VPC network from Cloud Functions.

You can read the full setup instructions but the basic steps are:

  • Create a Serverless VPC Access Connector (under the "VPC Network -> Serverless VPC Access" menu in the console)
  • Grant the cloud function's service account any permissions it will need. Specifically, it will at least need "Project > Viewer" and "Compute Engine > Compute Network User".
  • Configure the function to use the connector. (In the console, this is done in the advanced settings's "VPC Connector" field).
-- robsiemb
Source: StackOverflow