diff --git a/scaleway-async/scaleway_async/k8s/v1/api.py b/scaleway-async/scaleway_async/k8s/v1/api.py index cb30c0ba1..475566e40 100644 --- a/scaleway-async/scaleway_async/k8s/v1/api.py +++ b/scaleway-async/scaleway_async/k8s/v1/api.py @@ -1068,6 +1068,7 @@ async def create_pool( startup_taints: Optional[list[CoreV1Taint]] = None, private_network_id: Optional[str] = None, user_data: Optional[dict[str, str]] = None, + max_termination_grace_period: Optional[str] = None, ) -> Pool: """ Create a new Pool in a Cluster. @@ -1099,6 +1100,7 @@ async def create_pool( :param startup_taints: Kubernetes taints applied at node creation but not reconciled afterwards. :param private_network_id: Private network where the nodes are attached. Should be member of the same VPC as the API Server. :param user_data: User data applied and reconciled with the pool. + :param max_termination_grace_period: Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour. :return: :class:`Pool ` Usage: @@ -1148,6 +1150,7 @@ async def create_pool( startup_taints=startup_taints, private_network_id=private_network_id, user_data=user_data, + max_termination_grace_period=max_termination_grace_period, ), self.client, ), @@ -1287,6 +1290,7 @@ async def update_pool( kubelet_args: Optional[dict[str, str]] = None, upgrade_policy: Optional[UpdatePoolRequestUpgradePolicy] = None, security_group_id: Optional[str] = None, + max_termination_grace_period: Optional[str] = None, ) -> Pool: """ Update a Pool in a Cluster. @@ -1302,6 +1306,7 @@ async def update_pool( :param kubelet_args: New Kubelet arguments to be used by this pool. Note that this feature is experimental. :param upgrade_policy: New upgrade policy for the pool. :param security_group_id: Security group ID in which all the nodes of the pool will be moved. + :param max_termination_grace_period: New maximum amount of time before the API forces the drain and deletion of a `deleting` node. :return: :class:`Pool ` Usage: @@ -1333,6 +1338,7 @@ async def update_pool( kubelet_args=kubelet_args, upgrade_policy=upgrade_policy, security_group_id=security_group_id, + max_termination_grace_period=max_termination_grace_period, ), self.client, ), diff --git a/scaleway-async/scaleway_async/k8s/v1/marshalling.py b/scaleway-async/scaleway_async/k8s/v1/marshalling.py index 5587b459e..5ce18038e 100644 --- a/scaleway-async/scaleway_async/k8s/v1/marshalling.py +++ b/scaleway-async/scaleway_async/k8s/v1/marshalling.py @@ -882,6 +882,12 @@ def unmarshal_Pool(data: Any) -> Pool: else: args["error_message"] = None + field = data.get("max_termination_grace_period", None) + if field is not None: + args["max_termination_grace_period"] = field + else: + args["max_termination_grace_period"] = None + return Pool(**args) @@ -1675,6 +1681,9 @@ def marshal_CreateClusterRequestPoolConfig( if request.private_network_id is not None: output["private_network_id"] = request.private_network_id + if request.max_termination_grace_period is not None: + output["max_termination_grace_period"] = request.max_termination_grace_period + return output @@ -1864,6 +1873,9 @@ def marshal_CreatePoolRequest( if request.user_data is not None: output["user_data"] = {key: value for key, value in request.user_data.items()} + if request.max_termination_grace_period is not None: + output["max_termination_grace_period"] = request.max_termination_grace_period + return output @@ -2123,6 +2135,9 @@ def marshal_UpdatePoolRequest( if request.security_group_id is not None: output["security_group_id"] = request.security_group_id + if request.max_termination_grace_period is not None: + output["max_termination_grace_period"] = request.max_termination_grace_period + return output diff --git a/scaleway-async/scaleway_async/k8s/v1/types.py b/scaleway-async/scaleway_async/k8s/v1/types.py index 6bb6affd0..87a7994e3 100644 --- a/scaleway-async/scaleway_async/k8s/v1/types.py +++ b/scaleway-async/scaleway_async/k8s/v1/types.py @@ -640,6 +640,11 @@ class CreateClusterRequestPoolConfig: Private network where the nodes are attached. Should be member of the same VPC as the API Server. """ + max_termination_grace_period: Optional[str] = None + """ + Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour. + """ + @dataclass class CreatePoolRequestUpgradePolicy: @@ -1141,6 +1146,11 @@ class Pool: Details of the error, if any occurred when managing the pool. """ + max_termination_grace_period: Optional[str] = None + """ + Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour. + """ + @dataclass class NodeMetadataCoreV1Taint: @@ -1537,6 +1547,11 @@ class CreatePoolRequest: User data applied and reconciled with the pool. """ + max_termination_grace_period: Optional[str] = None + """ + Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour. + """ + @dataclass class DeleteACLRuleRequest: @@ -2280,6 +2295,11 @@ class UpdatePoolRequest: Security group ID in which all the nodes of the pool will be moved. """ + max_termination_grace_period: Optional[str] = None + """ + New maximum amount of time before the API forces the drain and deletion of a `deleting` node. + """ + @dataclass class UpgradeClusterRequest: diff --git a/scaleway/scaleway/k8s/v1/api.py b/scaleway/scaleway/k8s/v1/api.py index a87f77f6c..b10baa9cf 100644 --- a/scaleway/scaleway/k8s/v1/api.py +++ b/scaleway/scaleway/k8s/v1/api.py @@ -1068,6 +1068,7 @@ def create_pool( startup_taints: Optional[list[CoreV1Taint]] = None, private_network_id: Optional[str] = None, user_data: Optional[dict[str, str]] = None, + max_termination_grace_period: Optional[str] = None, ) -> Pool: """ Create a new Pool in a Cluster. @@ -1099,6 +1100,7 @@ def create_pool( :param startup_taints: Kubernetes taints applied at node creation but not reconciled afterwards. :param private_network_id: Private network where the nodes are attached. Should be member of the same VPC as the API Server. :param user_data: User data applied and reconciled with the pool. + :param max_termination_grace_period: Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour. :return: :class:`Pool ` Usage: @@ -1148,6 +1150,7 @@ def create_pool( startup_taints=startup_taints, private_network_id=private_network_id, user_data=user_data, + max_termination_grace_period=max_termination_grace_period, ), self.client, ), @@ -1287,6 +1290,7 @@ def update_pool( kubelet_args: Optional[dict[str, str]] = None, upgrade_policy: Optional[UpdatePoolRequestUpgradePolicy] = None, security_group_id: Optional[str] = None, + max_termination_grace_period: Optional[str] = None, ) -> Pool: """ Update a Pool in a Cluster. @@ -1302,6 +1306,7 @@ def update_pool( :param kubelet_args: New Kubelet arguments to be used by this pool. Note that this feature is experimental. :param upgrade_policy: New upgrade policy for the pool. :param security_group_id: Security group ID in which all the nodes of the pool will be moved. + :param max_termination_grace_period: New maximum amount of time before the API forces the drain and deletion of a `deleting` node. :return: :class:`Pool ` Usage: @@ -1333,6 +1338,7 @@ def update_pool( kubelet_args=kubelet_args, upgrade_policy=upgrade_policy, security_group_id=security_group_id, + max_termination_grace_period=max_termination_grace_period, ), self.client, ), diff --git a/scaleway/scaleway/k8s/v1/marshalling.py b/scaleway/scaleway/k8s/v1/marshalling.py index 5587b459e..5ce18038e 100644 --- a/scaleway/scaleway/k8s/v1/marshalling.py +++ b/scaleway/scaleway/k8s/v1/marshalling.py @@ -882,6 +882,12 @@ def unmarshal_Pool(data: Any) -> Pool: else: args["error_message"] = None + field = data.get("max_termination_grace_period", None) + if field is not None: + args["max_termination_grace_period"] = field + else: + args["max_termination_grace_period"] = None + return Pool(**args) @@ -1675,6 +1681,9 @@ def marshal_CreateClusterRequestPoolConfig( if request.private_network_id is not None: output["private_network_id"] = request.private_network_id + if request.max_termination_grace_period is not None: + output["max_termination_grace_period"] = request.max_termination_grace_period + return output @@ -1864,6 +1873,9 @@ def marshal_CreatePoolRequest( if request.user_data is not None: output["user_data"] = {key: value for key, value in request.user_data.items()} + if request.max_termination_grace_period is not None: + output["max_termination_grace_period"] = request.max_termination_grace_period + return output @@ -2123,6 +2135,9 @@ def marshal_UpdatePoolRequest( if request.security_group_id is not None: output["security_group_id"] = request.security_group_id + if request.max_termination_grace_period is not None: + output["max_termination_grace_period"] = request.max_termination_grace_period + return output diff --git a/scaleway/scaleway/k8s/v1/types.py b/scaleway/scaleway/k8s/v1/types.py index 6bb6affd0..87a7994e3 100644 --- a/scaleway/scaleway/k8s/v1/types.py +++ b/scaleway/scaleway/k8s/v1/types.py @@ -640,6 +640,11 @@ class CreateClusterRequestPoolConfig: Private network where the nodes are attached. Should be member of the same VPC as the API Server. """ + max_termination_grace_period: Optional[str] = None + """ + Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour. + """ + @dataclass class CreatePoolRequestUpgradePolicy: @@ -1141,6 +1146,11 @@ class Pool: Details of the error, if any occurred when managing the pool. """ + max_termination_grace_period: Optional[str] = None + """ + Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour. + """ + @dataclass class NodeMetadataCoreV1Taint: @@ -1537,6 +1547,11 @@ class CreatePoolRequest: User data applied and reconciled with the pool. """ + max_termination_grace_period: Optional[str] = None + """ + Maximum amount of time before the API forces the drain and deletion of a `deleting` node. It overrides pods `PodDisruptionBudget` and `terminationGracePeriodSeconds`. Defaults to 15 minutes, up to 1 hour. + """ + @dataclass class DeleteACLRuleRequest: @@ -2280,6 +2295,11 @@ class UpdatePoolRequest: Security group ID in which all the nodes of the pool will be moved. """ + max_termination_grace_period: Optional[str] = None + """ + New maximum amount of time before the API forces the drain and deletion of a `deleting` node. + """ + @dataclass class UpgradeClusterRequest: