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
This article shows you how to migrate a Spring Cloud Gateway for VMWare Tanzu project running on an Azure Spring Apps Enterprise plan to a project running as a self-hosted Open Source (OSS) Spring Cloud Gateway running as an Azure Container Apps application.
18
+
This article shows you how to migrate a Spring Cloud Gateway for VMWare Tanzu project running on an Azure Spring Apps Enterprise plan to a project running as a self-hosted, open source software (OSS) Spring Cloud Gateway project running as an Azure Container Apps application.
19
19
20
20
The OSS version of Spring Cloud Gateway mentioned in this page is provided as an example for reference. Users can choose other distributions of Spring Cloud Gateway based on their requirements.
21
21
22
22
> [!NOTE]
23
-
> The features offered by Spring Cloud Gateway for VMWare Tanzu are more extensive than the features in the OSS version, so it's essential to verify the differences and ensure compatibility before moving to production.
23
+
> The features offered by Spring Cloud Gateway for VMWare Tanzu are more extensive than the features in the OSS version. Be sure to examine the differences and ensure compatibility before moving to production.
24
24
25
25
## Prerequisites
26
26
@@ -34,25 +34,23 @@ The OSS version of Spring Cloud Gateway mentioned in this page is provided as an
34
34
To get the code of the Spring Cloud Gateway application, use the following steps:
35
35
36
36
1. Navigate to https://start.spring.io.
37
-
1. Update the project metadata by setting the **Group** to your organization's name. Change the **Artifact** and **Name** to **gateway**.
38
-
1. Add dependencies**Reactive Gateway** and **Spring Boot Actuator**.
37
+
1. Update the project metadata by setting the **Group**field to your organization's name. Change the **Artifact** and **Name** fields to **gateway**.
38
+
1. Add the**Reactive Gateway** and **Spring Boot Actuator** dependencies.
39
39
1. Leave the other properties at their default values.
40
-
1.Click**Generate** to download the project.
41
-
1.Extract the project when it's downloaded.
40
+
1.Select**Generate** to download the project.
41
+
1.After the project downloads, extract it.
42
42
43
-
## Configure the Spring Cloud Gateway
43
+
## Configure the Spring Cloud Gateway application
44
44
45
-
Now that the Spring Cloud Gateway code is ready, you configure it in the next sections.
45
+
Now that you downloaded the Spring Cloud Gateway application, you configure it in the next sections.
46
46
47
47
### Configure the application properties file
48
48
49
49
To configure the application properties file, use the following steps:
50
50
51
51
1. Navigate to the **gateway/src/main/resources** directory of the project.
52
-
53
52
1. Rename the **application.properties** file to **application.yml**.
54
-
55
-
1. Edit the **application.yml**. The following **application.yml** file is typical:
53
+
1. Edit the **application.yml** file. The following **application.yml** file is typical:
56
54
57
55
```yaml
58
56
spring:
@@ -88,32 +86,31 @@ To configure the application properties file, use the following steps:
88
86
89
87
### CORS configuration
90
88
91
-
To migrate the Cross-Origin Resource Sharing (CORS) configuration of your Spring Cloud Gateway for VMWare Tanzu project, see [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.
89
+
To migrate the Cross-Origin Resource Sharing (CORS) configuration of your Spring Cloud Gateway for VMWare Tanzu project, see [CORS Configuration](https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/#cors-configuration) for global CORS configuration and route CORS configuration.
92
90
93
91
### Scale
94
92
95
-
When migrating to a Spring Cloud Gateway application in Azure Container Apps, the scaling behavior should align with the Azure Container Apps model. The instance count from Spring Cloud Gateway for VMWare 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 information, see [Set scaling rules in Azure Container Apps](/azure/container-apps/scale-app).
93
+
When you migrate to a Spring Cloud Gateway application in Azure Container Apps, the scaling behavior should align with the Azure Container Apps model. The instance count from Spring Cloud Gateway for VMWare 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 information, see [Set scaling rules in Azure Container Apps](/azure/container-apps/scale-app).
96
94
97
-
The CPU and memory combinations available in Azure Spring Apps differ from those in Azure Container Apps. When mapping resource allocations, ensure that the selected CPU and memory configurations in Azure Container Apps fit both your performance needs and the supported options.
95
+
The CPU and memory combinations available in Azure Spring Apps differ from the combinations available in Azure Container Apps. When mapping resource allocations, ensure that the selected CPU and memory configurations in Azure Container Apps fit both your performance needs and the supported options.
98
96
99
97
### Custom domains & certificates
100
98
101
99
Azure Container Apps supports custom domains and certificates. For more information on migrating custom domains configured on Spring Cloud Gateway for VMWare Tanzu, see [Certificates in Azure Container Apps](/azure/container-apps/certificates-overview).
102
100
103
101
### Routes
104
102
105
-
You can migrate the routes in Spring Cloud Gatewy for Tanzu to Spring Cloud Gateway, as the **application.yml** example shows. The following list describes the mapping relationship between the routes of Spring Cloud Gateway for VMWare Tanzu and the routes of Spring Cloud Gateway:
103
+
You can migrate the routes in Spring Cloud Gateway for Tanzu to Spring Cloud Gateway, as the **application.yml** example shows. The following list describes the mapping relationship between the routes of Spring Cloud Gateway for VMWare Tanzu and the routes of Spring Cloud Gateway:
106
104
107
105
- The `name` property of the route is mapped to `id`.
108
-
109
106
- The `appName` and `protocol` properties are mapped to the URI of the route, which should be the accessible URI for the Azure Container Apps instance. Make sure the Azure Container Apps applications enable the ingress.
110
-
- Predicates and filters of Spring Cloud Gateway for VMWare Tanzu are mapped to those of Spring Cloud Gateway. Commercial predicates and filters aren't supported. For more information, see [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).
107
+
- Predicates and filters of Spring Cloud Gateway for VMWare Tanzu are mapped to predicates and filters of Spring Cloud Gateway. Commercial predicates and filters aren't supported. For more information, see [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).
111
108
112
109
As an example, consider the following route config JSON file, **test-api.json**, which defines the `test-api` route in Spring Cloud Gateway for VMWare Tanzu for the `test` app:
113
110
114
111
```json
115
112
{
116
-
"protocol": "HTTP",
113
+
"protocol": "HTTP",
117
114
"routes": [
118
115
{
119
116
"title": "Test API",
@@ -129,7 +126,7 @@ As an example, consider the following route config JSON file, **test-api.json**,
129
126
}
130
127
```
131
128
132
-
Then, the following YAML file shows the corresponding route configuration for Spring Cloud Gateway:
129
+
Then, the following YAML file shows the corresponding route configuration for the Spring Cloud Gateway application:
133
130
134
131
```yaml
135
132
spring:
@@ -146,11 +143,12 @@ spring:
146
143
- StripPrefix=1
147
144
```
148
145
149
-
Spring Cloud Gateway for VMWare Tanzu sets `StripPrefix=1` by default on every route. To migrate to Spring Cloud Gateway, you need to explicitly set `StripPrefix=1` in the filter configuration.
146
+
Spring Cloud Gateway for VMWare Tanzu sets `StripPrefix=1` by default on every route. To migrate to a Spring Cloud Gateway, you need to explicitly set `StripPrefix=1` in the filter configuration.
150
147
151
-
To allow your Spring Cloud Gateway application to access other applications through the app name, you need to enable ingress for your Azure Container App applications. You can also set the accessible FQDN of the Azure Container Apps application to be the URI of the route, following the format `https://<app-name>.<container-app-env-name>.<region>.azurecontainerapps.io`.
148
+
To enable your Spring Cloud Gateway application to access other applications through the app name, you need to enable ingress for your Azure Container App applications. You can also set the accessible fully qualified domain name (FQDN) of the Azure Container Apps application to be the URI of the route, following the format `https://<app-name>.<container-app-env-name>.<region>.azurecontainerapps.io`.
152
149
153
-
There are some [commercial predicates](https://docs.vmware.com/en/VMware-Spring-Cloud-Gateway-for-Kubernetes/2.2/scg-k8s/GUID-guides-predicates.html) and [commercial filters](https://docs.vmware.com/en/VMware-Spring-Cloud-Gateway-for-Kubernetes/2.2/scg-k8s/GUID-guides-filters.html) that aren't supported on Spring Cloud Gateway.
150
+
> [!NOTE]
151
+
> There are some [commercial predicates](https://docs.vmware.com/en/VMware-Spring-Cloud-Gateway-for-Kubernetes/2.2/scg-k8s/GUID-guides-predicates.html) and [commercial filters](https://docs.vmware.com/en/VMware-Spring-Cloud-Gateway-for-Kubernetes/2.2/scg-k8s/GUID-guides-filters.html) that aren't supported on Spring Cloud Gateway.
154
152
155
153
### Response cache
156
154
@@ -184,7 +182,7 @@ spring:
184
182
185
183
### Integrate with APM
186
184
187
-
You can enable application performance monitoring (APM) for Spring Cloud Gateway application. For more information, see [Integrate application performance monitoring into container images](migrate-to-azure-container-apps-build-application-performance-monitoring.md).
185
+
You can enable application performance monitoring (APM) for your Spring Cloud Gateway application. For more information, see [Integrate application performance monitoring into container images](migrate-to-azure-container-apps-build-application-performance-monitoring.md).
188
186
189
187
## Deploy to Azure Container Apps
190
188
@@ -231,13 +229,13 @@ To build and push the Docker image, use the following steps:
231
229
```azurecli
232
230
az acr login --name <azure-container-registry-name>
1. Ensure the gateway image is created, and get the image tag, which uses the following format: `<azure-container-registry-name>.azurecr.io/gateway:acrbuild-spring-cloud-gateway-0.0.1-SNAPSHOT`.
238
+
1. Ensure that the gateway image is created, and get the image tag, which uses the following format: `<azure-container-registry-name>.azurecr.io/gateway:acrbuild-spring-cloud-gateway-0.0.1-SNAPSHOT`.
241
239
242
240
### Deploy the image in Azure Container Apps
243
241
@@ -257,15 +255,15 @@ Access the FQDN of the Spring Cloud Gateway application to verify that it's runn
257
255
258
256
## Troubleshooting
259
257
260
-
If you encounter issues when running the Spring Cloud Gateway application, you can view realtime and historical logs of the `gateway`application in Azure Container Apps. For more information, see [Application Logging in Azure Container Apps](/azure/container-apps/logging).
258
+
If you encounter issues when running the Spring Cloud Gateway application, you can view real-time and historical logs of the `gateway`application in Azure Container Apps. For more information, see [Application Logging in Azure Container Apps](/azure/container-apps/logging).
261
259
262
260
You can also monitor a gateway application's metrics. For more information, see [Monitor Azure Container Apps metrics](/azure/container-apps/metrics)
263
261
264
262
## Known limitation
265
263
266
-
As far as we know, Spring Cloud Gateway does not support the following commercial features:
264
+
As far as we know, Spring Cloud Gateway doesn't support the following commercial features:
267
265
268
266
- Metadata used to generate OpenAPI documentation.
269
267
- Single sign-on (SSO) functionality.
270
268
271
-
If you require these features, you may need to consider other commercial solutions, such as Spring Cloud Gateway for VMWare Tanzu.
269
+
If you require these features, you might need to consider other commercial solutions, such as Spring Cloud Gateway for VMWare Tanzu.
0 commit comments