Sample code that shows how Notify17's raw API keys can be used to watch a Kubernetes cluster's nodes, when they're added or deleted, and receive a notification on each of these events.
Source code is in the main.go file, Go version >= 1.12.
To deploy:
- Create a raw API key in Notify17's dashboard.
- Customize the
k8s-node-watcher-example.yamland replace theREPLACE_API_KEYenvironment variable value with your raw API key. - Run
kubectl apply -f k8s-node-watcher-example.yaml
You will then receive a notification for each node that gets added or deleted in the cluster.
When done, you can safely delete the resources by running kubectl delete -f k8s-node-watcher-example.yaml.