BTP Kyma Part 2: Deploying and Exposing a Service
Deploy a containerized service to Kyma end to end: build and push an image, create deployment and service manifests with resources and probes, bind BTP services via the operator, and expose the service externally with an APIRule — then verify and troubleshoot.
Explanation
📌 KEY POINTS
✅ Build a container image and push it to a registry Kyma can pull from.
✅ Deployment defines replicas, image, env, resources and probes; Service gives a stable internal address.
✅ Bind BTP services via ServiceBinding secrets mounted as env or files.
✅ Expose externally with an APIRule (host, service, access rules).
⚠️ Missing readiness probes let traffic hit pods before they're ready.
━━━━━━━━━━━━━━━━━━━━
▶ WHERE WE ARE
Part 1 introduced Kyma. Now deployment.
━━━━━━━━━━━━━━━━━━━━
▶ 1. IMAGE
- Build, tag, push; pull secret if private.
━━━━━━━━━━━━━━━━━━━━
▶ 2. DEPLOYMENT
- Replicas, resources, probes, env from secrets.
━━━━━━━━━━━━━━━━━━━━
▶ 3. SERVICE
- ClusterIP service for internal routing.
━━━━━━━━━━━━━━━━━━━━
▶ 4. BINDINGS
- Operator-created secrets.
━━━━━━━━━━━━━━━━━━━━
▶ 5. EXPOSURE & CHECKS
- APIRule; kubectl get/describe/logs.
━━━━━━━━━━━━━━━━━━━━
▶ STEP BY STEP
- Push an image.
- Apply deployment and service.
- Create an APIRule and call the URL.
✅ CHECKPOINT: authenticated call returns data.
Code example
===== deployment.yaml (excerpt) =====spec: replicas: 2 template: spec: containers: - name: orders image: registry.example.com/orders:1.0.0 resources: { limits: { memory: 256Mi, cpu: 250m } } readinessProbe: { httpGet: { path: /health, port: 8080 } } envFrom: [ { secretRef: { name: orders-xsuaa-binding } } ] ===== CHECKS =====kubectl get pods,svc,apirules -n orderskubectl describe pod <pod> -n orders | kubectl logs <pod> -n ordersReal project scenario
An integration team built a custom service in Kyma; pods kept restarting. kubectl describe showed failing liveness probes on a wrong path. Correcting the probe path stabilized the service.
Common mistakes
- No probes or wrong paths.
- No resource limits.
- Public APIRules.
- Secrets in images.
- Latest tags.
Best practices
- Proper probes.
- Set limits.
- Authenticated APIRules.
- Bindings for secrets.
- Versioned images.
Interview angle
Questions: "How do you deploy to Kyma?", "What is an APIRule?", "How do you troubleshoot a failing pod?"
Strong answer: image, deployment/service, bindings, exposure, troubleshooting.
Practice this lesson
Quick check
1. Pods keep restarting after deployment. What should you check first?
2. How do Kyma workloads typically get credentials for BTP services?
3. Candidates are frequently asked how they would securely expose a microservice on Kyma to external callers. In the Kyma Runtime context, which answer shows the strongest practical judgment?
Interview questions
1. How would you apply Kyma Runtime in a real SAP project? Walk through the design or implementation approach.
Answer it in your own words first, then compare.
2. What are the most important design decisions, trade-offs, and best practices in Kyma Runtime?
Answer it in your own words first, then compare.
Reference-verified: the steps are checked against official SAP documentation and tutorials, and object and field names in the sample code are checked for consistency. The code has not been compiled or run on an SAP system by ERPClimb. Syntax marked release-dependent varies by SAP release, so check it in your own system.