You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -31,18 +31,20 @@ Note that the features offered by Spring Cloud Gateway for Tanzu are more extens
31
31
## Prepare the code of self-hosted Spring Cloud Gateway application
32
32
33
33
To get the code of the Spring Cloud Gateway:
34
+
34
35
1. Navigate to https://start.spring.io.
35
-
1. Update the project metadata by setting the `Group` to your orgnization's name. Change the `Artifact` and `Name` to `gateway`.
36
-
1. Add dependencies `Reactive Gateway` and `Spring Boot Actuator`.
36
+
1. Update the project metadata by setting the **Group** to your orgnization's name. Change the **Artifact** and **Name** to **gateway**.
37
+
1. Add dependencies **Reactive Gateway** and **Spring Boot Actuator**.
37
38
1. Leave the other properties at their default values.
38
-
1. Click `Generate` to download the project.
39
+
1. Click **Generate** to download the project.
39
40
40
41
Extract the project when it's downloaded.
41
42
42
43
## Configure the Spring Cloud Gateway
43
-
Once the Spring Cloud Gateway code is ready, navigate to the `gateway/src/main/resources` directory of the project. Rename the `application.properties` file with `application.yml`. You can migrate from Spring Cloud Gateway for Tanzu by configuring the `application.yml`.
44
44
45
-
The example of `application.yml` is like:
45
+
Once the Spring Cloud Gateway code is ready, navigate to the **gateway/src/main/resources** directory of the project. Rename the **application.properties** file with **application.yml**. You can migrate from Spring Cloud Gateway for Tanzu by configuring the **application.yml**.
46
+
47
+
The example of **application.yml** is like:
46
48
47
49
```yaml
48
50
spring:
@@ -81,22 +83,24 @@ spring:
81
83
To migrate the Cross-Origin Resource Sharing (CORS) configuration of Spring Cloud Gateway for Tanzu, you can refer to [CORS Configuration for Spring Cloud Gateway](https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/#cors-configuration) for global CORS configuration and route CORS configuration.
82
84
83
85
### Scale
86
+
84
87
When migrating to Spring Cloud Gateway application in Azure Container Apps, the scaling behavior should align with Azure Container Apps' model. The instance count from Spring Cloud Gateway for Tanzu maps to `min-replica` and `max-replica` in Azure Container Apps. You can configure automatic scaling for the gateway application by defining scaling rules. For more details, refer to [Set scaling rules in Azure Container Apps](/azure/container-apps/scale-app).
85
88
86
89
The CPU and memory combinations available in Azure Spring Apps differs from those in Azure Container Apps. When mapping resource allocations, ensure that the selected CPU and memory configurations in Azure Container Apps fit both performance needs and supported options.
87
90
88
91
### Custom domain & certificates
92
+
89
93
Azure Container Apps supports custom domains and certificates, you can refer to [Domains & certificates](/azure/container-apps/certificates-overview) to migrate custom domains configured on Spring Cloud Gateway for Tanzu.
90
94
91
95
### Routes
92
96
93
-
You can migrate the routes in Spring Cloud Gatewy for Tanzu to Spring Cloud Gateway as the example of `application.yml` shows. The following list describes the mapping relationship between routes of Spring Cloud Gateway for Tanzu and routes of Spring Cloud Gateway:
97
+
You can migrate the routes in Spring Cloud Gatewy for Tanzu to Spring Cloud Gateway as the example of **application.yml** shows. The following list describes the mapping relationship between routes of Spring Cloud Gateway for Tanzu and routes of Spring Cloud Gateway:
94
98
95
99
- The `name` of the route is mapped to `id`.
96
100
- The `appName` and `protocol` are mapped to the URI of the route, which should be the accessible URI for the Azure Container Apps instance, make sure that the Azure Container Apps applications enable the ingress.
97
-
- Predicates and filters of Spring Cloud Gateway for Tanzu are mapped to that of Spring Cloud Gateway. Commercial predicates and filters are not supported, refer to [the document](https://techdocs.broadcom.com/us/en/vmware-tanzu/spring/spring-cloud-gateway-for-kubernetes/2-2/scg-k8s/developer-filters.html) for more details.
101
+
- Predicates and filters of Spring Cloud Gateway for Tanzu are mapped to that of Spring Cloud Gateway. Commercial predicates and filters are not supported, refer to [Commercial route filters in Spring Cloud Gateway for K8s](https://techdocs.broadcom.com/us/en/vmware-tanzu/spring/spring-cloud-gateway-for-kubernetes/2-2/scg-k8s/developer-filters.html) for more details.
98
102
99
-
For example, consider the following route config JSON file, `test-api.json`, which defines the `test-api` route in Spring Cloud Gateway for Tanzu for the `test` app:
103
+
For example, consider the following route config JSON file, **test-api.json**, which defines the `test-api` route in Spring Cloud Gateway for Tanzu for the `test` app:
100
104
101
105
```json
102
106
{
@@ -178,7 +182,7 @@ Once the Spring Cloud Gateway configuration is ready, build the image using Azur
178
182
179
183
### Build and Push the Docker Image
180
184
181
-
In the Spring Cloud Gateway project directory, create a `Dockerfile` with the following contents:
185
+
In the Spring Cloud Gateway project directory, create a **Dockerfile** with the following contents:
182
186
183
187
```dockerfile
184
188
FROM mcr.microsoft.com/openjdk/jdk:17-mariner as build
@@ -241,8 +245,10 @@ If you encounter issues when running the Spring Cloud Gateway application, you c
241
245
To monitor gateway application's metrics, refer to [Monitor Azure Container Apps metrics](/azure/container-apps/metrics)
242
246
243
247
## Known limitation
248
+
244
249
As far as we know, Spring Cloud Gateway does not support the following commercial features:
250
+
245
251
- Metadata used to generate OpenAPI documentation
246
252
- Single sign-on (SSO) functionality
247
253
248
-
If these features are required, you may need to consider other commercial solutions, such as Spring Cloud Gateway for Tanzu.
254
+
If these features are required, you may need to consider other commercial solutions, such as Spring Cloud Gateway for Tanzu.
0 commit comments