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
Copy file name to clipboardExpand all lines: articles/spring-apps/migration/migrate-to-azure-container-apps-components-gateway.md
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,9 @@ Note that the features offered by Spring Cloud Gateway for Tanzu are more extens
29
29
-[Azure CLI](/cli/azure/install-azure-cli).
30
30
- An Azure Container Registry with sufficient permissions to build and push Docker images, see [Create A Container Registry](/azure/container-registry/container-registry-get-started-azure-cli#create-a-container-registry)
31
31
32
-
## Prepare the code of self-hosted OSS Gateway application
32
+
## Prepare the code of self-hosted Spring Cloud Gateway application
33
33
34
-
To get the code of the OSS Gateway:
34
+
To get the code of the Spring Cloud Gateway:
35
35
1. Navigate to https://start.spring.io.
36
36
1. Update the project metadata by setting the `Group` to your orgnization's name. Change the `Artifact` and `Name` to `gateway`.
37
37
1. Add dependencies `Reactive Gateway` and `Spring Boot Actuator`.
@@ -40,8 +40,8 @@ To get the code of the OSS Gateway:
40
40
41
41
Extract the project when it's downloaded.
42
42
43
-
## Configure the OSS Gateway
44
-
Once the OSS 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`.
43
+
## Configure the Spring Cloud Gateway
44
+
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`.
45
45
46
46
The example of `application.yml` is like:
47
47
@@ -79,10 +79,10 @@ spring:
79
79
80
80
### CORS configuration
81
81
82
-
To migrate the Cross-Origin Resource Sharing (CORS) configuration of Spring Cloud Gateway for Tanzu, you can refer to [CORS Configuration for OSS Gateway](https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/#cors-configuration) for global CORS configuration and route CORS configuration.
82
+
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.
83
83
84
84
### Scale
85
-
When migrating to OSS 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
+
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).
86
86
87
87
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.
88
88
@@ -91,11 +91,11 @@ Azure Container Apps supports custom domains and certificates, you can refer to
91
91
92
92
### Routes
93
93
94
-
You can migrate the routes in Spring Cloud Gatewy for Tanzu to OSS 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 OSS Gateway:
94
+
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:
95
95
96
96
- The `name` of the route is mapped to `id`.
97
97
- 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.
98
-
- Predicates and filters of Spring Cloud Gateway for Tanzu are mapped to that of OSS 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.
98
+
- 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.
99
99
100
100
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:
101
101
@@ -117,7 +117,7 @@ For example, consider the following route config JSON file, `test-api.json`, whi
117
117
}
118
118
```
119
119
120
-
Then, the following yaml shows the corresponding route configuration for OSS Gateway:
120
+
Then, the following yaml shows the corresponding route configuration for Spring Cloud Gateway:
121
121
122
122
```yaml
123
123
spring:
@@ -134,15 +134,15 @@ spring:
134
134
- StripPrefix=1
135
135
```
136
136
137
-
Spring Cloud Gateway for Tanzu sets `StripPrefix=1` by default on every route. To migrate to OSS Gateway, you need to explicitly set `StripPrefix=1` in the filter configuration.
137
+
Spring Cloud Gateway for 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.
138
138
139
-
To allow your OSS Gateway application to access other applications through the app name, you need to enable ingress for your Azure Container App applications. You can also use for the accessible FQDN of Azure Container Apps application as the uri of the route, following the format: `https://<app-name>.<container-app-env-name>.<region>.azurecontainerapps.io`.
139
+
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 use for the accessible FQDN of Azure Container Apps application as the uri of the route, following the format: `https://<app-name>.<container-app-env-name>.<region>.azurecontainerapps.io`.
140
140
141
-
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 OSS Gateway.
141
+
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.
142
142
143
143
### Response cache
144
144
145
-
If you enable the response cache globally in Spring Cloud Gateway for Tanzu, use the following configuration in OSS Gateway and see [local cache response global filter](https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/#local-cache-response-global-filter) for more details:
145
+
If you enable the response cache globally in Spring Cloud Gateway for Tanzu, use the following configuration in Spring Cloud Gateway and see [local cache response global filter](https://docs.spring.io/spring-cloud-gateway/docs/current/reference/html/#local-cache-response-global-filter) for more details:
146
146
```yaml
147
147
spring:
148
148
cloud:
@@ -171,15 +171,15 @@ spring:
171
171
172
172
### Integrate with APM
173
173
174
-
To enable application performance monitoring (APM) for OSS Gateway application, refer to [Integrate application performance monitoring into container images](./migrate-to-azure-container-apps-build-application-performance-monitoring.md).
174
+
To enable application performance monitoring (APM) for Spring Cloud Gateway application, refer to [Integrate application performance monitoring into container images](./migrate-to-azure-container-apps-build-application-performance-monitoring.md).
175
175
176
176
## Deploy to Azure Continer Apps
177
177
178
-
Once the OSS Gateway configuration is ready, build the image using Azure Container Registry and deploy it to Azure Container Apps.
178
+
Once the Spring Cloud Gateway configuration is ready, build the image using Azure Container Registry and deploy it to Azure Container Apps.
179
179
180
180
### Build and Push the Docker Image
181
181
182
-
In the OSS Gateway project directory, create a `Dockerfile` with the following contents:
182
+
In the Spring Cloud Gateway project directory, create a `Dockerfile` with the following contents:
183
183
184
184
```dockerfile
185
185
FROM mcr.microsoft.com/openjdk/jdk:17-mariner as build
@@ -233,15 +233,17 @@ az containerapp up \
233
233
--ingress external
234
234
```
235
235
236
-
Access the FQDN of the OSS Gateway application to verify that it is running.
236
+
Access the FQDN of the Spring Cloud Gateway application to verify that it is running.
237
237
238
238
## Troubleshooting
239
239
240
-
If you encounter issues when running the OSS Gateway application, you can view real time and historical logs of the application `gateway` in Azure Container Apps following [Application Logging in Azure Container Apps](/azure/container-apps/logging).
240
+
If you encounter issues when running the Spring Cloud Gateway application, you can view real time and historical logs of the application `gateway` in Azure Container Apps following [Application Logging in Azure Container Apps](/azure/container-apps/logging).
241
241
242
242
To monitor gateway application's metrics, refer to [Monitor Azure Container Apps metrics](/azure/container-apps/metrics)
243
243
244
244
## Known limitation
245
-
OSS Gateway does not support the following commercial features:
245
+
As far as we know, Spring Cloud Gateway does not support the following commercial features:
246
246
- Metadata used to generate OpenAPI documentation
247
247
- Single sign-on (SSO) functionality
248
+
249
+
If these features are required, you may need to consider other commercial solutions, such as Spring Cloud Gateway for Tanzu.
0 commit comments