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 for a list of kubernetes resources which are currently supported by kuota-calc.
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 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.
$ 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 12Gi
Total
CPU: 8500m
Memory: 15104Mi
Pre-compiled statically linked binaries are available on the releases page.
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.
kuota-calc is still a work-in progress, there are plans to support more k8s resources (see #5 for more info).
Currently supported:
- apps/v1 Deployment
- apps/v1 StatefulSet
- apps/v1 DaemonSet
- batch/v1 CronJob
- batch/v1 Job
- v1 Pod