node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org ยป


Build Status Coverage Status

Openshift Client

Greenkeeper badge

Node.js based client for the Openshift REST API, not unlike the Fabric8 Maven Plugin, but for node clients/builds.


npm install --save openshift-rest-client

The client needs to be passed a config object with the follow properties:

{ apiVersion: 'v1',
 { cluster: '192-168-99-100:8443',
   namespace: 'for-node-client-testing',
   user: 'developer/192-168-99-100:8443' },
user: { token: 'zVBd1ZFeJqEAILJgimm4-gZJauaw3PW4EVqV_peEZ3U' },
cluster: '' }

This can be obtained using the openshift-config-loader

By default, the config loader with look for a config at ~/.kube/config


const openshiftConfigLoader = require('openshift-config-loader');
const openshiftRestClient = require('openshift-rest-client');

openshiftConfigLoader(settings).then((config) => {
  openshiftRestClient(config).then((client) => {
    // Use the client object to find a list of projects, for example
    client.projects.find().then((projects) => {