Skip to content

praveenqlogic/nodejs-cloud-container

 
 

Google Cloud Platform logo

release level CircleCI AppVeyor codecov

Node.js idiomatic client for Kubernetes Engine.

Kubernetes Engine is used for building and managing container based applications, powered by the open source Kubernetes technology.

Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.

Table of contents:

Quickstart

Before you begin

  1. Select or create a Cloud Platform project.

    Go to the projects page

  2. Enable billing for your project.

    Enable billing

  3. Enable the Google Kubernetes Engine API.

    Enable the API

  4. Set up authentication with a service account so you can access the API from your local workstation.

Installing the client library

npm install --save @google-cloud/container

Using the client library

const container = require('@google-cloud/container');

if (
  !process.env.GCLOUD_PROJECT ||
  !process.env.GOOGLE_APPLICATION_CREDENTIALS
) {
  throw new Error(
    'Usage: GCLOUD_PROJECT=<project_id> GOOGLE_APPLICATION_CREDENTIALS=<path to key json file> node #{$0}'
  );
}

const client = new container.v1.ClusterManagerClient({
  // optional auth parameters.
});

const projectId = process.env.GCLOUD_PROJECT;
const zone = 'us-central1-a';
const request = {
  projectId: projectId,
  zone: zone,
};

client
  .listClusters(request)
  .then(responses => {
    const response = responses[0];
    console.log(response);
  })
  .catch(err => {
    console.error('ERROR:', err);
  });

The Kubernetes Engine Node.js Client API Reference documentation also contains samples.

Versioning

This library follows Semantic Versioning.

This library is considered to be in alpha. This means it is still a work-in-progress and under active development. Any release is subject to backwards-incompatible changes at any time.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

License

Apache Version 2.0

See LICENSE

About

Deploy, manage, and scale containerized applications on Kubernetes, powered by Google Cloud.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 97.7%
  • Shell 1.8%
  • Other 0.5%