-
Notifications
You must be signed in to change notification settings - Fork 58
Add monitoring of container image deployments #13
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your pull requests. I've added some comments. If you need help on refactoring, please feel free to ask.
@@ -1,4 +1,5 @@ | |||
module.exports = [ | |||
require('./waitingpods'), | |||
require('./longnotready'), | |||
require('./newdeployment'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using one tab indentation. Please reindent this line and the monitor file.
|
||
class DeploymentStatus extends EventEmitter{ | ||
constructor(){ | ||
super(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have nothing but super();
in your constructor
, it can be omitted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually from below, we'll need the constructor to initialize the state store.
} | ||
|
||
async check(){ | ||
let containers = await kube.getContainerStatuses(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think rather than checking for newly deployed containers, we should check for newly deployed pods. This is available in kube.getPods();
_key: `${item.pod.metadata.name}/${item.name}`, | ||
}); | ||
|
||
global.image = item.image; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is stateful then the state should be stored as instance attribute, rather than as a global variable.
@nathancashmore would you mind if I hi-jacked this PR and fixed the raised review issues? I'd really appreciate having the bot notify us about new deployments! |
@phillipj go for it. |
Alrighty, thanks. I'll for sure credit you as the author in the commit! |
Updates after having done some initial testing of this; we decided to send a Slack message from our deployment script with a cURL command instead. Looks something like this: That in combination with the already existing monitors that will tell us about containers having trouble, covers our needs. Bottom line, I was a little quick saying I'll hijack this PR with the goals of getting it merged. Sorry for those who waited in vain. |
This may be a little unnecessary for some, this should be conditional with a configuration flag. |
No description provided.