Sample Spring Boot application that uses some features provided by Spring Cloud Kubernetes, Spring Cloud OpenFeign and Spring Cloud Gateway deployed on Kubernetes
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.
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:
minikube start --vm-driver=virtualbox --memory='4000mb'
mvn clean install
docker build -t piomin/employee:1.1 .
/kubernetes
directory in repositorykubectl apply -f <filename>.yaml
kubectl get pods
Our sample microservices-based system consists of the following modules:
You can distribute applications across multiple namespaces and use Spring Cloud Kubernetes DiscoveryClient
and Ribbon
for inter-service communication.
Go to the k8s
directory. You will find there several YAML scripts you need to apply before running applications.
privileges.yaml
- Role
and RoleBinding
for Spring Cloud Kubernetes to allow access Kubernetes API from podmongo-secret.yaml
- credentials for MongoDBmongo-configmap.yaml
- user for MongoDBmongo-deployment.yaml
- Deployment
for MongoDB
Just apply those scripts using kubectl apply
.You can easily deploy all applications using skaffold dev
command.