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

Node Pool Labels does nothing #306

Open
regnaio opened this issue May 8, 2024 · 6 comments
Open

Node Pool Labels does nothing #306

regnaio opened this issue May 8, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@regnaio
Copy link

regnaio commented May 8, 2024

Vultr API - Create NodePools

labels (object): Map of key/value pairs defining labels to automatically apply to all nodes in this nodepool. Labels will be applied to both new and existing nodes.

I added multiple key/value pairs for labels using govultr, but these labels are not applied to the nodes according to kubectl get no --show-labels

I'm confused what is the point of specifying labels if they are not applied to nodes. Also, these labels don't appear in the Vultr Web UI

Basically, the labels field does nothing

@regnaio regnaio added the bug Something isn't working label May 8, 2024
@optik-aper optik-aper self-assigned this Jun 5, 2024
@optik-aper
Copy link
Member

This is likely an issue in the API but I'll review the logic in govultr to be sure.

@optik-aper
Copy link
Member

With this update code:

	newLabels := map[string]string{
		"label-test":   "test-label",
		"label-test-2": "test-label-2",
	}

	np, _, err := client.Kubernetes.UpdateNodePool(ctx, vkeID, nodePoolID, &govultr.NodePoolReqUpdate{
		Labels: newLabels,
	})

I get labels in kubernetes.

kubectl get nodes --show-labels
beta.kubernetes.io/arch=amd64,beta.kubernetes.io/instance-type=vc2-2c-4gb,beta.kubernetes.io/os=linux,failure-domain.beta.kubernetes.io/region=ewr,kubernetes.io/arch=amd64,kubernetes.io/hostname=test-ne-np-09a9d79e220d,kubernetes.io/os=linux,label-test-2=test-label-2,label-test=test-label,node.kubernetes.io/instance-type=vc2-2c-4gb,region=EWR,topology.kubernetes.io/region=ewr,vke.vultr.com/gpu=false,vke.vultr.com/node-id=ed2d1c57-28d0-4f9e-8831-44f15d4d8ceb,vke.vultr.com/node-pool-id=b3662053-11c2-475b-832b-e36d9aaaecf2,vke.vultr.com/node-pool=test-ne-np,vke.vultr.com/version=v1.29.2-1

...

Will you share what code you're using with govultr to apply the labels?

@regnaio
Copy link
Author

regnaio commented Jun 11, 2024

Thanks, @optik-aper. I only tried creating a Cluster with Node Pools Labels defined.

nps := []govultr.NodePoolReq{
	...
	Labels: map[string]string{
		"key": "val",
	},
}

c, _, err := v.client.Kubernetes.CreateCluster(context.Background(), &govultr.ClusterReq{
	Label:     "<NAME>",
	Region:    "<REGION>",
	Version:   "<VERSION>",
	NodePools: nps,
})

I haven't tried updating a Node Pool. I thought creating the Cluster with Node Pool Labels defined would be enough

@optik-aper
Copy link
Member

Ah, yes. It appears that the create node pool doesn't process labels. But that's not govultr's doing; the create params don't include them in the API.

We'll have to address that there. But you ought to be able to create and then update at this point.

@regnaio
Copy link
Author

regnaio commented Jun 12, 2024

Ah, thank you for the heads up, @optik-aper. It's great to know that this can be achieved with Update

@optik-aper
Copy link
Member

I'll keep this open until we decide how to fix the create labels but I think it will be added soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants