Does it make sense to run Kubernetes on a single server?

11,685

Solution 1

If it is not a production environment, it doesn't matter how many nodes you are using. So yes, it should be just fine in this case. But make sure all the k8s features you will need in production are available in test/dev, to keep things similar and portable.

Solution 2

AFAIU,

I do not see a requirement for kubernetes unless we are doing below at least for single host using native docker run or docker-compose or docker engine swarm mode -

  • Make sure there are enough(>=2) replicas of your app in a single server and you are balancing the load across those apps docker containers.
  • If you want to go bit advanced, we should be able to scale up & down dynamically (docker swarm mode supports this out of the box else use jwilder nginx proxy).
  • Your deployment should not cause a downtime. Make sure a single container is always healthy at any instant of time while deploying.
  • Container should auto heal(restart automatically) in case your HTTP or TCP health check fails.
  • Doing all of the above will certainly put you in a better place but single host is still a single source of failure which you got to deal with at regular intervals.
  • Preferred : if possible try to start with docker engine swarm mode or kubernetes single master or minikube. This will automatically take care of all the above scenarios out of the box and will also allow you to further scale up anytime by adding more nodes without changing much in your YML files for docker swarm or kubernetes.

Ref -
https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ https://docs.docker.com/engine/swarm/

Solution 3

I would use single host k8s only if I managed clusters with the same project that I would like to deploy to the said host. This enables you to reuse manifests and all the automation you've created for your clusters.

Have I had single host environments only, I would probably stick to docker-compose.

Solution 4

If you're looking to try it out your easiest options are probably minikube (easy to run single-node cluster locally but without some features) or using one of the free trial accounts for a managed Kubernetes service from one of the big cloud providers (fully-featured and multi-node but limited use before you have to pay).

Share:
11,685
Florian Lopes
Author by

Florian Lopes

Updated on June 25, 2022

Comments

  • Florian Lopes
    Florian Lopes almost 2 years

    I'm using Docker I have implemented a system to deploy environments (on a single server) based on Git branches using Traefik (*.dev.domain.com) and Docker Compose templates.

    I like Kubernetes and I've never switched to it since I'm limited to one single server for my infrastructure. I've only used it using local installations (Docker for Windows).

    So, my question is: does it make sense to run a Kubernetes "cluster" (master and nodes) on a single server to orchestrate and route containers (in place of Traefik/Rancher/Docker Compose)?

    This use is for development and staging only for the moment, so high availability is not a prerequisite.

    Thanks.