kubeadm
kubeadm copied to clipboard
Move Control Planes taint to kubelet config instead of markcontrolplane phase
Is this a BUG REPORT or FEATURE REQUEST?
Choose one: BUG REPORT
What happened?
Due we apply the control plane taint after the control plane comes up, on a multi-control plane case we can have pod scheduled to this control plane.
What you expected to happen?
Use the kubelet --register-with-taints config instead of handler it on a separate phase.
How to reproduce it (as minimally and precisely as possible)?
- Kubeadm init
- Create a daemonset
- Join another control plane
Anything else we need to know?
For now, I just use this config but would be nice if kubeadm can handler it.
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
nodeRegistration:
# Remove the default control-plane taint so we taint it manually with KUBELET_EXTRA_ARGS
taints: []
```
i guess this can be a real problem. thanks for the report @yagonobre
does the kubelet allow self-taints with node roles such as node-role.kubernetes.io/master=:NoSchedule
?
(it certainly does not for labels https://github.com/kubernetes/kubernetes/issues/45361)
does the kubelet allow self-taints with node roles such as node-role.kubernetes.io/master=:NoSchedule?
Yes, probably we can keep the phase to add the label
@neolit123 : Can I take a crack at this?
@madhukar32 hi, this needs discussion before sending the PR. if we remove the taint from markcontrolplane phase it will break existing users.
I was away, but now I'll have enough time to do this. @neolit123 what you think about add the taint to the kubelet config, and keep it on the markcontrolplane phase just for backward compatibility?
we might have to keep it in both places with a deprecation notice.
We are seeing this when joining control plane nodes to existing clusters (1.15). We use nginx-ingress-controller as a daemonset, and it's on host port 443, same as the apiserver. So the apiserver always ends up in a CrashLoop until I manually delete the pod.
this is a known problem. changes in kubeadm phases are tricky - the existing workaround can be seen above, but we might have to have a period of time where we both taint using the kubelet configuration and the kubeadm mark-control-plane phase, potentially deprecating the tainting in the phase in the future.
Not sure I understand how the workaround works. Isn't InitConfiguration used only during init of the first master? Or can it be updated in the configmap in kube-system and used during join --control-plane?
both init and join configurations have the node registration options: https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta2#NodeRegistrationOptions
tainting using the KubeletConfigurtation is not possible.
I've tried to use a JoinConfiguration to setup additional masters, but then I just get this message:
# kubeadm join --control-plane --config /etc/kubernetes/kubeadm-master-config.yaml
can not mix '--config' with arguments [control-plane]
Related issue I found: #1485
Today I add the taint directly to the kubelet config file. I'll try to work on it soon.
Yago, i dont see a field for that in the kubeletconfiguration.
I've tried to use a JoinConfiguration to setup additional masters, but then I just get this message:
The join configuration can do that. Some flags and config cannot be mixed.
Yago, i dont see a field for that in the kubeletconfiguration.
Sorry, it's a flag.
I use KUBELET_EXTRA_ARGS="--register-with-taints=node-role.kubernetes.io/master=:NoSchedule"
@yagonobre i just tied passing --register-with-taints=node-role.kubernetes.io/master:NoSchedule
to the kubelet instead of using the markcontorlplane phase for the taint and both the CNI (calico) and coredns are stuck in Pending saying that there is no Node to schedule on (even if they tolerate the master taint).
what k8s version have you tried this with? i'm testing with the latest 1.18.
I'm using v1.16.2
, but I'll try with the last version.
On Thu, Dec 5, 2019 at 7:59 PM Lubomir I. Ivanov [email protected] wrote:
@yagonobre https://github.com/yagonobre i just tied passing --register-with-taints=node-role.kubernetes.io/maste r:NoSchedule to the kubelet instead of using the markcontorlplane phase for the taint and both the CNI and coredns are stuck in Pending saying that there is no Node to schedule on (even if they tolerate the master taint).
what k8s version have you tried this with? i'm testing with the latest 1.18.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kubernetes/kubeadm/issues/1621?email_source=notifications&email_token=ACJ5C2YRJKOV45LD5QDMOBTQXGBVDA5CNFSM4HZKKCA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGCOCCQ#issuecomment-562356490, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACJ5C24GER64KYQH5XHTMRDQXGBVDANCNFSM4HZKKCAQ .
@yagonobre never mind. i made the mistake of deploying a kubelet much newer than the kube-apiserver -> 1.18 vs 1.16.3.
will send a POC PR that fixes this in a bit. although it needs discussion.
here is the POC https://github.com/kubernetes/kubernetes/pull/85977
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale
/remove-lifecycle stale
minor update here, we could move the taint registration to the kubelet, but one major problemis that kubeletconfiguration v1beta1 does not support taints via config: https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/
there is only the CLI flag --register-with-taints and we might want to stop using all kubelet flags, because they are being removed? https://github.com/kubernetes/kubernetes/issues/86843
I think this ticket is the motivation for --register-with-taints
to be moved to kubelet configuration, rather than dropped. The problem isn't well-solvable without being able to include some taint as part of the initial node registration, either the final intended taint (control-plane, in this case), or some intermediate taint that says "Don't schedule to me under any circumstances, I have taints and perhaps labels still-to-come". The latter approach would needlessly complicate bootstrapping, I think.
The "security discussions" apply somewhat to --node-labels
, but restricting kubelet self-labelling is supposed to address that, and off the top of my head, a taint can't be added to attract workloads, only to repel them, so that isn't applicable to --register-with-taints
.