I have a question for AWS Lambda with Kubernetes.
I want to get alarms at Slack thorough AWS Lambda and AWS Cloud-watch when amazon eks Pod's are increased or decreased.
I followed sample practice according to the below link and succeed. https://antonputra.com/amazon/send-aws-cloudwatch-alarms-to-slack/#create-lambda-function
So, I just wonder it's also possible that AWS Lambda can detect increase and decrease of Kubernetes pods. If it is, could you give me any links or guidence for that? I appreciate your help.
What I want to do is that I want to get alarms at Slack when pods are increased or decreased on kubernetes through AWS Lambda.
CodePudding user response:
Option 1
Yes, you can do it in multiple ways. If you are running the Cloud watch metrics and getting a count of PODs in the EKS cluster it would be easy to monitor and push messages to the SNS topic.
Option 2
You can install the Cloud watch daemon set and push logs to the cloud watch match pattern in event logs from EKS to delete or create POD. If pattern matches push the SNS message and further processed by Lambda.
Option 3 (Without SNS, Lambda or Cloudwatch)
Directly run the one POD into the K8s cluster to monitor the namespace if PODs start/delete run send the message on Slack webhook.
Ref : https://github.com/harsh4870/Slack-Post-On-POD-Ready-State
You can also use the Kubewatch from VMware