Skip to content

Commit a3d6d54

Browse files
authored
feat(k8s): add support for SkipNodesWithLocalStorage and LogLevel (#5444)
1 parent 342607a commit a3d6d54

File tree

6 files changed

+39
-3
lines changed

6 files changed

+39
-3
lines changed

cmd/scw/testdata/test-all-usage-k8s-cluster-create-usage.golden

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ ARGS:
5555
[autoscaler-config.scale-down-unneeded-time] How long a node should be unneeded before it is eligible for scale down, defaults to 10 minutes
5656
[autoscaler-config.scale-down-utilization-threshold] Node utilization level, defined as a sum of requested resources divided by allocatable capacity, below which a node can be considered for scale down
5757
[autoscaler-config.max-graceful-termination-sec] Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node, defaults to 600 (10 minutes)
58+
[autoscaler-config.skip-nodes-with-local-storage] Cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath, defaults to true
59+
[autoscaler-config.log-level] Cluster autoscaler logging level expressed from 0 to 4 (4 being the more verbose), defaults to 2. see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-can-i-increase-the-information-that-the-ca-is-logging for details
5860
[auto-upgrade.enable] Defines whether auto upgrade is enabled for the cluster
5961
[auto-upgrade.maintenance-window.start-hour] Start time of the two-hour maintenance window
6062
[auto-upgrade.maintenance-window.day] Day of the week for the maintenance window (any | monday | tuesday | wednesday | thursday | friday | saturday | sunday)

cmd/scw/testdata/test-all-usage-k8s-cluster-update-usage.golden

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ ARGS:
2727
[autoscaler-config.scale-down-unneeded-time] How long a node should be unneeded before it is eligible for scale down, defaults to 10 minutes
2828
[autoscaler-config.scale-down-utilization-threshold] Node utilization level, defined as a sum of requested resources divided by allocatable capacity, below which a node can be considered for scale down
2929
[autoscaler-config.max-graceful-termination-sec] Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node, defaults to 600 (10 minutes)
30+
[autoscaler-config.skip-nodes-with-local-storage] Cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath, defaults to true
31+
[autoscaler-config.log-level] Cluster autoscaler logging level expressed from 0 to 4 (4 being the more verbose), defaults to 2. see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-can-i-increase-the-information-that-the-ca-is-logging for details
3032
[auto-upgrade.enable] Defines whether auto upgrade is enabled for the cluster
3133
[auto-upgrade.maintenance-window.start-hour] Start time of the two-hour maintenance window
3234
[auto-upgrade.maintenance-window.day] Day of the week for the maintenance window (any | monday | tuesday | wednesday | thursday | friday | saturday | sunday)

docs/commands/k8s.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,8 @@ scw k8s cluster create [arg=value ...]
206206
| autoscaler-config.scale-down-unneeded-time | | How long a node should be unneeded before it is eligible for scale down, defaults to 10 minutes |
207207
| autoscaler-config.scale-down-utilization-threshold | | Node utilization level, defined as a sum of requested resources divided by allocatable capacity, below which a node can be considered for scale down |
208208
| autoscaler-config.max-graceful-termination-sec | | Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node, defaults to 600 (10 minutes) |
209+
| autoscaler-config.skip-nodes-with-local-storage | | Cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath, defaults to true |
210+
| autoscaler-config.log-level | | Cluster autoscaler logging level expressed from 0 to 4 (4 being the more verbose), defaults to 2. see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-can-i-increase-the-information-that-the-ca-is-logging for details |
209211
| auto-upgrade.enable | | Defines whether auto upgrade is enabled for the cluster |
210212
| auto-upgrade.maintenance-window.start-hour | | Start time of the two-hour maintenance window |
211213
| auto-upgrade.maintenance-window.day | One of: `any`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday` | Day of the week for the maintenance window |
@@ -505,6 +507,8 @@ scw k8s cluster update <cluster-id ...> [arg=value ...]
505507
| autoscaler-config.scale-down-unneeded-time | | How long a node should be unneeded before it is eligible for scale down, defaults to 10 minutes |
506508
| autoscaler-config.scale-down-utilization-threshold | | Node utilization level, defined as a sum of requested resources divided by allocatable capacity, below which a node can be considered for scale down |
507509
| autoscaler-config.max-graceful-termination-sec | | Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node, defaults to 600 (10 minutes) |
510+
| autoscaler-config.skip-nodes-with-local-storage | | Cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath, defaults to true |
511+
| autoscaler-config.log-level | | Cluster autoscaler logging level expressed from 0 to 4 (4 being the more verbose), defaults to 2. see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-can-i-increase-the-information-that-the-ca-is-logging for details |
508512
| auto-upgrade.enable | | Defines whether auto upgrade is enabled for the cluster |
509513
| auto-upgrade.maintenance-window.start-hour | | Start time of the two-hour maintenance window |
510514
| auto-upgrade.maintenance-window.day | One of: `any`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday` | Day of the week for the maintenance window |

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ require (
2525
github.com/moby/buildkit v0.28.1
2626
github.com/moby/go-archive v0.2.0
2727
github.com/opencontainers/go-digest v1.0.0
28-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260326142950-7469ac58518e
28+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260331080437-5f0a357c9670
2929
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
3030
github.com/spf13/cobra v1.10.2
3131
github.com/spf13/pflag v1.0.10

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
476476
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
477477
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
478478
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
479-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260326142950-7469ac58518e h1:G4S6j5W/56KXaZ7RAe+2Vqaypx/rtymDJp2tVpWRmpM=
480-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260326142950-7469ac58518e/go.mod h1:SKcIU6lqwljcpjOlTnSfMFfURd/XT+08spQyqN9OTWA=
479+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260331080437-5f0a357c9670 h1:ikt732h6stIZ+7HLBvf6WjovfCakUwsZSgBClC3H05Y=
480+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260331080437-5f0a357c9670/go.mod h1:SKcIU6lqwljcpjOlTnSfMFfURd/XT+08spQyqN9OTWA=
481481
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
482482
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
483483
github.com/secure-systems-lab/go-securesystemslib v0.10.0 h1:l+H5ErcW0PAehBNrBxoGv1jjNpGYdZ9RcheFkB2WI14=

internal/namespaces/k8s/v1/k8s_cli.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,20 @@ func k8sClusterCreate() *core.Command {
628628
Deprecated: false,
629629
Positional: false,
630630
},
631+
{
632+
Name: "autoscaler-config.skip-nodes-with-local-storage",
633+
Short: `Cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath, defaults to true`,
634+
Required: false,
635+
Deprecated: false,
636+
Positional: false,
637+
},
638+
{
639+
Name: "autoscaler-config.log-level",
640+
Short: `Cluster autoscaler logging level expressed from 0 to 4 (4 being the more verbose), defaults to 2. see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-can-i-increase-the-information-that-the-ca-is-logging for details`,
641+
Required: false,
642+
Deprecated: false,
643+
Positional: false,
644+
},
631645
{
632646
Name: "auto-upgrade.enable",
633647
Short: `Defines whether auto upgrade is enabled for the cluster`,
@@ -945,6 +959,20 @@ func k8sClusterUpdate() *core.Command {
945959
Deprecated: false,
946960
Positional: false,
947961
},
962+
{
963+
Name: "autoscaler-config.skip-nodes-with-local-storage",
964+
Short: `Cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath, defaults to true`,
965+
Required: false,
966+
Deprecated: false,
967+
Positional: false,
968+
},
969+
{
970+
Name: "autoscaler-config.log-level",
971+
Short: `Cluster autoscaler logging level expressed from 0 to 4 (4 being the more verbose), defaults to 2. see https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#how-can-i-increase-the-information-that-the-ca-is-logging for details`,
972+
Required: false,
973+
Deprecated: false,
974+
Positional: false,
975+
},
948976
{
949977
Name: "auto-upgrade.enable",
950978
Short: `Defines whether auto upgrade is enabled for the cluster`,

0 commit comments

Comments
 (0)