Skip to content

Commit 439f6bb

Browse files
authored
feat(k8s): add pools labels, taints and startup_taints (#5336)
1 parent 11a7bdc commit 439f6bb

File tree

6 files changed

+149
-3
lines changed

6 files changed

+149
-3
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ ARGS:
3838
[pools.{index}.root-volume-size] System volume disk size
3939
[pools.{index}.public-ip-disabled] Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway
4040
[pools.{index}.security-group-id] Security group ID in which all the nodes of the pool will be created. If unset, the pool will use default Kapsule security group in current zone
41+
[pools.{index}.labels.{key}] Kubernetes labels applied and reconciled on the nodes
42+
[pools.{index}.taints.{index}.key] The taint key to be applied to a node
43+
[pools.{index}.taints.{index}.value] The taint value corresponding to the taint key
44+
[pools.{index}.taints.{index}.effect] Effect defines the effects of Taint (NoSchedule | PreferNoSchedule | NoExecute)
45+
[pools.{index}.startup-taints.{index}.key] The taint key to be applied to a node
46+
[pools.{index}.startup-taints.{index}.value] The taint value corresponding to the taint key
47+
[pools.{index}.startup-taints.{index}.effect] Effect defines the effects of Taint (NoSchedule | PreferNoSchedule | NoExecute)
4148
[autoscaler-config.scale-down-disabled] Forbid cluster autoscaler to scale down the cluster, defaults to false
4249
[autoscaler-config.scale-down-delay-after-add] How long after scale up the scale down evaluation resumes
4350
[autoscaler-config.estimator] Type of resource estimator to be used in scale up (unknown_estimator | binpacking)

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ ARGS:
3535
[root-volume-size] System volume disk size
3636
[public-ip-disabled] Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway
3737
[security-group-id] Security group ID in which all the nodes of the pool will be created. If unset, the pool will use default Kapsule security group in current zone
38+
[labels.{key}] Kubernetes labels applied and reconciled on the nodes
39+
[taints.{index}.key] The taint key to be applied to a node
40+
[taints.{index}.value] The taint value corresponding to the taint key
41+
[taints.{index}.effect] Effect defines the effects of Taint (NoSchedule | PreferNoSchedule | NoExecute)
42+
[startup-taints.{index}.key] The taint key to be applied to a node
43+
[startup-taints.{index}.value] The taint value corresponding to the taint key
44+
[startup-taints.{index}.effect] Effect defines the effects of Taint (NoSchedule | PreferNoSchedule | NoExecute)
3845
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
3946

4047
FLAGS:

docs/commands/k8s.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@ scw k8s cluster create [arg=value ...]
183183
| pools.{index}.root-volume-size | | System volume disk size |
184184
| pools.{index}.public-ip-disabled | | Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway |
185185
| pools.{index}.security-group-id | | Security group ID in which all the nodes of the pool will be created. If unset, the pool will use default Kapsule security group in current zone |
186+
| pools.{index}.labels.{key} | | Kubernetes labels applied and reconciled on the nodes |
187+
| pools.{index}.taints.{index}.key | | The taint key to be applied to a node |
188+
| pools.{index}.taints.{index}.value | | The taint value corresponding to the taint key |
189+
| pools.{index}.taints.{index}.effect | One of: `NoSchedule`, `PreferNoSchedule`, `NoExecute` | Effect defines the effects of Taint |
190+
| pools.{index}.startup-taints.{index}.key | | The taint key to be applied to a node |
191+
| pools.{index}.startup-taints.{index}.value | | The taint value corresponding to the taint key |
192+
| pools.{index}.startup-taints.{index}.effect | One of: `NoSchedule`, `PreferNoSchedule`, `NoExecute` | Effect defines the effects of Taint |
186193
| autoscaler-config.scale-down-disabled | | Forbid cluster autoscaler to scale down the cluster, defaults to false |
187194
| autoscaler-config.scale-down-delay-after-add | | How long after scale up the scale down evaluation resumes |
188195
| autoscaler-config.estimator | One of: `unknown_estimator`, `binpacking` | Type of resource estimator to be used in scale up |
@@ -1014,6 +1021,13 @@ scw k8s pool create [arg=value ...]
10141021
| root-volume-size | | System volume disk size |
10151022
| public-ip-disabled | | Defines if the public IP should be removed from Nodes. To use this feature, your Cluster must have an attached Private Network set up with a Public Gateway |
10161023
| security-group-id | | Security group ID in which all the nodes of the pool will be created. If unset, the pool will use default Kapsule security group in current zone |
1024+
| labels.{key} | | Kubernetes labels applied and reconciled on the nodes |
1025+
| taints.{index}.key | | The taint key to be applied to a node |
1026+
| taints.{index}.value | | The taint value corresponding to the taint key |
1027+
| taints.{index}.effect | One of: `NoSchedule`, `PreferNoSchedule`, `NoExecute` | Effect defines the effects of Taint |
1028+
| startup-taints.{index}.key | | The taint key to be applied to a node |
1029+
| startup-taints.{index}.value | | The taint value corresponding to the taint key |
1030+
| startup-taints.{index}.effect | One of: `NoSchedule`, `PreferNoSchedule`, `NoExecute` | Effect defines the effects of Taint |
10171031
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config |
10181032

10191033

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/moby/buildkit v0.27.1
2525
github.com/moby/go-archive v0.2.0
2626
github.com/opencontainers/go-digest v1.0.0
27-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260216140602-016f04e8505d
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260218175729-a92ec8c9a75c
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.10.2
3030
github.com/spf13/pflag v1.0.10

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7
468468
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
469469
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 h1:OkMGxebDjyw0ULyrTYWeN0UNCCkmCWfjPnIA2W6oviI=
470470
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06/go.mod h1:+ePHsJ1keEjQtpvf9HHw0f4ZeJ0TLRsxhunSI2hYJSs=
471-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260216140602-016f04e8505d h1:0LuW1N/w+ordwEY6kfPlyPbIp2R0NQ319O90SUBVnX0=
472-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260216140602-016f04e8505d/go.mod h1:Ysemk+aTe1WHMoiLx50yZHpMS+v4vYljt+QbCMAKsVA=
471+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260218175729-a92ec8c9a75c h1:ijHD/7UQW2F0Ptj0+KREl2yFwV5iU1xTXd4YEQCr60w=
472+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.36.0.20260218175729-a92ec8c9a75c/go.mod h1:Ysemk+aTe1WHMoiLx50yZHpMS+v4vYljt+QbCMAKsVA=
473473
github.com/sclevine/spec v1.4.0 h1:z/Q9idDcay5m5irkZ28M7PtQM4aOISzOpj4bUPkDee8=
474474
github.com/sclevine/spec v1.4.0/go.mod h1:LvpgJaFyvQzRvc1kaDs0bulYwzC70PbiYjC4QnFHkOM=
475475
github.com/secure-systems-lab/go-securesystemslib v0.9.1 h1:nZZaNz4DiERIQguNy0cL5qTdn9lR8XKHf4RUyG1Sx3g=

internal/namespaces/k8s/v1/k8s_cli.go

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,65 @@ func k8sClusterCreate() *core.Command {
487487
Deprecated: false,
488488
Positional: false,
489489
},
490+
{
491+
Name: "pools.{index}.labels.{key}",
492+
Short: `Kubernetes labels applied and reconciled on the nodes`,
493+
Required: false,
494+
Deprecated: false,
495+
Positional: false,
496+
},
497+
{
498+
Name: "pools.{index}.taints.{index}.key",
499+
Short: `The taint key to be applied to a node`,
500+
Required: false,
501+
Deprecated: false,
502+
Positional: false,
503+
},
504+
{
505+
Name: "pools.{index}.taints.{index}.value",
506+
Short: `The taint value corresponding to the taint key`,
507+
Required: false,
508+
Deprecated: false,
509+
Positional: false,
510+
},
511+
{
512+
Name: "pools.{index}.taints.{index}.effect",
513+
Short: `Effect defines the effects of Taint`,
514+
Required: false,
515+
Deprecated: false,
516+
Positional: false,
517+
EnumValues: []string{
518+
"NoSchedule",
519+
"PreferNoSchedule",
520+
"NoExecute",
521+
},
522+
},
523+
{
524+
Name: "pools.{index}.startup-taints.{index}.key",
525+
Short: `The taint key to be applied to a node`,
526+
Required: false,
527+
Deprecated: false,
528+
Positional: false,
529+
},
530+
{
531+
Name: "pools.{index}.startup-taints.{index}.value",
532+
Short: `The taint value corresponding to the taint key`,
533+
Required: false,
534+
Deprecated: false,
535+
Positional: false,
536+
},
537+
{
538+
Name: "pools.{index}.startup-taints.{index}.effect",
539+
Short: `Effect defines the effects of Taint`,
540+
Required: false,
541+
Deprecated: false,
542+
Positional: false,
543+
EnumValues: []string{
544+
"NoSchedule",
545+
"PreferNoSchedule",
546+
"NoExecute",
547+
},
548+
},
490549
{
491550
Name: "autoscaler-config.scale-down-disabled",
492551
Short: `Forbid cluster autoscaler to scale down the cluster, defaults to false`,
@@ -1836,6 +1895,65 @@ func k8sPoolCreate() *core.Command {
18361895
Deprecated: false,
18371896
Positional: false,
18381897
},
1898+
{
1899+
Name: "labels.{key}",
1900+
Short: `Kubernetes labels applied and reconciled on the nodes`,
1901+
Required: false,
1902+
Deprecated: false,
1903+
Positional: false,
1904+
},
1905+
{
1906+
Name: "taints.{index}.key",
1907+
Short: `The taint key to be applied to a node`,
1908+
Required: false,
1909+
Deprecated: false,
1910+
Positional: false,
1911+
},
1912+
{
1913+
Name: "taints.{index}.value",
1914+
Short: `The taint value corresponding to the taint key`,
1915+
Required: false,
1916+
Deprecated: false,
1917+
Positional: false,
1918+
},
1919+
{
1920+
Name: "taints.{index}.effect",
1921+
Short: `Effect defines the effects of Taint`,
1922+
Required: false,
1923+
Deprecated: false,
1924+
Positional: false,
1925+
EnumValues: []string{
1926+
"NoSchedule",
1927+
"PreferNoSchedule",
1928+
"NoExecute",
1929+
},
1930+
},
1931+
{
1932+
Name: "startup-taints.{index}.key",
1933+
Short: `The taint key to be applied to a node`,
1934+
Required: false,
1935+
Deprecated: false,
1936+
Positional: false,
1937+
},
1938+
{
1939+
Name: "startup-taints.{index}.value",
1940+
Short: `The taint value corresponding to the taint key`,
1941+
Required: false,
1942+
Deprecated: false,
1943+
Positional: false,
1944+
},
1945+
{
1946+
Name: "startup-taints.{index}.effect",
1947+
Short: `Effect defines the effects of Taint`,
1948+
Required: false,
1949+
Deprecated: false,
1950+
Positional: false,
1951+
EnumValues: []string{
1952+
"NoSchedule",
1953+
"PreferNoSchedule",
1954+
"NoExecute",
1955+
},
1956+
},
18391957
core.RegionArgSpec(
18401958
scw.RegionFrPar,
18411959
scw.RegionNlAms,

0 commit comments

Comments
 (0)