How to deploy to kubernetes

11/10/2018

I have a website with

  • a react frontend container

  • a node backend container

  • an admin panel container

  • a database on a separate machine

All the containers are stateless and i want to run

  • 2 instances of frontend load balanced on domain.com,

  • 2 instances of backend on backend.domain.com,

  • 1 instance of admin panel on panel.domain.com

I am currently running this in docker with nginx reverse proxy to direct traffic to containers based on subdomain.

I want to move this setup to kubernetes so

My questions are

  1. What all can be the pods in this case?

  2. What will be the deployment here? Will there be multiple deployements?

  3. Do I need a nginx reverse proxy to direct traffic based on sub domain to pods?

-- Anoop Krishnan
kubernetes
kubernetes-ingress

2 Answers

10/16/2019

Yes you can to do it. 2 way. First way create docker regestry and deploy in Kubernetes Second way deploy all in kubernetes.

-- noute
Source: StackOverflow

11/10/2018

IMO you can go with below k8s constructs

  • Frontend: A deployment and service with ingress route to service
  • Backend: A deployment and a service
  • Admin panel: A deployment and service with ingress route to service

Pods will be taken care by deployment, and service will ensure that you can scale deployment as you will.

For ingress you can start trying out it, nginx ingress controller https://kubernetes.io/docs/concepts/services-networking/ingress/#ingress-controllers, probably load-test and try with ingress controller suits for your need.

For database I would right now, to keep in separate machine itself, don't migrate to k8s now, get comfortable with k8s for a while

-- murarisumit
Source: StackOverflow