Skip to content

Repository files navigation

Master Microservices with Spring Boot, Docker, Kubernetes

Image

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

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
"docker build . -t eazybytes/accounts:s4" To generate a docker image based on a Dockerfile
"docker run -p 8080:8080 eazybytes/accounts:s4" To start a docker container based on a given image
"docker images" To list all the docker images present in the Docker server
"docker image inspect image-id" To display detailed image information for a given image id
"docker image rm image-id" To remove one or more images for a given image ids
"docker image push docker.io/eazybytes/accounts:s4" To push an image or a repository to a registry
"docker image pull docker.io/eazybytes/accounts:s4" To pull an image or a repository from a registry
"docker ps" To show all running containers
"docker ps -a" To show all containers including running and stopped
"docker container start container-id" To start one or more stopped containers
"docker container pause container-id" To pause all processes within one or more containers
"docker container unpause container-id" To unpause all processes within one or more containers
"docker container stop container-id" To stop one or more running containers
"docker container kill container-id" To kill one or more running containers instantly
"docker container restart container-id" To restart one or more containers
"docker container inspect container-id" To inspect all the details for a given container id
"docker container logs container-id" To fetch the logs of a given container id
"docker container logs -f container-id" To follow log output of a given container id
"docker container rm container-id" To remove one or more containers based on container ids
"docker container prune" To remove all stopped containers
"docker compose up" Creates and starts containers based on the given Docker Compose file
"docker compose down" Stops and removes containers, networks, volumes, and images created by up
"docker compose start" Starts existing (previously created) containers without recreating them
"docker compose stop" Stops running containers without removing them
"docker run -p 3306:3306 --name accountsdb -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=accountsdb -d mysql" To create a MySQL DB container
"docker run -p 6379:6379 --name eazyredis -d redis" To create a Redis Container
"docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:22.0.3 start-dev" To create Keycloak Container

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
"kubectl config get-contexts" To list the contexts (clusters that kubectl can talk to)
"kubectl config get-clusters" To list the clusters that kubectl knows about
"kubectl config use-context [CONTEXT_NAME]" To switch kubectl to a given context
"kubectl get nodes" To list the nodes inside your cluster
"kubectl get nodes -o wide" To list the nodes with extra details, including each node's internal IP
"kubectl get namespaces" To list all the namespaces inside your cluster
"kubectl create namespace [NAMESPACE]" To create a namespace imperatively
"kubectl describe namespace [NAMESPACE]" To show detailed information about a given namespace
"kubectl get namespaces -l [LABEL_KEY]=[LABEL_VALUE]" To find namespaces by label
"kubectl delete namespace [NAMESPACE]" To delete a namespace along with everything inside it
"kubectl apply -f [FILE_NAME]" To create or update the K8s objects defined in a given YAML file
"kubectl apply -f [FILE_NAME_1] -f [FILE_NAME_2]" To create or update the K8s objects defined in multiple YAML files in one command
"kubectl get configmaps -n [NAMESPACE]" To list the ConfigMaps inside a namespace
"kubectl describe configmap [CONFIGMAP_NAME] -n [NAMESPACE]" To show the details of a given ConfigMap
"kubectl get secrets -n [NAMESPACE]" To list the Secrets inside a namespace
"kubectl describe secret [SECRET_NAME] -n [NAMESPACE]" To show the details of a given Secret (values stay hidden)
"kubectl get secret [SECRET_NAME] -n [NAMESPACE] -o yaml" To show the full Secret object, including the Base64-encoded values
"kubectl get deployments -n [NAMESPACE]" To list the Deployments inside a namespace
"kubectl get replicasets -n [NAMESPACE]" To list the ReplicaSets inside a namespace
"kubectl get pods -n [NAMESPACE]" To list the pods inside a namespace
"kubectl get pods -n [NAMESPACE] -o wide" To list the pods with extra details, like the node and pod IP
"kubectl get pods -n [NAMESPACE] -w" To watch pod status changes live (Ctrl+C to stop)
"kubectl describe pod [POD_NAME] -n [NAMESPACE]" To show the details of a given pod, including the Events section
"kubectl delete pod [POD_NAME] -n [NAMESPACE]" To delete a given pod (useful to watch self-healing)
"kubectl logs [POD_NAME] -n [NAMESPACE]" To view the container logs of a given pod
"kubectl logs deploy/[DEPLOYMENT_NAME] -n [NAMESPACE]" To view the container logs of a pod belonging to a given Deployment
"kubectl logs -f deploy/[DEPLOYMENT_NAME] -n [NAMESPACE]" To follow the container logs of a pod belonging to a given Deployment
"kubectl exec -it deploy/[DEPLOYMENT_NAME] -n [NAMESPACE] -- [COMMAND]" To run a command inside a container of a given Deployment
"kubectl get services -n [NAMESPACE]" To list the Services inside a namespace, including their types and external IPs
"kubectl describe service [SERVICE_NAME] -n [NAMESPACE]" To show the details of a given Service, including its endpoints
"kubectl port-forward service/[SERVICE_NAME] [LOCAL_PORT]:[SERVICE_PORT] -n [NAMESPACE]" To forward a local port to a given Service
"kubectl get all -n [NAMESPACE] -l [LABEL_KEY]=[LABEL_VALUE]" To list all the components inside a namespace matching a given label
"kubectl get events -n [NAMESPACE]" To list the events that occurred inside a namespace
"kubectl get events -n [NAMESPACE] --sort-by=.metadata.creationTimestamp" To list the events sorted by creation time, so the latest appear last
"kubectl rollout status deployment/[DEPLOYMENT_NAME] -n [NAMESPACE]" To wait for the rollout of a given Deployment to complete
"kubectl rollout history deployment/[DEPLOYMENT_NAME] -n [NAMESPACE]" To show the revision history of a given Deployment
"kubectl annotate deployment/[DEPLOYMENT_NAME] kubernetes.io/change-cause="[MESSAGE]" -n [NAMESPACE]" To record a note about a change (shown in the CHANGE-CAUSE column of the rollout history)
"kubectl rollout undo deployment/[DEPLOYMENT_NAME] -n [NAMESPACE]" To roll back a given Deployment to its previous revision
"kubectl rollout undo deployment/[DEPLOYMENT_NAME] --to-revision=[REVISION] -n [NAMESPACE]" To roll back a given Deployment to a specific revision
"kubectl run [POD_NAME] --rm -it --image=[IMAGE] -n [NAMESPACE] -- sh" To start a temporary pod with a shell, deleted automatically on exit

Helm Commands used in the course

[CHART] can be a local chart directory (e.g. .) or a remote chart reference (e.g. oci://ghcr.io/stefanprodan/charts/podinfo).

Helm Command Description
"helm version" To display the installed Helm client version
"helm search hub [KEYWORD]" To search Artifact Hub for charts matching a given keyword
"helm show chart [CHART]" To display the metadata (Chart.yaml) of a given chart
"helm create [CHART_NAME]" To create a new chart with the default structure and files
"helm dependency list [CHART]" To list the dependencies (sub-charts) of a given chart and their status
"helm dependency build [CHART]" To download/package the dependencies of a given chart into its charts/ folder
"helm lint [CHART]" To check a given chart for errors and best-practice issues
"helm lint [CHART] -f [VALUES_FILE]" To lint a given chart using the values from a specific values file
"helm template [RELEASE_NAME] [CHART]" To render the chart templates locally and print the generated K8s manifests
"helm template [RELEASE_NAME] [CHART] --show-only [TEMPLATE_PATH]" To render only a single template of a given chart
"helm install [RELEASE_NAME] [CHART] --dry-run=server" To simulate an install, validating the rendered manifests against the K8s cluster without creating anything
"helm install [RELEASE_NAME] [CHART]" To install a given chart into the K8s cluster as a new release
"helm install [RELEASE_NAME] [CHART] --version [CHART_VERSION] --set [KEY]=[VALUE]" To install a specific chart version, overriding default values from the command line
"helm list" (or "helm ls") To list all the Helm releases inside the current namespace
"helm get manifest [RELEASE_NAME]" To display the K8s manifests deployed by a given release
"helm upgrade [RELEASE_NAME] [CHART]" To upgrade a given release with the latest changes of a chart
"helm history [RELEASE_NAME]" To display the revision history of a given release
"helm rollback [RELEASE_NAME] [REVISION]" To roll back a given release to a previous revision
"helm uninstall [RELEASE_NAME]" To uninstall a given release and remove all of its K8s resources

Releases

Packages

Used by

Contributors

Languages