Skip to content

Resource Requirements

The default resource requirement for Limitador deployments is specified in Limitador v1alpha1 API reference and will be applied if the resource requirement is not set in the spec.

apiVersion: limitador.kuadrant.io/v1alpha1
kind: Limitador
metadata:
  name: limitador-sample
spec:
  listener:
    http:
      port: 8080
    grpc:
      port: 8081
  limits:

    - conditions: ["get_toy == 'yes'"]
      max_value: 2
      namespace: toystore-app
      seconds: 30
      variables: []  
Field json/yaml field Type Required Default value Description
ResourceRequirements resourceRequirements *corev1.ResourceRequirements No {"limits": {"cpu": "500m","memory": "64Mi"},"requests": {"cpu": "250m","memory": "32Mi"}} Limitador deployment resource requirements

Example with resource limits

The resource requests and limits for the deployment can be set like the following:

apiVersion: limitador.kuadrant.io/v1alpha1
kind: Limitador
metadata:
  name: limitador-sample
spec:
  listener:
    http:
      port: 8080
    grpc:
      port: 8081
  limits:

    - conditions: ["get_toy == 'yes'"]
      max_value: 2
      namespace: toystore-app
      seconds: 30
      variables: []
  resourceRequirements:
    limits:
      cpu: 200m
      memory: 400Mi
    requests:
      cpu: 101m  
      memory: 201Mi    

To specify the deployment without resource requests or limits, set an empty struct {} to the field:

apiVersion: limitador.kuadrant.io/v1alpha1
kind: Limitador
metadata:
  name: limitador-sample
spec:
  listener:
    http:
      port: 8080
    grpc:
      port: 8081
  limits:

    - conditions: [ "get_toy == 'yes'" ]
      max_value: 2
      namespace: toystore-app
      seconds: 30
      variables: []
  resourceRequirements: {}