Coder Social home page Coder Social logo

andriykalashnykov / spring-microservices-k8s Goto Github PK

View Code? Open in Web Editor NEW
109.0 5.0 72.0 97 KB

Java Microservices with Spring Boot and Spring Cloud Kubernetes

Home Page: https://tanzu.vmware.com/developer/guides/kubernetes/app-enhancements-spring-k8s/

License: MIT License

Dockerfile 7.84% Java 70.38% Shell 21.78%
java spring-boot microservice kubernetes k8s spring-cloud-kubernetes swagger swagger-ui netflix-ribbon service-discovery

spring-microservices-k8s's Introduction

GitHub CI Status Hits License: MIT

Java Microservices with Spring Boot and Spring Cloud Kubernetes

This is repository accompanies my article for the Tanzu Development Center - Microservices with Spring Cloud Kubernetes Reference Architecture

This Reference Architecture demonstrates design, development, and deployment of Spring Boot microservices on Kubernetes. Each section covers architectural recommendations and configuration for each concern when applicable.

High-level key recommendations:

  • Consider Best Practices in Cloud Native Applications and The 12 Factor App
  • Keep each microservice in a separate Maven or Gradle project
  • Prefer using dependencies when inheriting from parent project instead of using relative path
  • Use Spring Initializr a web application that can generate a Spring Boot project structure, fill in your project details, pick your options, and download a bundled up project

This architecture demonstrates a complex Cloud Native application that addresses following concerns:

  • Externalized configuration using ConfigMaps, Secrets, and PropertySource
  • Kubernetes API server access using ServiceAccounts, Roles, and RoleBindings
  • Health checks using Application Probes
    • readinessProbe
    • livenessProbe
    • startupProbe
  • Reporting application state using Spring Boot Actuators
  • Service discovery across namespaces using DiscoveryClient
  • Exposing API documentation using Swagger UI
  • Building a Docker image using best practices
  • Layering JARs using the Spring Boot plugin
  • Observing the application using Prometheus exporters

Pre-requisites

Clone repository

git clone [email protected]:AndriyKalashnykov/spring-microservices-k8s.git

Start Kubernetes cluster

cd ./spring-microservices-k8s/scripts/
./start-cluster.sh

Configure Kubernetes cluster

cd ./spring-microservices-k8s/scripts/
./setup-cluster.sh

Deploy application to Kubernetes cluster

cd ./spring-microservices-k8s/scripts/
./install-all.sh

Polulate test data

cd ./spring-microservices-k8s/scripts/
./populate-data.sh

Observe Employee service logs

cd ./spring-microservices-k8s/scripts/
./employee-log.sh

Open Swagger UI web interface

cd ./spring-microservices-k8s/scripts/
./gateway-open.sh

Undeploy application from Kubernetes cluster

cd ./spring-microservices-k8s/scripts/
./delete-all.sh

Delete Application specific Kubernetes cluster configuration (namespaces, clusterRole, etc.)

cd ./spring-microservices-k8s/scripts/
./destroy-cluster.sh

Stop Kubernetes cluster

cd ./spring-microservices-k8s/scripts/
./stop-cluster.sh

Stargazers over time

Stargazers over time

spring-microservices-k8s's People

Contributors

andriykalashnykov avatar joshrosso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

spring-microservices-k8s's Issues

同学,您这个项目引入了528个开源组件,存在54个漏洞,辛苦升级一下

检测到 AndriyKalashnykov/spring-microservices-k8s 一共引入了528个开源组件,存在54个漏洞

漏洞标题:Apache Tomcat 信息泄露漏洞
缺陷组件:org.apache.tomcat.embed:[email protected]
漏洞编号:CVE-2021-25122
漏洞描述:Apache Tomcat是美国阿帕奇(Apache)基金会的一款轻量级Web应用服务器。该程序实现了对Servlet和JavaServer Page(JSP)的支持。
Apache Tomcat versions 10.0.0-M1 to 10.0.0, 9.0.0.M1 to 9.0.41 and 8.5.0 to 8.5.61 存在信息泄露漏洞,该漏洞源于可以在一个请求到另一个请求中复制请求头和数量有限的请求体,这意味着用户a和用户B都可以看到用户a的请求结果。
影响范围:[9.0.0.M1, 9.0.43)
最小修复版本:9.0.43
缺陷组件引入路径:vmware.services:[email protected]>org.springframework.boot:[email protected]>org.springframework.boot:[email protected]>org.apache.tomcat.embed:[email protected]

另外还有54个漏洞,详细报告:https://mofeisec.com/jr?p=i4e660

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.