Change:
/kind bug What happened: doesn't show role Workaround: What you expected to happen: According to and How to reproduce it (as minimally and precisely as possible): I just deployed a multi master kubernetes environment with kops: Environment: Kubernetes version (use ):Cloud provider or hardware configuration: AWS Install tools: kops, terraform
There are no sig labels on this issue. Please by: a sig: e.g., to notify the contributor experience sig, OR the label manually: e.g., to apply the label Note: Method 1 will trigger an email to the group. You can find the group list and label list . The in the method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals
/sig cli
I don't think this is a bug. The node role label is not used by kubeadm anymore. Related codes have been changed in by
Hi Thanks for the quick reply I'm actually using the as you can see in the workaround above. I'm not using kubeadm role label.
Your favorite topic came up again. Hi I do think this is a bug. As said, kubectl shouldn't show anything based on the old kubeadm master label, but it should probably on the label, but absolutely on the label. cc as you have opinions on this as well cc

Discussion:
"printers.go", ], deps = [ <del> "//cmd/kubeadm/app/apis/kubeadm:go_default_library", </del> "//federation/apis/federation:go_default_library", "//federation/apis/federation/v1beta1:go_default_library", "//federation/client/clientset_generated/federation_clientset:go_default_library",

"k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/util/sets" <del> "k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm" </del> "k8s.io/kubernetes/federation/apis/federation" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/events"

"k8s.io/kubernetes/pkg/util/node" ) <del> const loadBalancerWidth = 16 </del> <ins> const ( loadBalancerWidth = 16 // LabelNodeRoleMaster specifies that a node is a master // It's copied over to here until it's merged in core: https://github.com/kubernetes/kubernetes/pull/39112 LabelNodeRoleMaster = "node-role.kubernetes.io/master" // NodeLabelRole specifies the role of a node NodeLabelRole = "kubernetes.io/role" // NodeLabelKubeadmAlphaRole is a label that kubeadm applies to a Node as a hint that it has a particular purpose. // Use of NodeLabelRole is preferred. NodeLabelKubeadmAlphaRole = "kubeadm.alpha.kubernetes.io/role" ) </ins> // AddHandlers adds print handlers for default Kubernetes types dealing with internal versions. // TODO: handle errors from Handler

// findNodeRole returns the role of a given node, or "" if none found. // The role is determined by looking in order for: <ins> // * a node-role.kubernetes.io/master label </ins> // * a kubernetes.io/role label // * a kubeadm.alpha.kubernetes.io/role label <del> // If no role is found, ("", nil) is returned </del> func findNodeRole(node *api.Node) string { <del> if role := node.Labels[kubeadm.NodeLabelKubeadmAlphaRole]; role != "" { return role </del> <ins> if _, ok := node.Labels[LabelNodeRoleMaster]; ok { return "Master" } if role := node.Labels[NodeLabelRole]; role != "" { return strings.Title(role) } if role := node.Labels[NodeLabelKubeadmAlphaRole]; role != "" { return strings.Title(role) </ins> } <del> // No role found </del> return "" }

{ node: api.Node{ ObjectMeta: metav1.ObjectMeta{ <ins> Name:   "foo10", Labels: map[string]string{"node-role.kubernetes.io/master": "", "kubernetes.io/role": "node", "kubeadm.alpha.kubernetes.io/role": "node"}, }, }, status: "Unknown,Master", }, { node: api.Node{ ObjectMeta: metav1.ObjectMeta{ Name:   "foo11", Labels: map[string]string{"kubernetes.io/role": "node", "kubeadm.alpha.kubernetes.io/role": "node"}, }, }, status: "Unknown,Node", }, { node: api.Node{ ObjectMeta: metav1.ObjectMeta{ </ins> Name:   "foo12", Labels: map[string]string{"kubeadm.alpha.kubernetes.io/role": "node"}, }, Status: api.NodeStatus{Conditions: []api.NodeCondition{{Type: api.NodeReady, Status: api.ConditionTrue}}}, }, <del> status: "Ready,node", </del> <ins> status: "Ready,Node", </ins> }, }