Skip to content

Commit 2e960e4

Browse files
author
Alexandru Toma
committed
add ips
1 parent f9ebc1b commit 2e960e4

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2376,7 +2376,8 @@ The following table describes the request arguments:
23762376
| auto_scaling | no | object | The minimum number of worker nodes that the managed node group can scale in. |
23772377
| lan_ids | no | List of ints | Array of additional LANs attached to worker nodes |
23782378
| labels | no | dict | Map of labels attached to node pool |
2379-
| annotations | dict | int | Map of annotations attached to node pool |
2379+
| annotations | no | dict | Map of annotations attached to node pool |
2380+
| public_ips | no | list | List of IP addresses to be used by nodes |
23802381

23812382
Method signature:
23822383

@@ -2484,6 +2485,7 @@ The following table describes the request arguments:
24842485
| maintenance_window | no | dict | The time to use for a maintenance window. Accepted formats are: HH:mm:ss; HH:mm:ss"Z"; HH:mm:ssZ. This time may varies by 15 minutes. |
24852486
| auto_scaling | no | dict | The minimum number of worker nodes that the managed node group can scale in. |
24862487
| lan_ids | no | List of ints | Array of additional LANs attached to worker nodes |
2488+
| public_ips | no | list | List of IP addresses to be used by nodes |
24872489

24882490
Method signature:
24892491

ionosenterprise/requests/k8s_nodepools.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def delete_k8s_cluster_nodepool(self, k8s_cluster_id, nodepool_id):
4343

4444
def update_k8s_cluster_nodepool(self,
4545
k8s_cluster_id, nodepool_id, node_count,
46-
maintenance_window=None, auto_scaling=None, lan_ids=None):
46+
maintenance_window=None, auto_scaling=None, lan_ids=None, public_ips=None):
4747
"""
4848
This will modify the Kubernetes Node Pool.
4949
@@ -86,6 +86,12 @@ def update_k8s_cluster_nodepool(self,
8686
:param lan_ids: array of additional LANs attached to worker nodes
8787
:type lan_ids: ``list of ints``
8888
89+
:param public_ips: Optional array of reserved public IP addresses to be used by the nodes.
90+
IPs must be from same location as the data center used for the node pool.
91+
The array must contain one extra IP than maximum number of nodes could be.
92+
(nodeCount+1 if fixed node amount or maxNodeCount+1 if auto scaling is used).
93+
The extra provided IP Will be used during rebuilding of nodes.
94+
:type public_ips: ``list``
8995
"""
9096

9197
# mandatory fields
@@ -100,6 +106,8 @@ def update_k8s_cluster_nodepool(self,
100106
properties['autoScaling'] = auto_scaling
101107
if lan_ids is not None:
102108
properties['lans'] = [{'id': int(lan_id)} for lan_id in lan_ids]
109+
if public_ips is not None:
110+
properties['publicIps'] = public_ips
103111

104112
data = {
105113
'properties': properties
@@ -139,7 +147,7 @@ def create_k8s_cluster_nodepool(self,
139147
availability_zone,
140148
storage_type, storage_size,
141149
k8s_version=None, maintenance_window=None, auto_scaling=None,
142-
lan_ids=None, labels=None, annotations=None):
150+
lan_ids=None, labels=None, annotations=None, public_ips=None):
143151
"""
144152
This will create a new Kubernetes Node Pool inside a Kubernetes Cluster.
145153
@@ -221,6 +229,12 @@ def create_k8s_cluster_nodepool(self,
221229
222230
:param annotations: map of annotations attached to node pool
223231
:type annotations: ``dict``
232+
:param public_ips: Optional array of reserved public IP addresses to be used by the nodes.
233+
IPs must be from same location as the data center used for the node pool.
234+
The array must contain one extra IP than maximum number of nodes could be.
235+
(nodeCount+1 if fixed node amount or maxNodeCount+1 if auto scaling is used).
236+
The extra provided IP Will be used during rebuilding of nodes.
237+
:type public_ips: ``list``
224238
"""
225239

226240
# mandatory fields
@@ -249,6 +263,8 @@ def create_k8s_cluster_nodepool(self,
249263
properties['labels'] = labels
250264
if annotations is not None:
251265
properties['annotations'] = annotations
266+
if public_ips is not None:
267+
properties['publicIps'] = public_ips
252268

253269
data = {
254270
'properties': properties

0 commit comments

Comments
 (0)