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

Kubernetes: add taints field to node pool create and update requests #368

Conversation

timoreimann
Copy link
Contributor

This change adds support for persistent node pool taints, a feature in DOKS to associate Kubernetes taints with current and future nodes of a pool.

Refs digitalocean/DOKS#3

@@ -103,6 +119,7 @@ type KubernetesNodePoolUpdateRequest struct {
Count *int `json:"count,omitempty"`
Tags []string `json:"tags,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Taints *[]Taint `json:"taints,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need a pointer here? Just curious because I've noticed that the other structs have Taints []Taint.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great question. The pointer is needed here so that we can differentiate between taints being omitted on the update (meaning "I do not want to change the taints at all in my update request") and setting the empty (not nil) slice (meaning "I want to clear all taints").

Taints on the other structs are not pointerized because in the respective cases, there is no need to:

  • for the create request in KubernetesNodePoolCreateRequest, not setting the taints is equal to leaving the taints empty, so no pointer is needed.
  • the KubernetesNodePool struct is returned from the API and is meant to indicate which taints are set. We want to be able to indicate if DOKS uses have zero or more taints set, so again no pointer is needed.

Hope this helps.

This change adds support for persistent node pool taints, a feature in
DOKS to associate Kubernetes taints with current and future nodes of a
pool.
@timoreimann timoreimann force-pushed the add-support-for-kubernetes-node-pool-taints branch from 82e120c to 1c8fe6b Compare September 21, 2020 14:55
Copy link
Contributor

@Verolop Verolop left a comment

Choose a reason for hiding this comment

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

LGTM
Approving this, to avoid blocking your doctl PR, but feel free to keep the conversation open if you need to :)

@Verolop Verolop merged commit 979e428 into digitalocean:main Sep 21, 2020
@timoreimann timoreimann deleted the add-support-for-kubernetes-node-pool-taints branch September 21, 2020 16:16
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.

None yet

3 participants