Skip to content

realboutouil/spring-grpc-microservices-kubernetes

Repository files navigation

Template Project w/ gRPC Microservices and Kubernetes

gRPC Microservices (Spring Boot + Java) with Kubernetes and Docker on AWS EKS & K3s (Lightweight Kubernetes)

This is a complete template project for demo purposes, using the latest technologies with deployment tools.

It shows how to

  1. use lightweight communication protocol to communicate between micro-services like gRPC using Spring Boot and Java;
  2. package a Spring Boot application into a Docker image, using Skaffold and Google Jib;
  3. Deploy it into your Kubernetes cluster.

Requirements

You will need the following in your system:

(Note: if you want to work directly with your remote AWS cluster, having a local cluster is not strictly needed but strongly advised!)

Lifecycle

Build your code push to registry

This builds and pushes a container image for your application to a container registry. If you encounter authentication issues, see Authentication Methods .

./gradlew jib

(Note: please put your registry info in gradle.properties " registryName", "registryUser", "registryPassword" :))

Run and Deploy

First you must configure your cluster to use Container Registry if you are using a private registry *Good Article As example ( Github Registry):

kubectl create secret docker-registry my-ghcr \
        --docker-server=ghcr.io \
        --docker-username=dummy \
        --docker-password=dummyToken \
        --docker-email=dummy@dummy.com \
        --namespace=default

You code in your IDEs and deploy/run explicitly by typing:

skaffold run --port-forward # to test call `curl http://127.0.0.1:5000/grpc-client/users`

(Note: Istio gateway are exposed to port 80 with /api prefix your url it will look like this http: //{YourClusterIp}/api/grpc-client/users )

Happy coding!

Delete your deployment

skaffold delete

About

gRPC Microservices and Kubernetes (Spring, EKS, Docker)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages