Closed mmiranda closed 4 years ago
Hi @mmiranda The following are the structs that are available to use in the webhook template:
type NodeMetadata struct {
InstanceID string
InstanceType string
PublicHostname string
PublicIP string
LocalHostname string
LocalIP string
}
type InterruptionEvent struct {
EventID string
Kind string
Description string
State string
StartTime time.Time
EndTime time.Time
Drained bool
}
The data is merged into a convenient struct on the webhook for template usage:
type combinedDrainData struct {
ec2metadata.NodeMetadata
interruptionevent.InterruptionEvent
}
Currently, instance-id and instance-type are available to be included in the webhook template. LocalHostname is pretty close to node name, so that may work for you. Here's an example of specifying the webhook template w/ CLI args: https://github.com/aws/aws-node-termination-handler/blob/87fe242d4aef3c742826f952e61b121216570416/test/e2e/webhook-test#L30
We don't have AZ, but that could be easily added.
Would just need to update the following to capture AZ data:
I'd like to take stab at this!
@DP19 Go for it! 🚀
Also, since this issue was opened, documentation was added about which metadata paths NTH uses for kiam configurations. If you add additional paths, don't forget to update the readme:
https://github.com/aws/aws-node-termination-handler#use-with-kiam https://github.com/aws/aws-node-termination-handler#metadata-endpoints
@bwagner5 Thanks! PR #210 adds this info
When an
InterruptionEvent
occurs (used to post on webhook), it would be nice to have information such as:This way we can adapt the WEBHOOK_TEMPLATE to also send that information.