- Gateway - (This is an API Gateway, where spring cloud gateway is used with Resilience4j and keycloak integration)
- Micro Service 1 - (This is a reative microservice where Resilience4j patterns are implemented with keycloak integration)
- Micro Service 2 - (This is a reative microservice)
- Micro Service 3 - (This is a reative microservice)
- Spring Cloud Gateway - as an API Gateaway
- Resilience4j - for resilience patterns
- Spring Boot - to build microservices
- Keycloak - for identity and access managment
- Jaeger - for distributed tracing
- Prometheus - for monitoring
- Grafana - for monitoring
- Loki - for log monitoring
Please refer Keycloak readme Keycloak configuration
Please refer Gateway readme for Spring Cloud Gateway, Resilience4j and Keycloak configuration
Please refer Micro service 1 readme for Resilience4j and Keycloak configuration
Please refer Grafana how to configure datasources
Please refer Prometheus for prometheus details
Please refer Jaeger for jaeger details
We have deployed everything on kubernetes
Execute this file to create namespace
kubectl apply -f namespace.yml
Execute this file to create redis instance
kubectl apply -f redis.yml
Execute this to deploy NGINX Ingress controller
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/aws/deploy.yaml
Verify pod progress
kubectl get pods -n ingress-nginx -l app.kubernetes.io/name=ingress-nginx --watch
Execute this command to deploy prometheus
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm repo update
helm install -name prom -n monitor stable/prometheus-operator
Execute this file to setup ingress for Prometheus
kubectl apply -f promingress.yml
Verify pod progress
kubectl get pods -n monitor
Try accessing Prometheus with http://prometheus.practice.com
Execute this command to deploy Grafana
helm install -name graph -n monitor stable/grafana
Execute this file to setup ingress for Grafana
kubectl apply -f grafanaingress.yml
Try accessing Grafana with http://grafana.practice.com
Execute the following command
kubectl create -n monitor -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/crds/jaegertracing.io_jaegers_crd.yaml
kubectl create -n monitor -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/service_account.yaml
kubectl create -n monitor -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/role.yaml
kubectl create -n monitor -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/role_binding.yaml
kubectl create -n monitor -f https://raw.githubusercontent.com/jaegertracing/jaeger-operator/master/deploy/operator.yaml
Execute this file to deploy jaeger
kubectl apply -f jaeger_new.yml
Execute this file to setup ingress for jaeger
kubectl apply -f jaegeringress.yml
Verify pod progress
kubectl get pods -n monitor
Try accessing jaeger with http://jaeger.practice.com
Execute this file to setup keycloak
kubectl apply -f keycloak.yml
Execute this file to setup keycloak Ingress controller
kubectl apply -f keycloakingress.yml
Note :- After Keycload is up and Running create realm and configure client
Execute this gateway file to create gateway instance
kubectl apply -f gateway.yml
Execute this gateway ingress file to create gateway ingress
kubectl apply -f gatewayingress.yml
Try accessing http://test.practice.com
How Prometheus know where to scrap prometheus end, we need to create service monitor
Execute this gateway service monitor file to create gateway service monitor
kubectl apply -f gatewayservicemonitor.yml
Check the target in Prometheus
Execute this micro service 1 config map file to create config Map for micro service 1, this is used to inject other service URL and Port
We can create config map based on environment and we don't have to change code on different envoronments
kubectl apply -f ms1configmap.yml
Execute this micro service 1 file to create micro service 1 instance
kubectl apply -f ms1.yml
Execute this micro service 2 file to create micro service 2 instance
kubectl apply -f ms2.yml
Execute this micro service 3 file to create micro service 3 instance
kubectl apply -f ms3.yml
Verify pod progress
kubectl get pods -n monitor
Create service Monitor for these services micro service 1, micro service 2 and micro service 3
kubectl apply -f ms1servicemonitor.yml
kubectl apply -f ms2servicemonitor.yml
kubectl apply -f ms3servicemonitor.yml
Verify the Target in Prometheus
Loki is a log aggregation system inspired by Prometheus.
Excecute this command to install loki
helm repo add loki https://grafana.github.io/loki/charts
helm repo update
helm install loki-stack loki/loki-stack --namespace monitor --set promtail.enabled=true,loki.persistence.enabled=true,loki.persistence.size=1Gi