Here is a professional article for the SAP field on the topic "Scaling Applications in SAP Kyma with Kubernetes":
As businesses adopt cloud-native development strategies to remain agile and resilient, scalability becomes a critical success factor. SAP Kyma, built on Kubernetes, empowers developers to build and extend SAP applications using microservices, serverless functions, and event-driven architecture. One of Kyma’s biggest advantages is its native integration with Kubernetes, which provides powerful tools for automatically and dynamically scaling applications based on demand.
This article explores how you can leverage Kubernetes features within SAP Kyma to scale applications effectively, ensuring performance, reliability, and cost efficiency.
Kyma applications often integrate with core SAP systems (e.g., SAP S/4HANA, SAP BTP services), process events from Event Mesh, and expose APIs to external consumers. As traffic patterns fluctuate due to seasonality, campaigns, or business growth, your application must scale accordingly to:
Scaling in Kyma is achieved through Kubernetes-native mechanisms, enriched with Kyma capabilities such as serverless autoscaling, Istio traffic management, and observability tools.
Kubernetes' Horizontal Pod Autoscaler (HPA) automatically adjusts the number of running pods based on CPU, memory, or custom metrics.
Example:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: orders-api-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: orders-api
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
Kyma’s Function runtime (based on Knative) supports automatic scaling down to zero and up based on incoming HTTP or CloudEvents.
Benefits:
Define CPU and memory requests and limits in your deployment manifests to ensure the Kubernetes scheduler can make informed scaling decisions.
HPA requires access to resource metrics. Ensure the metrics-server is installed and operational in your Kyma cluster.
Use Kyma’s integration with Grafana and Prometheus to monitor metrics and visualize scaling trends. Perform load testing with tools like k6 or JMeter to validate scaling responsiveness.
For serverless functions, reduce cold start latency by:
Leverage Istio's traffic shaping to gradually shift traffic to new deployments during scaling events or rollouts. This helps ensure smooth scaling without impacting users.
When CPU/memory is insufficient as scaling signals, use custom metrics such as:
You can expose these via Prometheus and configure HPA to use them.
For workloads that are not easily distributed horizontally, VPA adjusts container resource requests automatically. Use this cautiously with HPA to avoid conflicts.
Kyma can be extended with KEDA to scale based on event sources such as Kafka topics, Azure queues, or custom metrics. This is especially powerful for asynchronous, event-heavy SAP integrations.
Imagine a Kyma-based service extending SAP S/4HANA to handle incoming sales order events. During end-of-month processing, order volume surges.
Solution:
Outcome: The service handles peak loads without downtime, ensures business continuity, and optimizes resource usage during off-peak periods.
SAP Kyma's integration with Kubernetes offers a robust and flexible foundation for scaling cloud-native applications. By strategically using horizontal and serverless autoscaling, monitoring tools, and event-driven extensions like KEDA, you can ensure your applications remain responsive, resilient, and efficient—even in the face of unpredictable demand.
As SAP landscapes evolve, leveraging Kyma’s scalable architecture will be key to future-proofing your enterprise applications.