Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

7/15/24, 2:33 PM eazybytes/microservices: Microservices With Spring, Docker, Kubernetes - Code Examples

eazybytes /
microservices

Code Issues Pull requests 6 Actions Projects Security Insights

Microservices With Spring, Docker, Kubernetes - Code Examples

www.udemy.com/course/master-microservices-with-spring-docker-kubernetes/?referralcode=9365db9b7ee637f629a9

Apache-2.0 license

332 stars 360 forks 10 watching 3 Branches 0 Tags Activity

Public repository

3.2.3 3 Branches 0 Tags Go to file t Go to file Add file Code

eazybytes Event Driven microservices using Kafka,Spring Cloud Functions & Stream 319040d · 2 months ago

section2 Build Accounts, Loans and Cards microservices 4 months ago

section4 Making microservices Docker compatible 4 months ago

section6 Config management inside microservices 4 months ago

section7 Using MySQL DBs inside microservices 4 months ago

section8 Service Discovery & Registration with Eureka 4 months ago

section9 Edge Server using Spring Cloud Gateway 4 months ago

section_10 Making Microservices Resilient using Resilience4j 4 months ago

section_11 Observability and monitoring in microservices 2 months ago

section_12 Microservices Security using OAuth2 2 months ago

section_13 Event Driven microservices using RabbitMQ,Spri… 2 months ago

section_14 Event Driven microservices using Kafka,Spring C… 2 months ago

section_15/kubernetes Deploying all microservices into Kubernetes clus… 4 months ago

section_16/helm Deep Dive on Helm 4 months ago

section_17 Server-side service discovery and load balancing 4 months ago

.gitignore Thanks for choosing to learn from EazyBytes last year

LICENSE Initial commit last year

Microservice.png Thanks for choosing to learn from EazyBytes 6 months ago

Microservices.postman_collection.json Thanks for choosing to learn from EazyBytes 10 months ago

README.md Thanks for choosing to learn from EazyBytes 3 months ago

Master Microservices with Spring Boot, Docker, Kubernetes

https://github.com/eazybytes/microservices 1/6
7/15/24, 2:33 PM eazybytes/microservices: Microservices With Spring, Docker, Kubernetes - Code Examples

Learn how to create enterprise and production ready Microservices with Spring, Spring Cloud, Docker and Kubernetes.

Topics covered in the course


Section 1 - Introduction to Microservices Architecture
Section 2- Building microservices using Spring Boot
Section 3 - How do we right size our microservices & identify boundaries
Section 4 - Handle deployment, portability & scalability of microservices using Docker
Section 5 - Deep Dive on Cloud Native Apps & 15-Factor methodology
Section 6 - Configurations Management in Microservices
Section 7 - Using MySQL DBs inside microservices
Section 8 - Service Discovery & Service Registration in microservices
Section 9 - Gateway, Routing & Cross cutting concerns in Microservices
Section 10 - Making Microservices Resilient
Section 11 - Observability and monitoring of microservices
Section 12 - Microservices Security
Section 13 - Event Driven microservices using RabbitMQ,Spring Cloud Functions & Stream
Section 14 - Event Driven microservices using Kafka,Spring Cloud Functions & Stream
Section 15 - Container Orchestration using Kubernetes
Section 16 - Deep dive on Helm
Section 17 - Server-side service discovery and load balancing using Kubernetes
Section 18 - Deploying microservices into cloud K8s cluster
Section 19 - Introduction to K8s Ingress, Service Mesh (Istio) & mTLS
Section 20 - Congratulations & Thank You

Pre-requisite for the course


Good understanding on Java and Spring concepts
Basic understanding on SpringBoot & REST services is a bonus but not mandatory
Interest to learn and explore about Microservices

Important Links
Spring Boot - https://spring.io/projects/spring-boot
Create SpringBoot project - https://start.spring.io
DTO pattern blog - https://martinfowler.com/eaaCatalog/dataTransferObject.html
Model Mapper - http://modelmapper.org/
Map Struct - https://mapstruct.org/
Spring Doc - https://springdoc.org/
Open API - https://www.openapis.org/
Lucidchart Blog - https://www.lucidchart.com/blog/ddd-event-storming
Docker website - https://www.docker.com
Docker hub website - https://hub.docker.com
Buildpacks website - https://buildpacks.io
Google Jib website - https://github.com/GoogleContainerTools/jib
Docker compose website - https://docs.docker.com/compose/
Twelve-Factor methodology - https://12factor.net
Beyond the Twelve-Factor App book - https://www.oreilly.com/library/view/beyond-the-twelve-factor/9781492042631/
Spring Cloud website - https://spring.io/projects/spring-cloud

