Skip to content
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

Feature Request: Automatically Add NodeLabels With Name of InstanceGroup #2999

Closed
FrederikNJS opened this issue Jul 19, 2017 · 2 comments
Closed
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@FrederikNJS
Copy link
Contributor

We are running our Kubernetes clusters with multiple different instance groups. It would be very nice if the nodes were automatically labeled with the name of the instance-group in the Kubernetes object. I have made my own workaround by adding sections like this to my InstanceGroups:

nodeLabels:
  instancegroup: nodes-fast-cpu

This works fine, but it would be nice to not have to remember to manually add that section on each InstanceGroup.

Having this added automatically would make it possible to use node-affinities and node-selectors without having to add labels manually, and it also allows you to see which instances belong to which instance groups using kubectl get nodes --label-columns instancegroup like this:

NAME                                           STATUS         AGE       VERSION   INSTANCEGROUP
ip-172-20-100-108.eu-west-1.compute.internal   Ready,node     1h        v1.6.6    nodes-spot
ip-172-20-112-156.eu-west-1.compute.internal   Ready,node     5h        v1.6.6    nodes-fast-cpu
ip-172-20-112-85.eu-west-1.compute.internal    Ready,node     2h        v1.6.6    nodes-spot
ip-172-20-114-133.eu-west-1.compute.internal   Ready,node     1h        v1.6.6    nodes-sre
ip-172-20-117-139.eu-west-1.compute.internal   Ready,node     2h        v1.6.6    nodes-fast-cpu
ip-172-20-117-245.eu-west-1.compute.internal   Ready,master   5h        v1.6.6    master-eu-west-1c
ip-172-20-120-234.eu-west-1.compute.internal   Ready,node     1h        v1.6.6    nodes-spot
ip-172-20-38-95.eu-west-1.compute.internal     Ready,node     5h        v1.6.6    nodes-fast-cpu
ip-172-20-39-132.eu-west-1.compute.internal    Ready,node     1h        v1.6.6    nodes-spot
ip-172-20-41-58.eu-west-1.compute.internal     Ready,node     5h        v1.6.6    nodes-fast-cpu
ip-172-20-45-64.eu-west-1.compute.internal     Ready,node     2h        v1.6.6    nodes-spot
ip-172-20-69-126.eu-west-1.compute.internal    Ready,node     5h        v1.6.6    nodes-fast-cpu
ip-172-20-78-205.eu-west-1.compute.internal    Ready,node     1h        v1.6.6    nodes-spot
ip-172-20-84-166.eu-west-1.compute.internal    Ready,node     1h        v1.6.6    nodes-spot
@chrislovecnm
Copy link
Contributor

I like this idea a lot!!

k8s-github-robot pushed a commit that referenced this issue Nov 10, 2017
Automatic merge from submit-queue.

Add a default NodeLabel with the InstanceGroup name

As requested in #2999, this change just auto-populates new InstanceGroup specs with a default node label containing the name of the instance group. It would be really useful for those of us managing environments with multiple instance groups.

It allows an admin to easily view the instance groups using kubectl:
```
kubectl get nodes --label-columns kops.k8s.io/instancegroup
NAME                                           STATUS         AGE       VERSION   INSTANCEGROUP
ip-172-20-108-120.eu-west-1.compute.internal   Ready,node     3m        v1.7.4    xtra-large
ip-172-20-117-133.eu-west-1.compute.internal   Ready,master   14m       v1.7.4    master-eu-west-1c
ip-172-20-32-139.eu-west-1.compute.internal    Ready,master   14m       v1.7.4    master-eu-west-1a
ip-172-20-32-92.eu-west-1.compute.internal     Ready,node     12m       v1.7.4    nodes
ip-172-20-67-184.eu-west-1.compute.internal    Ready,master   13m       v1.7.4    master-eu-west-1b
```
@fejta-bot
Copy link

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.

Prevent issues from auto-closing with an /lifecycle frozen comment.

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants