Monitor you app without Prometheus or Datadog. This project is a Kubernetes resource monitoring application that retrieves pod metrics and checks resource usage periodically. It sends alerts and warnings based on the defined resource limits and requests for each container within the pods.
- Monitors CPU and memory usage of Kubernetes pods.
- Sends alerts if resource usage exceeds defined limits or requests.
- Supports Slack notifications for alerts.
- Configurable monitoring duration.
- Go >= 1.21
- Kubernetes cluster
- Access to Kubernetes API
- Slack account (optional for notifications)
- Clone the repository:
git clone https://github.com/saidsef/pod-resources.git
cd pod-resources
- Install the required Go modules:
go mod tidy
Before running the application, you need to set up the following environment variables - all optional:
DURATION_SECONDS
: The duration (in seconds) for which the application will check resource usage. Default is120s
.SLACK_TOKEN
: The token for your Slack app to send notifications (optional).SLACK_CHANNEL
: The Slack channel where notifications will be sent (optional).
To run the application, execute the following command:
go run resources.go
The application will connect to the Kubernetes cluster, retrieve the list of pods, and start monitoring their resource usage based on the specified duration.
- If a container exceeds its resource request, an alert will be sent.
- If a container has a limit set but no request defined, a warning will be logged.
- If a container exceeds its resource limit, an alert will be sent.
- Warnings will be logged if no limits or requests are defined for CPU or memory.
Our latest and greatest source of Reverse Geocoding can be found on [GitHub]. Fork us!
We would ❤️ you to contribute by making a pull request.
Please read the official Contribution Guide for more information on how you can contribute.