Skip to content

Commit 204e496

Browse files
GokceGKjoaopalet
andauthored
Extend max_surge and max_unavailable descriptions (#533)
* extend max_surge and max_unavailable descriptions * Update stackit/internal/services/ske/cluster/resource.go Co-authored-by: João Palet <joao.palet@outlook.com> * update docs --------- Co-authored-by: Gökçe Gök Klingel <goekce.goek_klingel@stackit.cloud> Co-authored-by: João Palet <joao.palet@outlook.com>
1 parent 01bbce6 commit 204e496

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

docs/resources/ske_cluster.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ Optional:
8181

8282
- `cri` (String) Specifies the container runtime. Defaults to `containerd`
8383
- `labels` (Map of String) Labels to add to each node.
84-
- `max_surge` (Number) Maximum number of additional VMs that are created during an update.
85-
- `max_unavailable` (Number) Maximum number of VMs that that can be unavailable during an update.
84+
- `max_surge` (Number) Maximum number of additional VMs that are created during an update. If set (larger than 0), then it must be at least the amount of zones configured for the nodepool. The `max_surge` and `max_unavailable` fields cannot both be unset at the same time.
85+
- `max_unavailable` (Number) Maximum number of additional VMs that are created during an update. If set (larger than 0), then it must be at least the amount of zones configured for the nodepool. The `max_surge` and `max_unavailable` fields cannot both be unset at the same time.
8686
- `os_name` (String) The name of the OS image. Defaults to `flatcar`.
8787
- `os_version` (String, Deprecated) This field is deprecated, use `os_version_min` to configure the version and `os_version_used` to get the currently used version instead.
8888
- `os_version_min` (String) The minimum OS image version. This field will be used to set the minimum OS image version on creation/update of the cluster. If unset, the latest supported OS image version will be used. SKE automatically updates the cluster Kubernetes version if you have set `maintenance.enable_kubernetes_version_updates` to true or if there is a mandatory update, as described in [Updates for Kubernetes versions and Operating System versions in SKE](https://docs.stackit.cloud/stackit/en/version-updates-in-ske-10125631.html). To get the current OS image version being used for the node pool, use the read-only `os_version_used` field.

stackit/internal/services/ske/cluster/resource.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ func (r *clusterResource) Schema(_ context.Context, _ resource.SchemaRequest, re
301301
"main": "SKE Cluster Resource schema. Must have a `region` specified in the provider configuration.",
302302
"node_pools_plan_note": "When updating `node_pools` of a `stackit_ske_cluster`, the Terraform plan might appear incorrect as it matches the node pools by index rather than by name. " +
303303
"However, the SKE API correctly identifies node pools by name and applies the intended changes. Please review your changes carefully to ensure the correct configuration will be applied.",
304+
"max_surge": "Maximum number of additional VMs that are created during an update.",
305+
"max_unavailable": "Maximum number of VMs that that can be unavailable during an update.",
306+
"nodepool_validators": "If set (larger than 0), then it must be at least the amount of zones configured for the nodepool. The `max_surge` and `max_unavailable` fields cannot both be unset at the same time.",
304307
}
305308

306309
resp.Schema = schema.Schema{
@@ -397,15 +400,15 @@ func (r *clusterResource) Schema(_ context.Context, _ resource.SchemaRequest, re
397400
Required: true,
398401
},
399402
"max_surge": schema.Int64Attribute{
400-
Description: "Maximum number of additional VMs that are created during an update.",
403+
Description: fmt.Sprintf("%s %s", descriptions["max_surge"], descriptions["nodepool_validators"]),
401404
Optional: true,
402405
Computed: true,
403406
PlanModifiers: []planmodifier.Int64{
404407
int64planmodifier.UseStateForUnknown(),
405408
},
406409
},
407410
"max_unavailable": schema.Int64Attribute{
408-
Description: "Maximum number of VMs that that can be unavailable during an update.",
411+
Description: fmt.Sprintf("%s %s", descriptions["max_surge"], descriptions["nodepool_validators"]),
409412
Optional: true,
410413
Computed: true,
411414
PlanModifiers: []planmodifier.Int64{

0 commit comments

Comments
 (0)