Skip to content

ogawa-takeshi/spring-cloud-gateway-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Cloud Gateway Sample

Requirements

Setup Minikube

Start Minikube

minikube start -p sample --cpus 4 --memory 8192

Set profile to sample

minikube profile sample
✅  minikube profile was successfully set to sample

Make sure the context is a sample

kubectl config current-context
sample

Install ingress addons

minikube addons enable ingress
✅  ingress was successfully enabled

minikube addons enable ingress-dns
✅  ingress-dns was successfully enabled

Create a file in /etc/resolver/minikube-test
Replace <YOUR_MINIKUBE_IP> with your minikube ip

domain test
nameserver <YOUR_MINIKUBE_IP>
search_order 1
timeout 5

Create application docker images

eval $(minikube docker-env)
pack build sample/gateway --path gateway --builder cloudfoundry/cnb:bionic
pack build sample/service-a --path service-a --builder cloudfoundry/cnb:bionic
pack build sample/service-b --path service-b --builder cloudfoundry/cnb:bionic
pack build sample/service-c --path service-c --builder cloudfoundry/cnb:bionic

Create k8s components on Minikube

kubectl apply -f ./k8s-manifests/ 

Setup Keycloak

Login

http://keycloak.sample.test/
ID: keycloak / PW: keycloak

Add realm

Add realm
Import: realm-sample.json Name: sample

Add user

Add any user to the sample realm.

Endpoints

Gateway (Login):
http://gateway.sample.test/login

Service A:
http://gateway.sample.test/a/hello

Service B:
http://gateway.sample.test/b/hello

Keycloak:
http://keycloak.sample.test/

Prometheus:
http://prometheus.sample.test/

Grafana:
http://grafana.sample.test/

Clean up

minikube delete -p sample

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages