GithubHelp home page GithubHelp logo

vaibhavjain / spring-microservices-k8s Goto Github PK

View Code? Open in Web Editor NEW

This project forked from andriykalashnykov/spring-microservices-k8s

0.0 0.0 0.0 136 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%

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

spring-microservices-k8s's People

Contributors

andriykalashnykov avatar joshrosso avatar

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.