Skip to content

Instantly share code, notes, and snippets.

View thenayr's full-sized avatar

Ryan vanniekerk thenayr

View GitHub Profile
@thenayr
thenayr / k8s-api-events.js
Created November 16, 2016 23:23
Different event streams that come from the k8s watch API
const stream = k8Stream.ns.po.get({ qs: { watch: true } });
stream.pipe(jsonStream);
jsonStream.on('data', object => {
switch(object.type) {
case 'ADDED':
console.log("Do something when a pod is added");
break;
case 'MODIFIED':
console.log("Do something when a pod is modified");
break;
@thenayr
thenayr / k8s-api.js
Created November 16, 2016 23:21
Kubernetes event stream handling new pods
case 'ADDED':
console.log("Unfortunately this doesn't mean a pod is Ready");
break;
case 'MODIFIED':
if(!("deletionTimestamp" in object.object.metadata) && "conditions" in object.object.status && "podIP" in object.object.status) {
console.log("This means a new pod is added AND ready");
}
break;
@thenayr
thenayr / planetside-2-e3
Created July 11, 2012 04:41
Planetside 2 e3
Wins - 22
Best of Show: Game Informer
Best MMO: Game Informer
Bset PC Exclusive: Game Informer
Best Shooter: GameSpy
Best Free to Play: GameSpy
Best PC Exclusive: GameSpy
Best MMO Game: IGN
Best PC Game: IGN