-
Hello. I'm new to kubernetes and am using k3s as my learning tool (a great one at that). I'm using the official docker image of k3s (v1.23.1_k3s1) to serve as my master on my Linux laptop. I have two worker nodes running on a couple Raspberry Pi 2s and joined to the cluster without issues. The problem is that if I bring the k3s container down and then back up (docker-compose down/up -d), I see another master node being created. The previous running node goes to "NotReady" status and the new instance is "Ready". Every docker-compose down and up seems to bring another master node instance and puts all the previous ones to "NotReady". I've been deleting the ones that are not running manually (delete node).
Is this expected behavior? My docker-compose.yml is shown below. I removed the "agent" section but otherwise it's more or less the same as the official copy.
Any help would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
You're not assigning a fixed hostname to your Docker container, so every time you stop and start it, the node name changes. Thats why you see a new node in the cluster every time you restart. |
Beta Was this translation helpful? Give feedback.
-
brandond surely already gave you the right answer. But if you just want to learn how to use kubernetes, you should take a look at https://k3d.io . This will give you k3s in docker without any headaches. |
Beta Was this translation helpful? Give feedback.
You're not assigning a fixed hostname to your Docker container, so every time you stop and start it, the node name changes. Thats why you see a new node in the cluster every time you restart.