Skip to content

Commit f825c94

Browse files
authored
Merge pull request #554 from mmitoraj/approuter
Update the standalone application router sample
2 parents 19a3f54 + 7b701ef commit f825c94

3 files changed

Lines changed: 326 additions & 54 deletions

File tree

standalone-approuter/README.md

Lines changed: 49 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,36 @@
1-
# Standalone approuter on SAP BTP, Kyma runtime
1+
# Standalone Application Router on SAP BTP, Kyma Runtime
22

3-
## Overview
3+
## Context
44

5-
SAP BTP, Kyma runtime is used to develop applications and extensions.
5+
SAP BTP, Kyma runtime is used to develop applications and extensions. The development process requires:
66

7-
This also brings in the following requirements:
8-
9-
- Serve static content
10-
- Authenticate and authorize users
11-
- Forward to the appropriate identity provider for login
12-
- Rewrite URLs
13-
- Dispatch requests to other microservices while propagating user information
7+
- Serving static content
8+
- Authenticating and authorizing users
9+
- Forwarding to the appropriate identity provider for logging in
10+
- Rewriting URLs
11+
- Dispatching requests to other microservices while propagating user information
1412

1513
All these and more capabilities are provided by [SAP Application Router](https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/01c5f9ba7d6847aaaf069d153b981b51.html).
1614

17-
There are two options to use the Application Router capabilities in SAP BTP, Kyma runtime.
15+
You can use the application router capabilities in SAP BTP, Kyma runtime either as:
1816

19-
- Managed Application Router
20-
- Standalone Application Router deployed on SAP BTP, Kyma runtime.
17+
- Managed Application Router, or
18+
- Standalone Application Router deployed on SAP BTP, Kyma runtime
2119

22-
You can learn about both options in this [blog](https://blogs.sap.com/2021/12/09/using-sap-application-router-with-kyma-runtime/)
20+
For more information on both options, see the [Using SAP Application Router with Kyma runtime](https://blogs.sap.com/2021/12/09/using-sap-application-router-with-kyma-runtime/) blog post.
2321

24-
In this sample, we will deploy a Standalone Application Router deployed on SAP BTP, Kyma runtime.
22+
This sample shows how to deploy a standalone Application Router on SAP BTP, Kyma runtime.
2523

2624
## Scenario
2725

28-
We will deploy an approuter, expose it over the internet via APIRule. It will be exposing a backend API via its configured destinations and routes.
26+
In this scenario, you deploy an application router and expose it over the internet using an APIRule custom resource. The APIRule exposes a backend API using configured destinations and routes.
2927

30-
As a simple backend, we will use an HttpBin application that returns the request headers as a response. Good for understanding flows and troubleshooting.
28+
The backend is a simple HttpBin application that returns request headers as a response.
3129

32-
![scenario](assets/scenario.svg)
30+
![scenario](./assets/scenario.drawio.svg)
3331

34-
> Note: Standalone approuter is deployed with 2 replicas. Session stickiness is achieved by configuring the [Destination rule](k8s/deployment.yaml)
32+
> [!Note]
33+
> A standalone application router is deployed with 2 replicas. To achieve session affinity, you must configure the [DestinationRule](k8s/deployment.yaml). Session affinity allows all subsequent traffic and requests from an initial client session to be passed to the same replica.
3534
3635
## Prerequisites
3736

@@ -40,49 +39,49 @@ As a simple backend, we will use an HttpBin application that returns the request
4039

4140
## Steps
4241

43-
- Export environment variables
42+
1. Export environment variables:
4443

45-
```shell
46-
export NS={your-namespace}
47-
```
44+
```shell
45+
export NS={your-namespace}
46+
```
4847

49-
- Create the namespace and enable istio-injection if not already done.
48+
2. Create a namespace and enable istio-injection, if not done yet:
5049

51-
```shell
52-
kubectl create namespace ${NS}
53-
kubectl label namespaces ${NS} istio-injection=enabled
54-
```
50+
```shell
51+
kubectl create namespace ${NS}
52+
kubectl label namespaces ${NS} istio-injection=enabled
53+
```
5554

56-
- Deploy the backend service
55+
3. Deploy the backend service:
5756

58-
```shell
59-
kubectl -n ${NS} apply -f k8s/httpbin.yaml
60-
```
57+
```shell
58+
kubectl -n ${NS} apply -f k8s/httpbin.yaml
59+
```
6160

62-
- Create the XSUAA Instance. Update the [service instance definition](k8s/xsuaa-service-instance.yaml). Replace {CLUSTER_DOMAIN} with the domain of your cluster.
61+
4. Create the XSUAA instance. Update the [service instance definition](k8s/xsuaa-service-instance.yaml). Replace {CLUSTER_DOMAIN} with the domain of your cluster.
6362

64-
```shell
65-
kubectl -n ${NS} apply -f k8s/xsuaa-service-instance.yaml
66-
```
63+
```shell
64+
kubectl -n ${NS} apply -f k8s/xsuaa-service-instance.yaml
65+
```
6766

68-
- Create the destinations and routes configurations for the approuter
67+
5. Create the destinations and routes configurations for the application router:
6968

70-
```shell
71-
kubectl -n ${NS} apply -f k8s/config.yaml
72-
```
69+
```shell
70+
kubectl -n ${NS} apply -f k8s/config.yaml
71+
```
7372

74-
- Deploy the approuter
73+
6. Deploy the application router:
7574

76-
```shell
77-
kubectl -n ${NS} apply -f k8s/deployment.yaml
78-
```
75+
```shell
76+
kubectl -n ${NS} apply -f k8s/deployment.yaml
77+
```
7978

80-
- Expose the approuter via APIRule.
79+
7. Expose the application router using APIRule:
8180

82-
```shell
83-
kubectl -n ${NS} apply -f k8s/api-rule.yaml
84-
```
81+
```shell
82+
kubectl -n ${NS} apply -f k8s/api-rule.yaml
83+
```
8584

86-
## Accessing the Application
85+
## Access the Application
8786

88-
The approuter is exposed at <https://my-approuter.{CLUSTER_DOMAIN}>. Access the URL <https://my-approuter.{CLUSTER_DOMAIN}/sap/com/httpbin/headers> to get all the request headers
87+
The application router is exposed at <https://my-approuter.{CLUSTER_DOMAIN}>. Access the URL <https://my-approuter.{CLUSTER_DOMAIN}/sap/com/httpbin/headers> to get all the request headers.

0 commit comments

Comments
 (0)