How to apply resource limits for Apigee hybrid pods

Note: This article was written for Apigee hybrid 1.4, please refer to the overrides.yaml file reference documentation for setting resource requests and limits in the latest releases: https://cloud.google.com/apigee/docs/hybrid/v1.12/config-prop-ref

Introduction

In Kubernetes the minimum and maximum of cpu and memory allocated for pods can be configured using resource requests and limits. In Apigee hybrid, these resource requests and limits are defined using templates found in the apigeectl/templates folder.

The values of the place holders of the templates are populated using the "config/values.yaml" file and "overrides/overrides.yaml" file. The "config/values.yaml" file contains the default values and they are overridden with deployment specific values given in the "overrides.yaml" file.

These resource requests and limits in Apigee hybrid can be configured using overrides.yaml file. The list of currently available configuration parameters can be found on the following documentation page:

https://cloud.google.com/apigee/docs/hybrid/v1.4/config-prop-ref

However, at the moment the following Apigee hybrid pods do not have resource limits defined in the templates:

  • authz/apigee-authn-authz
  • mart/apigee-mart-server
  • synchronizer/apigee-synchronizer
  • runtime/apigee-runtime
  • cassandra/apigee-hybrid-cassandra
  • udca/apigee-udca
  • connectAgent/apigee-connect-agent
  • watcher/apigee-watcher

As a result, resource limits cannot be configured for those pods via the overrides.yaml file. Nevertheless, we could still define resource limits for above pods using the following approach.

Steps to Follow:

1. Generate kubernetes manifests of the Apigee hybrid deployment using apigeectl:

apigeectl apply -f overrides/overrides.yaml --print-yaml > apigee-manifests.yaml

2. Open apigee-manifests.yaml file in a text editor and find the relevant ApigeeEnvironment definition and apigee-runtime definition:

An example:

apiVersion: apigee.cloud.google.com/v1alpha1
kind: ApigeeEnvironment
...
spec:
...
components:
...
runtime:
...
containers:
- name: apigee-runtime
image: "gcr.io/apigee-release/hybrid/apigee-runtime:1.4.2"
imagePullPolicy: "IfNotPresent"
...
resources:
requests:
cpu: 500m
memory: 512Mi

3. Add resource limits to the relevant apigee-runtime definition in apigee-manifests.yaml file.

4. Apply apigee-manifests.yaml file using kubectl:

kubectl apply -f apigee-manifests.yaml

5. Verify whether resource limits are applied to the relevant Apigee Environment:

kubectl get ApigeeEnvironment -n apigee -o=yaml

6. Once the status of Apigee Environment is changed to "running", check whether resource limits are applied to apigee-runtime pods:

# check the status of the apigee environment
kubectl get ApigeeEnvironment -n apigee

# check whether resource limits are applied to apigee-runtime pods
kubectl get pods -n apigee -l app=apigee-runtime -o=yaml

Important

  • In above commands, the Kubernetes namespace of the Apigee hybrid deployment has been defined as "apigee" (-n apigee). Please update it accordingly.
  • Please note that if this approach is followed for applying resource limits, these resource limits need to be applied using the same way each time "apigeectl apply" command is executed. Otherwise, these values will get removed the next time "apigeectl apply" command is directly executed.
Contributors
Version history
Last update:
Tuesday
Updated by: