Back to Trending
RepositoryJavaPLPoland
piomin

piomin/sample-spring-microservices-kubernetes

Sample Spring Boot application that uses some features provided by Spring Cloud Kubernetes, Spring Cloud OpenFeign and Spring Cloud Gateway deployed on Kubernetes

538stars
337forks
1issues
1views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: zuul

#1 Repository of the month

1
TINIX TRENDING·Topic: configmap

#1 Repository of the month

1
TINIX TRENDING·Topic: openshift

#1 Repository of the month

Microservices with Spring Boot and Spring Cloud on Kubernetes Demo Project Twitter

CircleCI

SonarCloud Bugs Coverage Lines of Code

In this project I'm demonstrating you the most interesting features of Spring Cloud Project for building microservice-based architecture that is deployed on Kubernetes. All the samples may be easily deployed on local Kubernetes single-node cluster - Minikube.

Books

If you are interested in Java, Spring Boot and Kubernetes, you may find my book "Hands-On Java with Kubernetes" useful. To get a book, go to the following website: Hands-On Java with Kubernetes.

Cover

Getting Started

Currently you may find here some examples of microservices implementation using different projects from Spring Cloud. All the examples are divided into the branches and described in a separated articles on my blog. Here's a full list of available examples:

  1. Using Spring Boot and Spring Cloud for building microservices that may be easily deployed on Kubernetes. The example is available in the branch master. A detailed guide may be find in the following article: Detailed description can be found here: Quick Guide to Microservices with Kubernetes, Spring Boot 2.0 and Docker
  2. An introduction to Spring Cloud Kubernetes project, that shows its the most interesting features like discovery across many namespaces or Spring Boot property sources based on ConfigMap and Secret. The example is available in the branch hybrid. A detailed guide may be find in the following article: Detailed description can be found here: Microservices with Spring Cloud Kubernetes
  3. Using Spring Boot Admin to monitor Spring Boot applications running on Kubernetes. The example is available in the branch master. A detailed guide may be find in the following article: Spring Boot Admin on Kubernetes

Usage

  1. Download and run Minikube using command: minikube start --vm-driver=virtualbox --memory='4000mb'
  2. Build Maven project with using command: mvn clean install
  3. Build Docker images for each module using command, for example: docker build -t piomin/employee:1.1 .
  4. Go to /kubernetes directory in repository
  5. Apply all templates to Minikube using command: kubectl apply -f <filename>.yaml
  6. Check status with kubectl get pods

Architecture

Our sample microservices-based system consists of the following modules:

  • gateway-service - a module that Spring Cloud Netflix Zuul for running Spring Boot application that acts as a proxy/gateway in our architecture.
  • employee-service - a module containing the first of our sample microservices that allows to perform CRUD operation on Mongo repository of employees
  • department-service - a module containing the second of our sample microservices that allows to perform CRUD operation on Mongo repository of departments. It communicates with employee-service.
  • organization-service - a module containing the third of our sample microservices that allows to perform CRUD operation on Mongo repository of organizations. It communicates with both employee-service and department-service.
  • admin-service - a module containing embedded Spring Boot Admin Server used for monitoring Spring Boot microservices running on Kubernetes The following picture illustrates the architecture described above including Kubernetes objects.

You can distribute applications across multiple namespaces and use Spring Cloud Kubernetes DiscoveryClient and Ribbon for inter-service communication.

Before you start

Go to the k8s directory. You will find there several YAML scripts you need to apply before running applications.

  1. privileges.yaml - Role and RoleBinding for Spring Cloud Kubernetes to allow access Kubernetes API from pod
  2. mongo-secret.yaml - credentials for MongoDB
  3. mongo-configmap.yaml - user for MongoDB
  4. mongo-deployment.yaml - Deployment for MongoDB Just apply those scripts using kubectl apply.

You can easily deploy all applications using skaffold dev command.

Similar Projects

Discover other similar projects and AI models.

RepositoryJava
forezp/SpringCloudLearning

《史上最简单的Spring Cloud教程源码》

17.9k
Apr 12, 2021
RepositoryJava
dyc87112/SpringCloud-Learning

Spring Cloud基础教程,持续连载更新中

7.3k
Feb 22, 2023
RepositoryJava
piomin/sample-spring-microservices-new

Demo for Spring Boot and Spring Cloud microservices with distributed configuration (Spring Cloud Config), service discovery (Eureka), API gateway (Spring Cloud Gateway, Zuul), Swagger/OpenAPI documentation (Springdoc), logs correlation using Spring Cloud Sleuth/Micrometer OTEL and many more

1.4k
Nov 22, 2026
RepositoryJava
macrozheng/mall

mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于Spring Boot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。

85.1k
Sep 15, 2026
RepositoryPython
bregman-arie/devops-exercises

Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions

87.1k
Dec 27, 2025
RepositoryGo
netdata/netdata

Full-stack observability · Metrics · Logs · Traces · Flows · Topology · Infrastructure · APM · NPM · DBM · RUM · Synthetics · Cloud · AI SRE · OpenTelemetry · SNMP · NetFlow/IPFIX/sFlow · IPMI · Redfish · 2000+ integrations

81.7k
Nov 30, 2026
RepositoryJava
alibaba/nacos

an easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.

33.6k
Dec 1, 2026
RepositoryJava
apolloconfig/apollo

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.

29.8k
Nov 21, 2026
RepositoryJava
wuyouzhuguli/SpringAll

循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc

28.9k
May 31, 2024