silasbw / openshift-client-scratch Goto Github PK
View Code? Open in Web Editor NEWExample using kubernetes-client to implement an OpenShift client
License: MIT License
Example using kubernetes-client to implement an OpenShift client
License: MIT License
added "route" object to commonResource in this file but it does not seem to work
https://github.com/silasbw/openshift-client-scratch/raw/master/lib/oapi.js
const commonResources = [
'buildconfigs',
'deploymentconfigs',
'deploymentconfigrollbacks',
'route'
// TODO: add more resources
];
Deploymentconfig seem to work well
I tried watching all namespaces but this seem to work only with default
namespace
how can watch all namespaces?
const OpenShiftClient = require('./lib/index.js')
const Api = require('kubernetes-client');
const JSONStream = require('json-stream');
const jsonStreamDC = new JSONStream();
const jsonStreamROUTE = new JSONStream();
const jsonStreamSVC = new JSONStream();
const oapi = new OpenShiftClient.OApi(OpenShiftClient.config.fromKubeconfig());
const api = new Api.Core(Api.config.fromKubeconfig());
const streamDC = oapi.ns.deploymentconfigs.get({ qs: { watch: true } });
streamDC.pipe(jsonStreamDC);
jsonStreamDC.on('data', object => {
//if(object.type=='ADDED')
//console.log("\n",object.object.metadata.name)
});
const streamSVC = api.ns.services.get({ qs: { watch: true } });
streamSVC.pipe(jsonStreamSVC);
jsonStreamSVC.on('data', object => {
//if(object.type=='ADDED')
//console.log("\n",object.object.metadata.name)
});
const streamROUTE = oapi.ns.routes.get({ qs: { watch: true } });
streamROUTE.pipe(jsonStreamROUTE);
jsonStreamROUTE.on('data', object => {
console.log('test');
console.log('Route:', JSON.stringify(object, null, 2));
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.