Capacity Planning

Customer guide to capacity planning on the ayedo SDP: monitor usage in Grafana, size requests and limits, use HPA, and request cluster scaling.

Capacity Planning

Proactive capacity planning ensures that your applications on the ayedo Software Delivery Platform (SDP) continue running smoothly during load spikes, deployments, and node maintenance — without unnecessarily blocking resources.

Monitoring Resource Usage in Grafana

Sound capacity planning is based on real measurements rather than guesswork. Using Grafana (data source VictoriaMetrics), you can continuously monitor the utilization of your namespaces and workloads:

  • CPU Usage vs. Requests & Limits: Shows whether containers are experiencing CPU Throttling or reserving far more CPU than they actually consume.
  • Memory Working Set vs. Limits: Reveals gradual memory leaks and the risk of OOMKilled restarts early.
  • PersistentVolumeClaim Utilization: Tracks free space on your PVCs before volumes fill up.
  • Pod States: Highlights Pending pods that cannot be scheduled due to insufficient cluster capacity or namespace quotas.

Quick Check via kubectl

# Show current resource usage of pods in your namespace
kubectl top pods -n acme-production

# Inspect configured ResourceQuotas in the namespace
kubectl describe resourcequota -n acme-production

For automatic early warnings as load increases, set up appropriate rules in Grafana Alerting.

Properly Sizing Requests and Limits

Kubernetes schedules pods onto available nodes based on requests and constrains their consumption through limits. Well-chosen values improve both stability and cost efficiency.

resources:
  requests:
    cpu: 100m
    memory: 256Mi
  limits:
    cpu: 500m
    memory: 512Mi

Rightsizing Guidelines

Resource Recommendation
CPU Requests Base on regular average utilization (e.g., 95th percentile under normal load).
CPU Limits Set more generously than requests (or deliberately high) to avoid unnecessary CPU throttling during brief load spikes.
Memory Requests Cover typical working memory needs including a buffer.
Memory Limits Plan sufficient headroom — if the memory limit is exceeded, the kernel immediately terminates the container (OOMKilled). For latency-critical or memory-sensitive services, often set requests == limits (Guaranteed QoS class).

Horizontal Scaling with HPA

For applications with variable load, use the HorizontalPodAutoscaler (HPA). It automatically adjusts the replica count based on CPU, memory, or custom metrics.

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: my-app
  namespace: acme-production
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-app
  minReplicas: 2
  maxReplicas: 8
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 75

Prerequisites for HPA to work properly:

  • All containers in the pod define resources.requests for the scaled metric.
  • The application is stateless (or stores state externally, e.g., in a database, cache, or object storage).
  • minReplicas covers baseline load and high availability; maxReplicas fits within the available namespace quota and cluster capacity.

Planning Capacity Buffers and Resilience

When estimating your requirements, account not only for normal baseline load but also for:

  • Rolling Updates: Additional pods temporarily run during deployments (maxSurge).
  • Failure and Maintenance Buffer: A cluster needs free headroom so workloads can be rescheduled onto other nodes during node restarts or a node failure.
  • Growth & Campaigns: Planned product launches, data imports, or marketing campaigns should be factored into capacity planning early.

Requesting or Performing Cluster Scaling

When workload utilization grows steadily, Pending pods appear due to tight resources, or new projects are onboarded:

On a Managed SDP

  1. Assess Demand: Document the affected namespaces, the additional CPU/RAM/storage demand, and the desired timeframe.
  2. Request Expansion: Reach out early to ayedo via your agreed support channel (for example, support@ayedo.de).
  3. Execution & Verification: ayedo expands cluster capacity or adjusts quotas as agreed; afterwards, verify pod scheduling and your Grafana dashboards.

Binding information on operating models, sizing, and service scope is available under Operating Models and in the Service Annex to the Terms and Conditions.

On a Self-Managed SDP

In self-managed environments, scale worker nodes through your Polycrate workspace or infrastructure inventory (see Kubernetes Distribution) and then adjust ResourceQuotas and storage capacities accordingly.

Further Reading