resource-requests-admission-controller

command module
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2021 License: Apache-2.0 Imports: 37 Imported by: 0

README

build Go Report Card Docker Repository on Quay

Resource Requests Admission Controller

This application provides a global limit for Pod resources.

You can specify a config.yaml with max CPU Limits, CPU Requests, Memory Limits, Memory Requests or PVC limit and all resources exceeding the limit will be rejected.

A custom config per namespace is also possible.

Here is an example config:

apiVersion: v1
kind: ConfigMap
metadata:
  name: resource-requests-controller
  namespace: kube-system
data:
  config.yaml: |-
    maxCPULimit: 2
    maxMemLimit: 2Gi
    maxPVCSize: 50Gi
    maxCPURequest: 1
    maxMemRequest: 2Gi
    customNamespaces:
      kube-system:
        # maxMemLimit, maxPVCSize, maxMemRequest is taken from top level declaration
        maxCPULimit: 1
        maxCPURequest: 500Mi
      monitoring:
        # maxCPULimit, maxPVCSize, maxMemRequest, maxCPURequest is taken from top level declaration
        maxMemLimit: 1Gi
      default:
        # everything is unlimited.
        unlimited: true
      test-namespace:
        # everything is custom.
        unlimited: false
        maxCPULimit: 1
        maxMemLimit: 1Gi
        maxCPURequest: 500Mi
        maxMemRequest: 1Gi
        maxPVCSize: 10Gi
    customNames:
      {name: deployment-name, namespace: test-namespace}:
        maxPVCSize: 15Gi
        maxMemLimit: 5Gi
        maxCPULimit: 2
        maxCPURequest: 500Mi
        maxMemRequest: 1Gi

Deployment

You can find Kubernetes Manifest in docs directory.

Also you need to create ValidatingWebhookConfiguration kubernetes object. You can find an expample in docs directory.

In order to generate caBundle we suggest you use ca-bundle.sh shell script.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL