Skip to content

Kubernetes resource monitoring application that retrieves pod metrics and checks resource usage periodically.

License

Notifications You must be signed in to change notification settings

saidsef/pod-resources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Go Report Card GitHub go.mod Go version GoDoc GitHub release(latest by date) Commits GitHub

Pod Resources Monitoring

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.

Table of Contents

Features

  • 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.

Requirements

  • Go >= 1.21
  • Kubernetes cluster
  • Access to Kubernetes API
  • Slack account (optional for notifications)

Installation

  1. Clone the repository:
git clone https://github.com/saidsef/pod-resources.git
cd pod-resources
  1. Install the required Go modules:
go mod tidy

Configuration

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 is 120s.
  • SLACK_TOKEN: The token for your Slack app to send notifications (optional).
  • SLACK_CHANNEL: The Slack channel where notifications will be sent (optional).

Usage

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.

Alerts and Notifications

  • 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.

Source

Our latest and greatest source of Reverse Geocoding can be found on [GitHub]. Fork us!

Contributing

We would ❤️ you to contribute by making a pull request.

Please read the official Contribution Guide for more information on how you can contribute.

About

Kubernetes resource monitoring application that retrieves pod metrics and checks resource usage periodically.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors 2

  •  
  •