Does Google Container Engine SDK/API exist?

4/3/2017

I am planning to launch container cluster from an SDK/API. Presently, I am fine with any language, but I prefer NodeJS SDK. As far as I have seen, I could not find any Container engine SDK. Here is the NodeJS SDK for GCP which does not contain container engine. In fact it contains SDK only for very few GCP services.

I came across OAuth API for container engine but it involves human intervention to launch it. I am looking for service account based authentication for the SDK.

Are there container engine SDKs available ?

Update after discussion with Robert Lacok:

This is the code I tried to use for container APIs with API-key, it does not work. It expects Oauth 2 token, or some other credentials other than Service account. I tried API-key it didnt work. I dont know how to use Service account authentication with the API.

Here is my source code:

code

Here is the error:

error

I see a method for Application Default credentials. But I dont think so it will be useful for my use-case. I am trying to create container cluster from AWS Lambda. So, I cant use application default credentials. Is there any other options ?

-- Lakshman Diwaakar
google-api
google-api-client
google-api-python-client
google-cloud-platform
google-kubernetes-engine

2 Answers

4/3/2017

What you probably want to do is making calls to the REST API and using the client library for OAuth2 authentication.

You can browse the API documentation and see that every method has a short how-to for a number of languages, NODE.JS being one of them. Have a look here for an example on how to create a container cluster.

You also mentioned service account authentication. The preferred way to do this is to use the application default credentials, you can have a little read about them here.
In short, you want to set an environment variable GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json which is a key to service account you generated in console.
Then the client library will take care of the rest (getting the OAuth tokens and what not).

-- Robert Lacok
Source: StackOverflow

4/3/2017

The API for Google Container Engine is very limited at the moment as all the features are in Alpha status and because they can change not many people are incorporating them into the SDKs they are developing.

These are the current available APIs: https://cloud.google.com/sdk/gcloud/reference/container/

And here is the Alpha APIs: https://cloud.google.com/sdk/gcloud/reference/alpha/container/

-- Ryank
Source: StackOverflow