Skip to content
This repository was archived by the owner on Sep 6, 2025. It is now read-only.

Commit acfaafc

Browse files
authored
Kubernetes node_pools now contain a user-defined labels object (#80)
New optional properties for node_pools: auto_scale, min_nodes, max_nodes Fix: according to documentation the request models for node_pools do not contain a tags property, only the responses do
1 parent e647b49 commit acfaafc

5 files changed

Lines changed: 80 additions & 9 deletions

File tree

DigitalOcean.API/Models/Requests/KubernetesCluster.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ public class KubernetesCluster {
2828
public bool? AutoUpgrade { get; set; }
2929

3030
/// <summary>
31-
/// A flat array of tag names as strings to be applied to the Kubernetes cluster. All clusters will be automatically tagged "k8s" and "k8s:$K8S_CLUSTER_ID" in addition to any tags provided by the user.
31+
/// A flat array of tag names as strings to be applied to the Kubernetes cluster.
32+
/// All clusters will be automatically tagged "k8s" and "k8s:$K8S_CLUSTER_ID" in addition to any tags provided by the user.
3233
/// </summary>
3334
[JsonProperty("tags")]
3435
public List<string> Tags { get; set; }

DigitalOcean.API/Models/Requests/KubernetesNodePool.cs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,31 @@ public class KubernetesNodePool {
2222
public int Count { get; set; }
2323

2424
/// <summary>
25-
/// A flat array of tag names as strings to be applied to the node pool. All node pools will be automatically tagged "k8s," "k8s-worker," and "k8s:$K8S_CLUSTER_ID" in addition to any tags provided by the user.
25+
/// An object containing a set of Kubernetes labels.
26+
/// The keys are user-defined.
2627
/// </summary>
27-
[JsonProperty("tags")]
28-
public List<string> Tags { get; set; }
28+
[JsonProperty("labels")]
29+
public Dictionary<string, string> Labels { get; set; }
30+
31+
/// <summary>
32+
/// A boolean value indicating whether auto-scaling is enabled for this node pool.
33+
/// This requires DOKS versions at least 1.13.10-do.3, 1.14.6-do.3, or 1.15.3-do.3.
34+
/// </summary>
35+
[JsonProperty("auto_scale")]
36+
public bool? AutoScale { get; set; }
37+
38+
/// <summary>
39+
/// The minimum number of nodes that this node pool can be auto-scaled to.
40+
/// This will fail validation if the additional nodes will exceed your account droplet limit.
41+
/// </summary>
42+
[JsonProperty("min_nodes")]
43+
public string MinNodes { get; set; }
44+
45+
/// <summary>
46+
/// The maximum number of nodes that this node pool can be auto-scaled to.
47+
/// This can be 0, but your cluster must contain at least 1 node across all node pools.
48+
/// </summary>
49+
[JsonProperty("max_nodes")]
50+
public string MaxNodes { get; set; }
2951
}
3052
}

DigitalOcean.API/Models/Requests/UpdateKubernetesNodePool.cs

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,31 @@ public class UpdateKubernetesNodePool {
1616
public int Count { get; set; }
1717

1818
/// <summary>
19-
/// A flat array of tag names as strings to be applied to the node pool. All node pools will be automatically tagged "k8s," "k8s-worker," and "k8s:$K8S_CLUSTER_ID" in addition to any tags provided by the user.
19+
/// An object containing a set of Kubernetes labels.
20+
/// The keys are user-defined.
2021
/// </summary>
21-
[JsonProperty("tags")]
22-
public List<string> Tags { get; set; }
22+
[JsonProperty("labels")]
23+
public Dictionary<string, string> Labels { get; set; }
24+
25+
/// <summary>
26+
/// A boolean value indicating whether auto-scaling is enabled for this node pool.
27+
/// This requires DOKS versions at least 1.13.10-do.3, 1.14.6-do.3, or 1.15.3-do.3.
28+
/// </summary>
29+
[JsonProperty("auto_scale")]
30+
public bool? AutoScale { get; set; }
31+
32+
/// <summary>
33+
/// The minimum number of nodes that this node pool can be auto-scaled to.
34+
/// This will fail validation if the additional nodes will exceed your account droplet limit.
35+
/// </summary>
36+
[JsonProperty("min_nodes")]
37+
public string MinNodes { get; set; }
38+
39+
/// <summary>
40+
/// The maximum number of nodes that this node pool can be auto-scaled to.
41+
/// This can be 0, but your cluster must contain at least 1 node across all node pools.
42+
/// </summary>
43+
[JsonProperty("max_nodes")]
44+
public string MaxNodes { get; set; }
2345
}
2446
}

DigitalOcean.API/Models/Responses/KubernetesCluster.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public class KubernetesCluster {
4949
public string ServiceSubset { get; set; }
5050

5151
/// <summary>
52-
/// An array of tags applied to the Kubernetes cluster. All clusters are automatically tagged "k8s" and "k8s:$K8S_CLUSTER_ID."
52+
/// A flat array of tag names as strings to be applied to the Kubernetes cluster.
53+
/// All clusters will be automatically tagged "k8s" and "k8s:$K8S_CLUSTER_ID" in addition to any tags provided by the user.
5354
/// </summary>
5455
public List<string> Tags { get; set; }
5556

DigitalOcean.API/Models/Responses/KubernetesNodePool.cs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,38 @@ public class KubernetesNodePool {
2323
public string Count { get; set; }
2424

2525
/// <summary>
26-
/// An array containing the tags applied to the node pool. All node pools are automatically tagged "k8s," "k8s-worker," and "k8s:$K8S_CLUSTER_ID."
26+
/// An array containing the tags applied to the node pool.
27+
/// All node pools are automatically tagged "k8s," "k8s-worker," and "k8s:$K8S_CLUSTER_ID."
2728
/// </summary>
2829
public List<string> Tags { get; set; }
2930

31+
/// <summary>
32+
/// An object containing a set of Kubernetes labels.
33+
/// The keys are user-defined.
34+
/// </summary>
35+
public Dictionary<string, string> Labels { get; set; }
36+
3037
/// <summary>
3138
/// An object specifying the details of a specific worker node in a node pool
3239
/// </summary>
3340
public List<KubernetesNode> Nodes { get; set; }
41+
42+
/// <summary>
43+
/// A boolean value indicating whether auto-scaling is enabled for this node pool.
44+
/// This requires DOKS versions at least 1.13.10-do.3, 1.14.6-do.3, or 1.15.3-do.3.
45+
/// </summary>
46+
public bool? AutoScale { get; set; }
47+
48+
/// <summary>
49+
/// The minimum number of nodes that this node pool can be auto-scaled to.
50+
/// This will fail validation if the additional nodes will exceed your account droplet limit.
51+
/// </summary>
52+
public string MinNodes { get; set; }
53+
54+
/// <summary>
55+
/// The maximum number of nodes that this node pool can be auto-scaled to.
56+
/// This can be 0, but your cluster must contain at least 1 node across all node pools.
57+
/// </summary>
58+
public string MaxNodes { get; set; }
3459
}
3560
}

0 commit comments

Comments
 (0)