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

chore: add custom node taints #7987

Merged
merged 1 commit into from
Nov 25, 2023
Merged

chore: add custom node taints #7987

merged 1 commit into from
Nov 25, 2023

Conversation

DmitriyMV
Copy link
Member

This PR adds support for custom node taints. Refer to nodeTaints in the configuration for more information.

Closes #7581

@DmitriyMV
Copy link
Member Author

DmitriyMV commented Nov 24, 2023

There is also

func (suite *NodeLabelsSuite) testUpdate(node string, isControlplane bool) {
k8sNode, err := suite.GetK8sNodeByInternalIP(suite.ctx, node)
suite.Require().NoError(err)
suite.T().Logf("updating labels on node %q (%q)", node, k8sNode.Name)
watcher, err := suite.Clientset.CoreV1().Nodes().Watch(suite.ctx, metav1.ListOptions{
FieldSelector: "metadata.name=" + k8sNode.Name,
Watch: true,
})
suite.Require().NoError(err)
defer watcher.Stop()
const stdLabelName = "kubernetes.io/hostname"
stdLabelValue := k8sNode.Labels[stdLabelName]
// set two new labels
suite.setNodeLabels(node, map[string]string{
"talos.dev/test1": "value1",
"talos.dev/test2": "value2",
})
suite.waitUntil(watcher, map[string]string{
"talos.dev/test1": "value1",
"talos.dev/test2": "value2",
}, isControlplane)
// remove one label owned by Talos
suite.setNodeLabels(node, map[string]string{
"talos.dev/test1": "foo",
})
suite.waitUntil(watcher, map[string]string{
"talos.dev/test1": "foo",
"talos.dev/test2": "",
}, isControlplane)
// on control plane node, try to override a label not owned by Talos
if isControlplane {
suite.setNodeLabels(node, map[string]string{
"talos.dev/test1": "foo2",
stdLabelName: "bar",
})
suite.waitUntil(watcher, map[string]string{
"talos.dev/test1": "foo2",
stdLabelName: stdLabelValue,
}, isControlplane)
}
// remove all Talos Labels
suite.setNodeLabels(node, nil)
suite.waitUntil(watcher, map[string]string{
"talos.dev/test1": "",
"talos.dev/test2": "",
}, isControlplane)
}
integration test. Should I update it to handle the taints too?

@smira
Copy link
Member

smira commented Nov 24, 2023

integration test. Should I update it to handle the taints too?

yes, absolutely, probably another test which will be very similar

Copy link
Member

@smira smira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just need the integration test!

internal/integration/api/node-taints.go Outdated Show resolved Hide resolved
@DmitriyMV DmitriyMV force-pushed the taints branch 10 times, most recently from 11ea8f7 to baeea95 Compare November 25, 2023 06:56
This PR adds support for custom node taints. Refer to `nodeTaints` in the `configuration` for more information.

Closes siderolabs#7581

Signed-off-by: Dmitriy Matrenichev <[email protected]>
@DmitriyMV
Copy link
Member Author

/m

@talos-bot talos-bot merged commit dd45dd0 into siderolabs:main Nov 25, 2023
18 checks passed
@DmitriyMV DmitriyMV deleted the taints branch November 25, 2023 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Specifying Custom Node Taints via Machine Configuration
4 participants