Skip to content

Commit e38c5ae

Browse files
authored
Ft/region adjustment ske (#909)
* feat(ske): Region adjustment Signed-off-by: Alexander Dahmen <[email protected]> * Renaming argus to observability Signed-off-by: Alexander Dahmen <[email protected]> * Remove deprecated field allow_privileged_containers Signed-off-by: Alexander Dahmen <[email protected]> * Add and adjust unit tests for deprecated argus extension Signed-off-by: Alexander Dahmen <[email protected]> * Remove deprecated kubernetesVersion field Signed-off-by: Alexander Dahmen <[email protected]> * Generate docs Signed-off-by: Alexander Dahmen <[email protected]> * Review findings Signed-off-by: Alexander Dahmen <[email protected]> --------- Signed-off-by: Alexander Dahmen <[email protected]>
1 parent 8e77675 commit e38c5ae

File tree

13 files changed

+539
-409
lines changed

13 files changed

+539
-409
lines changed

docs/data-sources/ske_cluster.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,10 @@ data "stackit_ske_cluster" "example" {
3333

3434
### Read-Only
3535

36-
- `allow_privileged_containers` (Boolean, Deprecated) DEPRECATED as of Kubernetes 1.25+
37-
Flag to specify if privileged mode for containers is enabled or not.
38-
This should be used with care since it also disables a couple of other features like the use of some volume type (e.g. PVCs).
3936
- `egress_address_ranges` (List of String) The outgoing network ranges (in CIDR notation) of traffic originating from workload on the cluster.
4037
- `extensions` (Attributes) A single extensions block as defined below (see [below for nested schema](#nestedatt--extensions))
4138
- `hibernations` (Attributes List) One or more hibernation block as defined below. (see [below for nested schema](#nestedatt--hibernations))
4239
- `id` (String) Terraform's internal data source. ID. It is structured as "`project_id`,`name`".
43-
- `kubernetes_version` (String, Deprecated) Kubernetes version. This field is deprecated, use `kubernetes_version_used` instead
4440
- `kubernetes_version_min` (String) The minimum Kubernetes version, this field is always nil. 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 kubernetes version being used for your cluster, use the `kubernetes_version_used` field.
4541
- `kubernetes_version_used` (String) Full Kubernetes version used. For example, if `1.22` was selected, this value may result to `1.22.15`
4642
- `maintenance` (Attributes) A single maintenance block as defined below (see [below for nested schema](#nestedatt--maintenance))
@@ -54,8 +50,9 @@ This should be used with care since it also disables a couple of other features
5450
Read-Only:
5551

5652
- `acl` (Attributes) Cluster access control configuration (see [below for nested schema](#nestedatt--extensions--acl))
57-
- `argus` (Attributes) A single argus block as defined below (see [below for nested schema](#nestedatt--extensions--argus))
53+
- `argus` (Attributes, Deprecated) A single argus block as defined below. This field is deprecated and will be removed 06 January 2026. (see [below for nested schema](#nestedatt--extensions--argus))
5854
- `dns` (Attributes) DNS extension configuration (see [below for nested schema](#nestedatt--extensions--dns))
55+
- `observability` (Attributes) A single observability block as defined below. (see [below for nested schema](#nestedatt--extensions--observability))
5956

6057
<a id="nestedatt--extensions--acl"></a>
6158
### Nested Schema for `extensions.acl`
@@ -84,6 +81,15 @@ Read-Only:
8481
- `zones` (List of String) Specify a list of domain filters for externalDNS (e.g., `foo.runs.onstackit.cloud`)
8582

8683

84+
<a id="nestedatt--extensions--observability"></a>
85+
### Nested Schema for `extensions.observability`
86+
87+
Read-Only:
88+
89+
- `enabled` (Boolean) Flag to enable/disable Observability extensions.
90+
- `instance_id` (String) Observability instance ID to choose which Observability instance is used. Required when enabled is set to `true`.
91+
92+
8793

8894
<a id="nestedatt--hibernations"></a>
8995
### Nested Schema for `hibernations`

docs/resources/ske_cluster.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,8 @@ resource "stackit_ske_cluster" "example" {
5050

5151
### Optional
5252

53-
- `allow_privileged_containers` (Boolean) Flag to specify if privileged mode for containers is enabled or not.
54-
This should be used with care since it also disables a couple of other features like the use of some volume type (e.g. PVCs).
55-
Deprecated as of Kubernetes 1.25 and later
5653
- `extensions` (Attributes) A single extensions block as defined below. (see [below for nested schema](#nestedatt--extensions))
5754
- `hibernations` (Attributes List) One or more hibernation block as defined below. (see [below for nested schema](#nestedatt--hibernations))
58-
- `kubernetes_version` (String, Deprecated) Kubernetes version. Must only contain major and minor version (e.g. 1.22). This field is deprecated, use `kubernetes_version_min instead`
5955
- `kubernetes_version_min` (String) The minimum Kubernetes version. This field will be used to set the minimum kubernetes version on creation/update of the cluster. If unset, the latest supported Kubernetes 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 kubernetes version being used for your cluster, use the read-only `kubernetes_version_used` field.
6056
- `maintenance` (Attributes) A single maintenance block as defined below. (see [below for nested schema](#nestedatt--maintenance))
6157
- `network` (Attributes) Network block as defined below. (see [below for nested schema](#nestedatt--network))
@@ -117,8 +113,9 @@ Optional:
117113
Optional:
118114

119115
- `acl` (Attributes) Cluster access control configuration. (see [below for nested schema](#nestedatt--extensions--acl))
120-
- `argus` (Attributes) A single argus block as defined below. (see [below for nested schema](#nestedatt--extensions--argus))
116+
- `argus` (Attributes, Deprecated) A single argus block as defined below. This field is deprecated and will be removed 06 January 2026. (see [below for nested schema](#nestedatt--extensions--argus))
121117
- `dns` (Attributes) DNS extension configuration (see [below for nested schema](#nestedatt--extensions--dns))
118+
- `observability` (Attributes) A single observability block as defined below. (see [below for nested schema](#nestedatt--extensions--observability))
122119

123120
<a id="nestedatt--extensions--acl"></a>
124121
### Nested Schema for `extensions.acl`
@@ -153,6 +150,18 @@ Optional:
153150
- `zones` (List of String) Specify a list of domain filters for externalDNS (e.g., `foo.runs.onstackit.cloud`)
154151

155152

153+
<a id="nestedatt--extensions--observability"></a>
154+
### Nested Schema for `extensions.observability`
155+
156+
Required:
157+
158+
- `enabled` (Boolean) Flag to enable/disable Observability extensions.
159+
160+
Optional:
161+
162+
- `instance_id` (String) Observability instance ID to choose which Observability instance is used. Required when enabled is set to `true`.
163+
164+
156165

157166
<a id="nestedatt--hibernations"></a>
158167
### Nested Schema for `hibernations`

docs/resources/ske_kubeconfig.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ resource "stackit_ske_kubeconfig" "example" {
3232

3333
- `expiration` (Number) Expiration time of the kubeconfig, in seconds. Defaults to `3600`
3434
- `refresh` (Boolean) If set to true, the provider will check if the kubeconfig has expired and will generated a new valid one in-place
35+
- `region` (String) The resource region. If not defined, the provider region is used.
3536

3637
### Read-Only
3738

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ require (
3434
github.com/stackitcloud/stackit-sdk-go/services/serverupdate v1.2.0
3535
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.9.0
3636
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.2.1
37-
github.com/stackitcloud/stackit-sdk-go/services/ske v0.27.0
37+
github.com/stackitcloud/stackit-sdk-go/services/ske v1.0.0
3838
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.3.0
3939
github.com/teambition/rrule-go v1.8.2
4040
golang.org/x/mod v0.26.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.9.0 h1:2d28WFQ
198198
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.9.0/go.mod h1:t77MA8uyEU9KZd1On5JpnxI3xhVPKIS8WutStqvU8Cw=
199199
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.2.1 h1:h1TsWatlsexLeKdkb3L8chcxaXJOy/cLXctsRxhb4xg=
200200
github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.2.1/go.mod h1:M4xZ2BnmROvLV2MrAP6A8o9BnyT0CkvpEcP8lBOfRs8=
201-
github.com/stackitcloud/stackit-sdk-go/services/ske v0.27.0 h1:bwLmLXvtCl1XkPRP+YrXwfz+lBMaGWH/crlNbYtxeqE=
202-
github.com/stackitcloud/stackit-sdk-go/services/ske v0.27.0/go.mod h1:V09NmPahuUiuZEogVPgxuVqqti0th5B7TVAjuiM09mE=
201+
github.com/stackitcloud/stackit-sdk-go/services/ske v1.0.0 h1:PX8VTo2UhPd6BeEaCHFlpIkDbk9OFQEO6eJJ8JkxesA=
202+
github.com/stackitcloud/stackit-sdk-go/services/ske v1.0.0/go.mod h1:V09NmPahuUiuZEogVPgxuVqqti0th5B7TVAjuiM09mE=
203203
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.3.0 h1:pUl/981oAXPnZd7++69NfEWv6JwW9UpxER16XxQUdOk=
204204
github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.3.0/go.mod h1:S04/QsQrB2EgYGjl62BO+9QUswrlRBoBosigrhdmccM=
205205
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

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

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,10 @@ func (r *clusterDataSource) Schema(_ context.Context, _ datasource.SchemaRequest
7979
Description: `The minimum Kubernetes version, this field is always nil. ` + SKEUpdateDoc + " To get the current kubernetes version being used for your cluster, use the `kubernetes_version_used` field.",
8080
Computed: true,
8181
},
82-
"kubernetes_version": schema.StringAttribute{
83-
Description: "Kubernetes version. This field is deprecated, use `kubernetes_version_used` instead",
84-
Computed: true,
85-
DeprecationMessage: "This field is always nil, use `kubernetes_version_used` to get the cluster kubernetes version. This field would cause errors when the cluster got a kubernetes version minor upgrade, either triggered by automatic or forceful updates.",
86-
},
8782
"kubernetes_version_used": schema.StringAttribute{
8883
Description: "Full Kubernetes version used. For example, if `1.22` was selected, this value may result to `1.22.15`",
8984
Computed: true,
9085
},
91-
"allow_privileged_containers": schema.BoolAttribute{
92-
Description: "DEPRECATED as of Kubernetes 1.25+\n Flag to specify if privileged mode for containers is enabled or not.\nThis should be used with care since it also disables a couple of other features like the use of some volume type (e.g. PVCs).",
93-
DeprecationMessage: "Please remove this flag from your configuration when using Kubernetes version 1.25+.",
94-
Computed: true,
95-
},
9686
"egress_address_ranges": schema.ListAttribute{
9787
Description: "The outgoing network ranges (in CIDR notation) of traffic originating from workload on the cluster.",
9888
Computed: true,
@@ -262,8 +252,9 @@ func (r *clusterDataSource) Schema(_ context.Context, _ datasource.SchemaRequest
262252
Computed: true,
263253
Attributes: map[string]schema.Attribute{
264254
"argus": schema.SingleNestedAttribute{
265-
Description: "A single argus block as defined below",
266-
Computed: true,
255+
Description: "A single argus block as defined below. This field is deprecated and will be removed 06 January 2026.",
256+
DeprecationMessage: "Use observability instead.",
257+
Computed: true,
267258
Attributes: map[string]schema.Attribute{
268259
"enabled": schema.BoolAttribute{
269260
Description: "Flag to enable/disable argus extensions.",
@@ -275,6 +266,20 @@ func (r *clusterDataSource) Schema(_ context.Context, _ datasource.SchemaRequest
275266
},
276267
},
277268
},
269+
"observability": schema.SingleNestedAttribute{
270+
Description: "A single observability block as defined below.",
271+
Computed: true,
272+
Attributes: map[string]schema.Attribute{
273+
"enabled": schema.BoolAttribute{
274+
Description: "Flag to enable/disable Observability extensions.",
275+
Computed: true,
276+
},
277+
"instance_id": schema.StringAttribute{
278+
Description: "Observability instance ID to choose which Observability instance is used. Required when enabled is set to `true`.",
279+
Computed: true,
280+
},
281+
},
282+
},
278283
"acl": schema.SingleNestedAttribute{
279284
Description: "Cluster access control configuration",
280285
Computed: true,
@@ -331,7 +336,7 @@ func (r *clusterDataSource) Read(ctx context.Context, req datasource.ReadRequest
331336
ctx = tflog.SetField(ctx, "project_id", projectId)
332337
ctx = tflog.SetField(ctx, "name", name)
333338
ctx = tflog.SetField(ctx, "region", region)
334-
clusterResp, err := r.client.GetCluster(ctx, projectId, name).Execute()
339+
clusterResp, err := r.client.GetCluster(ctx, projectId, region, name).Execute()
335340
if err != nil {
336341
utils.LogError(
337342
ctx,

0 commit comments

Comments
 (0)