{"id":26246406,"url":"https://github.com/mittwald/kubernetes-loadwatcher","last_synced_at":"2025-07-23T04:03:39.545Z","repository":{"id":49803111,"uuid":"179521931","full_name":"mittwald/kubernetes-loadwatcher","owner":"mittwald","description":" Automatically taint and evict nodes with high CPU load","archived":false,"fork":false,"pushed_at":"2024-02-12T15:10:06.000Z","size":41,"stargazers_count":30,"open_issues_count":1,"forks_count":13,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-23T20:35:33.395Z","etag":null,"topics":["golang","kubernetes","kubernetes-controller"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mittwald.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-04T15:06:38.000Z","updated_at":"2025-04-20T15:23:40.000Z","dependencies_parsed_at":"2024-06-20T06:07:37.368Z","dependency_job_id":null,"html_url":"https://github.com/mittwald/kubernetes-loadwatcher","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mittwald/kubernetes-loadwatcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mittwald%2Fkubernetes-loadwatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mittwald%2Fkubernetes-loadwatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mittwald%2Fkubernetes-loadwatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mittwald%2Fkubernetes-loadwatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mittwald","download_url":"https://codeload.github.com/mittwald/kubernetes-loadwatcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mittwald%2Fkubernetes-loadwatcher/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266614306,"owners_count":23956341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","kubernetes","kubernetes-controller"],"created_at":"2025-03-13T13:18:26.007Z","updated_at":"2025-07-23T04:03:39.482Z","avatar_url":"https://github.com/mittwald.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes Load Watcher\n\n[![Build Status](https://travis-ci.com/mittwald/kubernetes-loadwatcher.svg?branch=master)](https://travis-ci.com/mittwald/kubernetes-loadwatcher)\n[![Docker Repository on Quay](https://quay.io/repository/mittwald/kubernetes-loadwatcher/status \"Docker Repository on Quay\")](https://quay.io/repository/mittwald/kubernetes-loadwatcher)\n[![Maintainability](https://api.codeclimate.com/v1/badges/9b21aca83864d9202fd4/maintainability)](https://codeclimate.com/github/mittwald/kubernetes-loadwatcher/maintainability)\n\nAutomatically taint and evict nodes with high CPU load.\n\n## Synopsis\n\nBy default, Kubernetes will not evict Pods from a node based on CPU usage, since CPU is considered a compressible resource. However, in some cases it might be desirable to actually evict some pods from a node with high CPU load (or at least to prevent Kubernetes from scheduling even more pods on a node that is already overloaded).\n\nThis project contains a small Kubernetes controller that watches each node's CPU load; when a certain threshold is exceeded, the node will be tainted (so that no additional workloads are scheduled on an already-overloaded node) and finally the controller will start to evict Pods from the node.\n\n## Installation\n\nThis repository contains a Helm chart that can be used to install the controller; it needs to be run as a DaemonSet on every node.\n\n```console\n\u003e git clone github.com/mittwald/kubernetes-loadwatcher\n\u003e helm upgrade \\\n    --install \\\n    --namespace kube-system \\\n    loadwatcher \\\n    ./kubernetes-loadwatcher/chart\n``` \n\n## How it works\n\nThis controller can be started with two threshold flags: `-taint-threshold` and `-evict-threshold`. The controller will continuously monitor a node's CPU load.\n\n- If the CPU load (5min average) exceeds the _taint threshold_, the node will be tainted with a `loadwatcher.mittwald.systems/load-exceeded` taint with the `PreferNoSchedule` effect. This will instruct Kubernetes to not schedule any additional workloads on this node if at all possible. \n- If the CPU load (both 5min and 15min average) falls back below the _taint threshold_, the taint will be removed again.\n- If the CPU load (15 min average) exceeds the _eviction threshold_, the controller will pick a suitable Pod running on the node and evict it. However, the following types of Pods will _not_ be evicted:\n\n    - Pods with the `Guaranteed` QoS class\n    - Pods belonging to Stateful Sets\n    - Pods belonging to Daemon Sets\n    - Standalone pods not managed by any kind of controller\n    - Pods running in the `kube-system` namespace or with a critical `priorityClassName`\n    \n  Among the remaining pods, pods with the `BestEfford` QoS class will be preferred for eviction.\n  \nAfter a Pod was evicted, the next Pod will be evicted after a configurable _eviction backoff_ (controllable using the `evict-backoff` argument) if the load15 is still above the _eviction threshold_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmittwald%2Fkubernetes-loadwatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmittwald%2Fkubernetes-loadwatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmittwald%2Fkubernetes-loadwatcher/lists"}