https://github.com/albertoimpl/spring-cloud-gateway-accelerator
https://github.com/albertoimpl/spring-cloud-gateway-accelerator
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/albertoimpl/spring-cloud-gateway-accelerator
- Owner: Albertoimpl
- License: mit-0
- Created: 2023-02-16T10:28:00.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-16T12:12:31.000Z (almost 3 years ago)
- Last Synced: 2025-01-23T21:28:41.604Z (about 1 year ago)
- Language: Java
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spring Cloud Gateway for Kubernetes
This is a sample of a Java Spring app that works with Spring Cloud Gateway and the Tanzu Application Platform.
## Dependencies
1. [kubectl CLI](https://kubernetes.io/docs/tasks/tools/)
2. Tanzu CLI and the apps plugin [Tanzu Application Platform](https://network.tanzu.vmware.com/products/tanzu-application-platform)
3. A cluster with Tanzu Application Platform, and the "Default Supply Chain", plus its dependencies. This supply chains
is part of [Tanzu Application Platform](https://network.tanzu.vmware.com/products/tanzu-application-platform).
## Running the sample
Spring Cloud Gateway for Kubernetes is an optional component, so it has to be installed with:
```bash
tanzu package install spring-cloud-gateway --namespace tap-install --package-name spring-cloud-gateway.tanzu.vmware.com --version 1.2.6
```
We are going to deploy a simple service that returns hello:
```bash
tanzu app workload apply -f config/workload.yaml
```
And create our Spring Cloud Gateway instance with a route that points to the hello-service:
```bash
kubectl apply -f gateway/
```
On this example, we have chosen for the Gateway to create a Service with type LoadBalancer:
```bash
GATEWAY_LOADBALANCER_IP=$(kubectl get svc hello-gateway -o=jsonpath='{.status.loadBalancer.ingress[0].ip}')
curl "${GATEWAY_LOADBALANCER_IP}/gateway/hello"
```
Should output:
```text
Greetings from Spring Boot + Tanzu!%
```