-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pod deploying on master and not on node #1402
Comments
Did you taint the master node? I believe by default k3s will not taint it.
|
@carpenike I did not specify it explicitly. |
@carpenike If you taint the node master node like that, what happens if you delete the coredns pod? It wouldn't be able to reschedule on the master node again, would it ? |
@Kerwood -- correct. You'd have to use a toleration within a deployment to allow deployments on the master node. Also, I mis-wrote that. It's taint, not label.
My suspicion is that it's choosing the node with the most available resources when doing the node selection, and choosing the Pi4. |
I have been trying different things to achieve the same the last couple of days. 1.Taint the master with below command.
2. Add tolerance on the control-plane services.
And add the following to the containers spec.
Do the same for |
It would be nice to have the install script recognize this setup (e.g. --no-schedule-master or some kind of flag) that would grant these the appropriate tolerations automatically. |
For the sake of completeness. Merged request above (https://github.com/rancher/k3s/pull/1275/files) takes care of this, however (at the time of writing) it's not yet released. On older versions you can "future proof" the behaviour of the merge request by creating a spec:
template:
spec:
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule" and running kubectl patch deployment metrics-server -n kube-system --patch "$(cat patch.yaml)"
kubectl patch deployment coredns -n kube-system --patch "$(cat patch.yaml)"
kubectl patch deployment local-path-provisioner -n kube-system --patch "$(cat patch.yaml)" from the same folder. Master node must have a following taint |
@alekc It is my understanding that if the k3s-master is rebooted those will get overwritten or am I wrong? |
To add up on @alekc's answer, I also had to patch the service load balancer: $ kubectl patch daemonset svclb-traefik -n kube-system --patch "$(cat patch.yaml)" |
Right, I've been deploying with |
I attached a label to the node and used the See: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/ |
Try this command to avoid pods on master node |
Version:
1.17
Describe the bug
I am trying to deploy a k3s cluster on two Raspberry Pi computers. Thereby, I would like to use the Rapsberry Pi 4 as the master/server of the cluster and a Raspberry Pi 3 as a worker node/agent.
However, when I try to make a deployment the pod is always deployed on the Raspberry Pi 4 (master) and not on the worker node.
To Reproduce
On both computers:
cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
into /boot/cmdline.txtOn master Raspberry Pi 4:
curl -sfL https://get.k3s.io | sh -
sudo kubectl run nginx-sample -image nginx --port 80
On worker node Raspberry Pi 3:
curl -sfL https://get.k3s.io | K3S_URL=https://myserver:6443 K3S_TOKEN=XXX sh -
Expected behavior
The command
sudo kubectl get pods -o wide --all-namespaces
should show that the pod is deployed on the worker node.Actual behavior
The command
sudo kubectl get pods -o wide --all-namespaces
shows that the pod is deployed on the master node.Additional context
The command
sudo kubectl get nodes
shows both nodes.When trying to use the Raspberry Pi 3 as the master and the Raspberry Pi 4 as the node, then the pod is deployed on the worker node.
The text was updated successfully, but these errors were encountered: