mr-rohangupta / SpringBoot-Microservice-K8s

SpringBoot-Microservice-K8s is the extension of my SpringBoot-Microservice project but here you can start the services using Docker, Kubernetes, Kube Forwarder etc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SpringBoot-Microservice-K8s

This Project is a set of Microservice which we already developed in SpringBoot-Microservice project.

The difference is here we can directly start microservices using Docker and Kubernetes. We need to follow the below steps to make this service up and running using Kubernetes and Docker File.

Pre-requisites

-> The pre-requisites is one should be aware of the basics of docker and kubernetes before starting, have a docker account which can be created using (https://hub.docker.com/).

Steps to follow

i) Clone this repository.

ii) Install Docker for windows using https://docs.docker.com/docker-for-windows/install/

iii) If you are now registered with Docker update your settings.xml file add one more server tag in that file with id as docker.io & provide your username and password of docker.io

iv)Now install chocolatey, to do that first copy the command from its official website then run powershell as Admin and paste that command.

v)Once chocolatey is successfully installed then install the followings:

1)Kubernetes-Cli: `choco install kubernetes-cli`

2)Minikube: `choco install minikube`

vi)Finally you can start Docker for Windows first then you can start minikube by using minikube start command in powershell.

vii)Now you can open the services one by one in intellij Idea and use mvn clean package dockerfile:push command to push the docker image of every service.

viii)Once all the images are pushed in docker.io then you can navigate to k8s folder with powershell and use kubectl apply -f ./ command also if you want to delete every image navigate to the same folder and write kubectl delete -f ./ command.

ix)kubectl apply command will create all the deployments, services etc for every service.

x)Then you can use the below commands to check the status:

1)minikube dashboard: Used to open the kubernetes dashboard

2)kubectl get all: Give you a list of all the resources and components we had created

3)kubectl get nodes: Get the nodes available

4)kubectl cluster-info: Get the information of cluster

5)minikube service list: Get the list of services available

xi)Download kube-forwarder for windows and use it with minikube cluster.

xii)Once its started open kube-forwarder and add two resources there in default cluster as minikube.

1)First will be the eureka-lb with kind as Service, name as eureka-lb, local port as 8761 and resource port as 80

2)Second is cloud-gateway-svc with kind as Service, name as cloud-gateway-svc, local port as 9191 and resource port as 80

About

SpringBoot-Microservice-K8s is the extension of my SpringBoot-Microservice project but here you can start the services using Docker, Kubernetes, Kube Forwarder etc


Languages

Language:Java 97.2%Language:Dockerfile 2.8%