Run k8s on single node without minikube

12/9/2019

is it possible to run k8s on single node without using minikube? Today I use kubeadm with 2 hosts, but I would like to know if it is possible to run using only one host.

-- Clarencio
kubernetes

2 Answers

12/9/2019

You need to look into the hardware requirements for running a single node cluster. You would need to run

  1. etcd which is the backing store for all cluster data.
  2. Control plane software(scheduler, controller manager, api-server, kubeadm)
  3. Worker node software(kubectl, kube-proxy) all on one node.

When installing kube-adm I see the hardware requirements(https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/) as 2 GB or more of RAM per machine (any less will leave little room for your apps) and 2 CPUs or more

Example configurations for etcd (https://github.com/etcd-io/etcd/blob/master/Documentation/op-guide/hardware.md#example-hardware-configurations).

For the CKA exam training material the recommended node setting for a single machine is 2 vcpu's and 7.5 GB memory with a note of caution that you may experience slowness. I am going by Ubuntu 18.04 Linux for my recommendations. Another thing you need to do is disable the swap(https://serverfault.com/questions/881517/why-disable-swap-on-kubernetes). It is necessary since kubernetes makes maximum use of disk and cpu resources provided.

So if it for your learning. Go ahead and start with 2 vcpu's and 7.5 GB memory.

-- randominstanceOfLivingThing
Source: StackOverflow

12/10/2019

You can run kubeadm init command to initialize single node cluster. You can add/remove nodes to the cluster.

taint the master so that it can run containers using the below command

kubectl taint nodes --all node-role.kubernetes.io/master-
-- P Ekambaram
Source: StackOverflow