kubernetes-retired / cluster-api-bootstrap-provider-kubeadm

LEGACY REPO. NEW CODE IS https://github.com/kubernetes-sigs/cluster-api/tree/master/bootstrap/kubeadm
Apache License 2.0
62 stars 67 forks source link

can't add node-role label with JoinConfiguration #284

Closed de13 closed 4 years ago

de13 commented 4 years ago

/kind bug

/kind bug

What steps did you take and what happened:

---
apiVersion: kubeadm.k8s.io/v1beta2
kind: JoinConfiguration
discovery:
  bootstrapToken:
    apiServerEndpoint: ""
    token: ""
    unsafeSkipCAVerification: true
nodeRegistration:
  kubeletExtraArgs:
    cloud-provider: "gce"
    node-labels: node-role.kubernetes.io/worker=

Kubelet in unhealthy state when using this JoinConfiguration. I have the following error:

Nov  2 06:56:02 dday-instance-2 kubelet[6823]: F1102 06:56:02.583158    6823 server.go:185] unknown 'kubernetes.io' or 'k8s.io' labels specified with --node-labels: [node-role.kubernetes.io/worker]
Nov  2 06:56:02 dday-instance-2 kubelet[6823]: --node-labels in the 'kubernetes.io' namespace must begin with an allowed prefix (kubelet.kubernetes.io, node.kubernetes.io) or be in the specifically allowed set (beta.kubernetes.io/arch, beta.kubernetes.io/instance-type, beta.kubernetes.io/os, failure-domain.beta.kubernetes.io/region, failure-domain.beta.kubernetes.io/zone, failure-domain.kubernetes.io/region, failure-domain.kubernetes.io/zone, kubernetes.io/arch, kubernetes.io/hostname, kubernetes.io/instance-type, kubernetes.io/os)

However, manually putting this label on the node works.

What did you expect to happen:

Node labeled with node-role.kubernetes.io/worker=

Anything else you would like to add:

Othe kind of labels works fine foo=bar node.kubernetes.io/worker= but node-role doesn't work.

Environment:

Environment:

SataQiu commented 4 years ago

Please take a look at this: https://github.com/kubernetes/enhancements/blob/master/keps/sig-auth/0000-20170814-bounding-self-labeling-kubelets.md#proposal

SataQiu commented 4 years ago

You can use role.node.kubernetes.io/worker=

SataQiu commented 4 years ago

/assign

de13 commented 4 years ago

I've read the enhancements page, and also tried role.node.kubernetes.io/worker="" but this last one has no effect on node role:

$ kubectl label node kube-2 role.node.kubernetes.io/worker=""
node/kube-2 labeled
$ kubectl get node kube-2
NAME     STATUS   ROLES    AGE     VERSION
kube-2   Ready    <none>   7m16s   v1.16.2
$ kubectl label node kube-2 node-role.kubernetes.io/worker=""
node/kube-2 labeled
$ kubectl get node kube-2
NAME     STATUS   ROLES    AGE     VERSION
kube-2   Ready    worker   7m59s   v1.16.2

So it should be nice to have node-role in the list of proposals.

chuckha commented 4 years ago

This repo is deprecated. Please reopen the issue here: https://github.com/kubernetes-sigs/cluster-api if you feel this is in scope for cluster-api.

/close

k8s-ci-robot commented 4 years ago

@chuckha: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/cluster-api-bootstrap-provider-kubeadm/issues/284#issuecomment-549394635): >This repo is deprecated. Please reopen the issue here: https://github.com/kubernetes-sigs/cluster-api if you feel this is in scope for cluster-api. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.