Lacritz / kubernetes.test.timeservice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MicroServices Example (TimeService)

About

This project should show the the possibilities 'docker' and 'kubernetes' are capable of. It could be used as a skeleton for further projects. It will cover each step from building a 'Spring-Boot' application in kotlin to running the application in a docker-container. As well as running the MicroServices in a docker-compose. In the last step you can see how to run the services easily in a kubernetes cluster, without even writing a kubernetes file - just by translating the docker-compose via 'kompose'.

Intention

This piece of software should be used as a demo or as a skeleton for kotlin and spring-boot based microservices. It's not intended to be a piece of useful software besides of its demo capabilities.

Preparation

Checkout both services:

Both services are needed to run the

  1. MessageService
  2. TimeService

Install the following software:

  1. Kotlin
  2. Docker
  3. Docker-Compose
  4. MiniKube
  5. kubectl
  6. kompose

Running the services (via Docker-Compose)

Compile

gradle build

Build Docker Image

docker build -t timogruen.com/kubernetes/example/timeservice .

Run 'docker-compose'

Make sure you are in the root directory of the project and the docker image of both services are available.

cd ./docker && docker-compose up -d

Running the services (via Kubernetes)

Compile

gradle build

Build Docker Image

docker build -t timogruen.com/kubernetes/example/timeservice .

Run Minikube

minikube start

To publish your images to your minikube do the following:

eval $(minikube docker-env)
gradle build
docker build -t timogruen.com/kubernetes/example/timeservice .
cd ./docker && kompose up

Further Information

kubectl cheatsheet
minikube external_ip workaround

About


Languages

Language:Kotlin 92.6%Language:Makefile 7.4%