https://github.com/eazybytes/microservices 2/6
7/15/24, 2:33 PM eazybytes/microservices: Microservices With Spring, Docker, Kubernetes - Code Examples
Spring Cloud Config website - https://spring.io/projects/spring-cloud-config
Spring Cloud Bus website - https://spring.io/projects/spring-cloud-bus
RabbitMQ website - https://www.rabbitmq.com
Hookdeck website- https://hookdeck.com
Spring Cloud Netflix website - https://spring.io/projects/spring-cloud-netflix
Spring Cloud OpenFeign - https://spring.io/projects/spring-cloud-openfeign
Netflix Blog - https://netflixtechblog.com/netflix-oss-and-spring-boot-coming-full-circle-4855947713a0
Resilience4j website - https://resilience4j.readme.io
Spring Cloud Gateway website - https://spring.io/projects/spring-cloud-gateway
Stripe RateLimitter pattern blog - https://stripe.com/blog/rate-limiters
Apache Benchmark website - https://httpd.apache.org
Grafana website - https://grafana.com
Grafana Loki setup - https://grafana.com/docs/loki/latest/get-started/quick-start/
Micrometer website - https://micrometer.io
Prometheus website - https://prometheus.io/
Grafana Dashboards - https://grafana.com/grafana/dashboards/
OpenTelemetry website - https://opentelemetry.io/
OpenTelemetry automatic instrumentation - https://opentelemetry.io/docs/instrumentation/java/automatic/
Keycloak website - https://www.keycloak.org/
Apache Kafka website - https://kafka.apache.org
Docker compose file for Kafka - https://github.com/bitnami/containers/blob/main/bitnami/kafka/docker-compose.yml
Local Kubernetes Cluster with Docker Desktop - https://docs.docker.com/desktop/kubernetes/
Kubernetes Dashboard - https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/
Helm website - https://helm.sh
Chocolatey website - https://chocolatey.org/
Bitnami Helm charts GitHub repo - https://github.com/bitnami/charts
Spring Cloud Kubernetes website - https://spring.io/projects/spring-cloud-kubernetes
Spring Cloud Kubernetes Blog - https://spring.io/blog/2021/10/26/new-features-for-spring-cloud-kubernetes-in-spring-cloud-2021-0-0-
m3
GCP website - https://cloud.google.com
GCP SDK installation - https://cloud.google.com/sdk/docs/install
Kubernetes Ingress - https://kubernetes.io/docs/concepts/services-networking/ingress/
Ingress Controllers - https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/
Istio (Service mesh) - https://istio.io

Maven Commands used in the course

Maven Command Description

"mvn clean install -Dmaven.test.skip=true" To generate a jar inside target folder

"mvn spring-boot:run" To start a springboot maven project

"mvn spring-boot:build-image" To generate a docker image using Buildpacks. No need of Dockerfile

"mvn compile jib:dockerBuild" To generate a docker image using Google Jib. No need of Dockerfile

Docker Commands used in the course

Docker Command Description

To generate a docker image based on a


"docker build . -t eazybytes/accounts:s4"
Dockerfile

To start a docker container based on a


"docker run -p 8080:8080 eazybytes/accounts:s4"
given image

To list all the docker images present in


"docker images"
the Docker server

To display detailed image information


"docker image inspect image-id"
for a given image id

https://github.com/eazybytes/microservices 3/6
7/15/24, 2:33 PM eazybytes/microservices: Microservices With Spring, Docker, Kubernetes - Code Examples

Docker Command Description

To remove one or more images for a


"docker image rm image-id"
given image ids

To push an image or a repository to a


"docker image push docker.io/eazybytes/accounts:s4"
registry

To pull an image or a repository from a


"docker image pull docker.io/eazybytes/accounts:s4"
registry

"docker ps" To show all running containers

To show all containers including running


"docker ps -a"
and stopped

"docker container start container-id" To start one or more stopped containers

To pause all processes within one or


"docker container pause container-id"
more containers

To unpause all processes within one or


"docker container unpause container-id"
more containers

"docker container stop container-id" To stop one or more running containers

To kill one or more running containers


"docker container kill container-id"
instantly

"docker container restart container-id" To restart one or more containers

To inspect all the details for a given


"docker container inspect container-id"
container id

"docker container logs container-id" To fetch the logs of a given container id

To follow log output of a given container


"docker container logs -f container-id"
id

To remove one or more containers based


"docker container rm container-id"
on container ids

"docker container prune" To remove all stopped containers

To create and start containers based on


"docker compose up"
given docker compose file

"docker compose down" To stop and remove containers

To start containers based on given


"docker compose start"
docker compose file

"docker compose down" To stop the running containers

"docker run -p 3306:3306 --name accountsdb -e MYSQL_ROOT_PASSWORD=root -e


To create a MySQL DB container
MYSQL_DATABASE=accountsdb -d mysql"

"docker run -p 6379:6379 --name eazyredis -d redis" To create a Redis Container

"docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e


To create Keycloak Container
KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:22.0.3 start-dev"

Apache Benchmark command used in the course

Apache Benchmark command Description

"ab -n 10 -c 2 -v 3 http://localhost:8072/eazybank/cards/api/contact-info" To perform load testing on API by sending 10 requests

Kubernetes Commands used in the course

Kubernetes Command Description

To create a deployment/service/configmap based on


"kubectl apply -f filename"
a given YAML file

https://github.com/eazybytes/microservices 4/6
7/15/24, 2:33 PM eazybytes/microservices: Microservices With Spring, Docker, Kubernetes - Code Examples

Kubernetes Command Description

"kubectl get all" To get all the components inside your cluster

"kubectl get pods" To get all the pods details inside your cluster

"kubectl get pod pod-id" To get the details of a given pod id

"kubectl describe pod pod-id" To get more details of a given pod id

"kubectl delete pod pod-id" To delete a given pod from cluster

"kubectl get services" To get all the services details inside your cluster

"kubectl get service service-id" To get the details of a given service id

"kubectl describe service service-id" To get more details of a given service id

"kubectl get nodes" To get all the node details inside your cluster

"kubectl get node node-id" To get the details of a given node

"kubectl get replicasets" To get all the replica sets details inside your cluster

"kubectl get replicaset replicaset-id" To get the details of a given replicaset

"kubectl get deployments" To get all the deployments details inside your cluster

"kubectl get deployment deployment-id" To get the details of a given deployment

"kubectl get configmaps" To get all the configmap details inside your cluster

"kubectl get configmap configmap-id" To get the details of a given configmap

"kubectl get events --sort-by=.metadata.creationTimestamp" To get all the events occured inside your cluster

To set the number of replicas for a deployment


"kubectl scale deployment accounts-deployment --replicas=1"
inside your cluster

"kubectl set image deployment gatewayserver-deployment To set a new image for a deployment inside your
gatewayserver=eazybytes/gatewayserver:s11 --record" cluster

To know the rollout history for a deployment inside


"kubectl rollout history deployment gatewayserver-deployment"
your cluster

To rollback to a given revision for a deployment


"kubectl rollout undo deployment gatewayserver-deployment --to-revision=1"
inside your cluster

"kubectl get pvc" To list the pvcs inside your cluster

"kubectl delete pvc data-happy-panda-mariadb-0" To delete a pvc inside your cluster

Helm Commands used in the course

Helm Command Description

"helm create [NAME]" Create a default chart with the given name

"helm dependencies build" To recompile the given helm chart

"helm install [NAME] [CHART]" Install the given helm chart into K8s cluster

Releases

No releases published

Packages

No packages published

Languages

https://github.com/eazybytes/microservices 5/6
7/15/24, 2:33 PM eazybytes/microservices: Microservices With Spring, Docker, Kubernetes - Code Examples
Java 85.3% Smarty 14.5% Other 0.2%

https://github.com/eazybytes/microservices 6/6

You might also like