7

I am aware of the consequences and issues with running a single-node cluster. However, I'm still curious if it's possible. I plan on setting everything up myself.

In other words, can I run the control plane and a worker node on the same physical machine.

3 Answers 3

4

Please let me elaborate with this topic:

"In other words, can I run the control plane and a worker node on the same cluster"

From k3s docs:

A server node is defined as a machine (bare-metal or virtual) running the k3s server command.

A worker node is defined as a machine running the k3s agent command. Adding more agent will create more worker nodes to run your application.

In this concept one master node (running k3s server command and additional agent nodes running the k3s agent command) still create one cluster with single control plane. However you can extend this approach by creating High-Availability K3s Server with multiple server(control planes) and agents nodes.

As per k8s docs:

Control Plane Components:

  • kube-apiserver,
  • etcd,
  • kube-scheduler,
  • kube-controller-manager,
  • cloud-controller-manager,

As I can see there is also an option to run k3s wiht multiple agents on single machine Using Docker as the Container Runtime - K3d ( (K3s in Docker) and docker-compose.

As an alternative please follow:

4
  • Ah sorry, I actually meant a control plane and worker on the same physical machine. I'll correct my question. Aug 11, 2020 at 18:52
  • 1
    So as stated in the answer you can use k3d (k3s in Docker) or create server as vm and additional agent as vm on the same physical machine.
    – Mark
    Aug 12, 2020 at 7:07
  • Can I have two separate machines with K3D that are part of the same cluster though? Is that still possible? Aug 12, 2020 at 8:36
  • I did not try but looking into the docs you can find - to run the agent only in Docker, "alternatively the docker run" and there you should provide server_url. So it looks if server is accessible via network it should work.
    – Mark
    Aug 13, 2020 at 7:03
6

When you install K3s with the curl script like below, the node will be both a server and agent.

curl -sfL https://get.k3s.io | sh -

So, by default the server and agent are deployed together on the same node. Answered here https://github.com/k3s-io/k3s/issues/1279#issuecomment-574332274 by David Nuzik (Rancher Labs (SUSE) Project Manager)

1

Very much so, of course. The consequences are simply that you have no HV as the respective redundancy is missing.

The official documentation even has a section on setting up a single control-plane cluster with kubeadm.

(When talking about "the same physical machine" I would highly encourage you to setup two VMs on there, one for the control plane node, one for the worker.)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .