https://github.com/postfinance/kuota-calc
Simple utility to calculate the resource quota needed for your k8s deployment(s)
https://github.com/postfinance/kuota-calc
k8s kubectl kubernetes
Last synced: 4 months ago
JSON representation
Simple utility to calculate the resource quota needed for your k8s deployment(s)
- Host: GitHub
- URL: https://github.com/postfinance/kuota-calc
- Owner: postfinance
- License: mit
- Created: 2020-06-19T06:51:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-12-21T06:23:51.000Z (over 3 years ago)
- Last Synced: 2025-01-31T04:25:24.231Z (5 months ago)
- Topics: k8s, kubectl, kubernetes
- Language: Go
- Homepage:
- Size: 86.9 KB
- Stars: 24
- Watchers: 7
- Forks: 5
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README


[](https://goreportcard.com/report/github.com/postfinance/kuota-calc)
# kuota-calc
Simple utility to calculate the maximum needed resource quota for deployment(s). kuota-calc takes the
deployment strategy, replicas and all containers into account, see [supported-resources](https://github.com/postfinance/kuota-calc#supported-k8s-resources) for a list of kubernetes resources which are currently supported by kuota-calc.## Motivation
In shared environments such as kubernetes it is always a good idea to isolate/constrain different workloads to prevent them from infering each other. Kubernetes provides [Resource Quotas](https://kubernetes.io/docs/concepts/policy/resource-quotas/) to limit compute, storage and object resources of namespaces.Calculating the needed compute resources can be a bit challenging (especially with large and complex deployments) because we must respect certain settings/defaults like the deployment strategy, number of replicas and so on. This is where kuota-calc can help you, it calculates the maximum needed resource quota in order to be able to start a deployment of all resources at the same time by respecting deployment strategies, replicas and so on.
## Example
```bash
$ cat examples/deployment.yaml | kuota-calc -detailed
Version Kind Name Replicas Strategy MaxReplicas CPU Memory
apps/v1 Deployment myapp 10 RollingUpdate 11 5500m 2816Mi
apps/v1 StatefulSet myapp 3 RollingUpdate 3 3 12GiTotal
CPU: 8500m
Memory: 15104Mi
```## Installation
Pre-compiled statically linked binaries are available on the [releases page](https://github.com/postfinance/kuota-calc/releases).kuota-calc can either be used as a kubectl plugin or invoked directly. If you intend to use kuota-calc as
a kubectl plugin, simply place the binary anywhere in `$PATH` named `kubectl-kuota_calc` with execute permissions.
For further information, see the offical documentation on kubectl plugins [here](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/).## supported k8s resources
**kuota-calc is still a work-in progress**, there are plans to support more k8s resources (see [#5](https://github.com/postfinance/kuota-calc/issues/5) for more info).Currently supported:
- apps/v1 Deployment
- apps/v1 StatefulSet
- apps/v1 DaemonSet
- batch/v1 CronJob
- batch/v1 Job
- v1 Pod