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.
When you install K3s with the curl script like below, the node will be both a server and agent.
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)
Please let me elaborate with this topic:
From k3s docs:
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:
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:
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.)