Description
Is this a request for help?
This is a "wat?" that might indicate an area for improvement.
Is this a BUG REPORT or FEATURE REQUEST?
I guess BUG REPORT?
Versions
kubeadm version (use kubeadm version
): 1.19.2 release binary
Environment:
- Kubernetes version (use
kubectl version
): 1.18.6 - Cloud provider or hardware configuration: on-prem / self-hosted(*)
- OS (e.g. from /etc/os-release): Flatcar (aka CoreOS container linux)
- Kernel (e.g.
uname -a
): 5.4.62-flatcar - Others:
(*) The server-side is a self-hosted cluster that has deviated from a "normal" kubeadm cluster. Hence why I even noticed this issue.
What happened?
I use kubeadm only for node join operations (TLS bootstrap; ie kubeadm token create
&& join
). I tried to join a new node last week, after not having done so for some time (years?).
What you expected to happen?
I expected kubeadm join --discovery-token-ca-cert-hash=... --token=... --ignore-preflight-errors=all
on the new node to create the node bootstrap kubeconfig and CSR. Instead it reported an RBAC error about not being able to read kube-system.kube-proxy ConfigMap (I presume for a preflight check?), and I could not find a way to disable this. By experiment, it seems this requirement crept in with kubeadm 1.13 (I tried every minor release, and kubeadm 1.12 worked).
I can of course add the RBAC role/rolebinding to allow the node bootstrapper group to read this ConfigMap. That seems weird though, which is the point of this bug report.
Why does the node bootstrapper need access to kube-proxy ConfigMap? If it's just for a preflight check of some sort, why can't I skip it? (.. and is increasing the node bootstrapper attack surface really the right tradeoff, just to enable a preflight check?)
How to reproduce it (as minimally and precisely as possible)?
Remove system:bootstrappers:kubeadm:default-node-token
group from kube-system.kube-proxy
role binding. Try to complete a successful kubeadm join
with any amount of flags.
For reference, this bootstrappers role binding is normally added in the proxy addon phase: https://github.com/kubernetes/kubernetes/blob/f2e3154a140dc192760a5cf8c01f8044e1aa867b/cmd/kubeadm/app/phases/addons/proxy/proxy.go#L176-L211
Anything else we need to know?
My kube master config (flags, etc) is visible https://github.com/anguslees/k8s-home/blob/master/kube-system.jsonnet - if it's at all useful. Kubelet flags are https://github.com/anguslees/k8s-home/blob/master/coreos-pxe-install.jsonnet#L169-L227