Skip to content

Commit f28ee27

Browse files
authored
OSS to Spring Cloud Gateway
1 parent 45a6795 commit f28ee27

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

articles/spring-apps/migration/migrate-to-azure-container-apps-components-gateway.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Note that the features offered by Spring Cloud Gateway for Tanzu are more extens
2929
- [Azure CLI](/cli/azure/install-azure-cli).
3030
- 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)
3131

32-
## Prepare the code of self-hosted OSS Gateway application
32+
## Prepare the code of self-hosted Spring Cloud Gateway application
3333

34-
To get the code of the OSS Gateway:
34+
To get the code of the Spring Cloud Gateway:
3535
1. Navigate to https://start.spring.io.
3636
1. Update the project metadata by setting the `Group` to your orgnization's name. Change the `Artifact` and `Name` to `gateway`.
3737
1. Add dependencies `Reactive Gateway` and `Spring Boot Actuator`.
@@ -40,8 +40,8 @@ To get the code of the OSS Gateway:
4040

4141
Extract the project when it's downloaded.
4242

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`.
4545

4646
The example of `application.yml` is like:
4747

@@ -79,10 +79,10 @@ spring:
7979
8080
### CORS configuration
8181
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.
8383
8484
### 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).
8686

8787
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.
8888

@@ -91,11 +91,11 @@ Azure Container Apps supports custom domains and certificates, you can refer to
9191

9292
### Routes
9393

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:
9595

9696
- The `name` of the route is mapped to `id`.
9797
- 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.
9999

100100
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:
101101

@@ -117,7 +117,7 @@ For example, consider the following route config JSON file, `test-api.json`, whi
117117
}
118118
```
119119

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:
121121

122122
```yaml
123123
spring:
@@ -134,15 +134,15 @@ spring:
134134
- StripPrefix=1
135135
```
136136

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.
138138

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`.
140140

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.
142142

143143
### Response cache
144144

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:
146146
```yaml
147147
spring:
148148
cloud:
@@ -171,15 +171,15 @@ spring:
171171

172172
### Integrate with APM
173173

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).
175175

176176
## Deploy to Azure Continer Apps
177177

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.
179179

180180
### Build and Push the Docker Image
181181

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:
183183

184184
```dockerfile
185185
FROM mcr.microsoft.com/openjdk/jdk:17-mariner as build
@@ -233,15 +233,17 @@ az containerapp up \
233233
--ingress external
234234
```
235235

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.
237237

238238
## Troubleshooting
239239

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).
241241

242242
To monitor gateway application's metrics, refer to [Monitor Azure Container Apps metrics](/azure/container-apps/metrics)
243243

244244
## 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:
246246
- Metadata used to generate OpenAPI documentation
247247
- 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

Comments
 (0)