@brickblock/kube-watch
v0.0.9
Published
Simplifies creation of controllers and other things that require reacting to changes in Kubernetes resources
Downloads
1,291
Keywords
Readme
Kubernetes Watch Library
Simplifies creation of controllers and other things that require reacting to changes in Kubernetes resources
Example
const kubeWatch = require('@brickblock/kube-watch')
kubeWatch.watch({
'deployments', // or 'pods' or 'ingresses'
added: object => {
logger.info(`[ADDED] ${object.metadata.namespace}/${object.metadata.name}`)
},
modified: object => {
logger.info(
`[MODIFIED] ${object.metadata.namespace}/${object.metadata.name}`
)
},
deleted: object => {
logger.info(
`[DELETED] ${object.metadata.namespace}/${object.metadata.name}`
)
},
})