Kubernetes - symetric PODs

Please read Kubernetes documentation (here) before continuing reading as this chapter is heavily using Kubernetes.

Short description

This configuration is using symetric PODs (all PODs are deployed with same microservices). Main servers running on PODs are not connecting witch each other. Traffic is load balanced to PODs .

Figure 1. Overview diagram.

Install Kubernetes cluster

Please install kubernetes cluster for hosting you application (link).

Prepare docker images

Prepare docker images with your environment configuration. To do so you can use base images provided by JLupin. You only need to add your microservices. If you want, you can also change configuration. The best option is to create dockerfile with rules for creating image. To do so create directory called docker for example. Then inside create directory called microservices and put inside all zip files with your microservices. Also create Dockerfile file in docker directory and put code from below:

FROM jlupin/jlupin-platform-ubuntu:1.6.1.0
USER root

COPY ./microservices/*.zip ${JLUPIN_HOME}/platform/application/

RUN apt-get -qq update
RUN apt-get -y install unzip

RUN unzip ${JLUPIN_HOME}/platform/application/\*.zip -d ${JLUPIN_HOME}/platform/application/
RUN rm ${JLUPIN_HOME}/platform/application/*.zip
RUN chown -R jlapp:jlapp ${JLUPIN_HOME}/platform/application/*

Then build your image with command docker build -t your-image-name .. Then push your image to repository so it will accessible for your kubernetes cluster.

Read more about building images here.

Prepare Deployment

When creating PODs it's bets to set them to fill whole left resources on each node. Prepare deployment with image you had built (in above example the name is your-image-name). Set desired number of instances. Read more here.

Prepare Service

Prepare service which will group your pods ane make them available on every node at specific port (with type of NodePort) or use cloud supported load balancing (with type LoadBalancer). Read more here.

Deploy Deployment and Service

Deploy your created Deployment and Service to kubernetes cluster with kubectl tool.

Setup load balancers and DNS

Now you can setup your load balancers or DNS to allow users to access your application.