As enterprises embrace cloud-native architectures, the ability to automatically scale microservices based on demand is essential for maintaining performance, cost efficiency, and resilience. SAP Kyma, a powerful open-source runtime built on Kubernetes, offers robust auto-scaling capabilities to help businesses dynamically adjust resources and ensure their SAP extensions and integrations remain responsive under fluctuating workloads.
This article explores how to implement and manage auto-scaling of microservices within SAP Kyma, leveraging Kubernetes-native and serverless technologies.
Auto-scaling is the process of automatically adjusting the number of running instances (Pods) of a microservice based on real-time resource usage or custom metrics. This ensures optimal resource utilization, cost savings, and uninterrupted service.
Kyma leverages Kubernetes’ Horizontal Pod Autoscaler (HPA) to scale Pods based on CPU, memory, or custom metrics:
Example HPA manifest snippet:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: my-service-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: my-service
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
Kyma integrates Knative Serving to run serverless functions and microservices with advanced auto-scaling features:
Deploy your microservice as a Kubernetes Deployment or Knative Service in Kyma.
A retail company using SAP Commerce Cloud wants their order processing microservice to handle spikes during flash sales. They deploy the microservice on Kyma, configure HPA to scale Pods based on CPU utilization, and use Knative functions for event-triggered notifications. The solution scales smoothly from 2 to 20 Pods during peak sales, then scales back to minimal instances during quiet hours, ensuring cost efficiency and performance.
Auto-scaling microservices in SAP Kyma unlocks agility and operational excellence by dynamically adapting to workload demands. Leveraging Kubernetes HPA and Knative’s serverless capabilities, Kyma empowers SAP customers to build resilient, efficient, and scalable cloud-native extensions. This capability is essential in today’s fast-paced business environments where responsiveness and cost control are paramount.