Skip to content

Commit 2d56d08

Browse files
authored
feat(k8s): add taints and labels management (#5361)
1 parent da5fd0f commit 2d56d08

27 files changed

+4821
-8
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Remove a label from all nodes of the pool (only apply to labels which was set through scaleway api).
4+
5+
USAGE:
6+
scw k8s pool remove-label <pool-id ...> [arg=value ...]
7+
8+
EXAMPLES:
9+
Remove a label of a specific pool
10+
scw k8s pool remove-label 11111111-1111-1111-1111-111111111111 key=foo
11+
12+
ARGS:
13+
pool-id ID of the pool.
14+
key Key of the label.
15+
[region=fr-par] Region to target. If none is passed will use default region from the config
16+
17+
FLAGS:
18+
-h, --help help for remove-label
19+
--list-sub-commands List all subcommands
20+
21+
GLOBAL FLAGS:
22+
-c, --config string The path to the config file
23+
-D, --debug Enable debug mode
24+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
25+
-p, --profile string The config profile to use
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
New nodes will not have this taint at startup (does not remove taints from kubernetes side).
4+
5+
USAGE:
6+
scw k8s pool remove-startup-taint <pool-id ...> [arg=value ...]
7+
8+
EXAMPLES:
9+
Remove a startup taint of a specific pool
10+
scw k8s pool remove-startup-taint 11111111-1111-1111-1111-111111111111 key=foo
11+
12+
ARGS:
13+
pool-id ID of the pool.
14+
key Key of the taint.
15+
[region=fr-par] Region to target. If none is passed will use default region from the config
16+
17+
FLAGS:
18+
-h, --help help for remove-startup-taint
19+
--list-sub-commands List all subcommands
20+
21+
GLOBAL FLAGS:
22+
-c, --config string The path to the config file
23+
-D, --debug Enable debug mode
24+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
25+
-p, --profile string The config profile to use
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Remove a taint from all all nodes of the pool (only apply to taints which was set through scaleway api).
4+
5+
USAGE:
6+
scw k8s pool remove-taint <pool-id ...> [arg=value ...]
7+
8+
EXAMPLES:
9+
Remove a taint to a specific pool
10+
scw k8s pool remove-taint 11111111-1111-1111-1111-111111111111 key=foo
11+
12+
ARGS:
13+
pool-id ID of the pool.
14+
key Key of the taint.
15+
[region=fr-par] Region to target. If none is passed will use default region from the config
16+
17+
FLAGS:
18+
-h, --help help for remove-taint
19+
--list-sub-commands List all subcommands
20+
21+
GLOBAL FLAGS:
22+
-c, --config string The path to the config file
23+
-D, --debug Enable debug mode
24+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
25+
-p, --profile string The config profile to use
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Apply a label to all nodes of the pool which will be periodically reconciled by scaleway.
4+
5+
USAGE:
6+
scw k8s pool set-label <pool-id ...> [arg=value ...]
7+
8+
EXAMPLES:
9+
Apply a label to a specific pool
10+
scw k8s pool set-label 11111111-1111-1111-1111-111111111111 key=foo value=bar
11+
12+
Apply a full label to a specific pool
13+
scw k8s pool set-label 11111111-1111-1111-1111-111111111111 key=organization.example/gpu value=true
14+
15+
ARGS:
16+
pool-id ID of the pool.
17+
key Key of the label.
18+
value Value of the label.
19+
[region=fr-par] Region to target. If none is passed will use default region from the config
20+
21+
FLAGS:
22+
-h, --help help for set-label
23+
--list-sub-commands List all subcommands
24+
25+
GLOBAL FLAGS:
26+
-c, --config string The path to the config file
27+
-D, --debug Enable debug mode
28+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
29+
-p, --profile string The config profile to use
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Apply a taint at node creation but does not reconcile after.
4+
5+
USAGE:
6+
scw k8s pool set-startup-taint <pool-id ...> [arg=value ...]
7+
8+
EXAMPLES:
9+
Apply a startup taint to a specific pool
10+
scw k8s pool set-startup-taint 11111111-1111-1111-1111-111111111111 key=foo value=bar effect=NoSchedule
11+
12+
Apply a full startup taint to a specific pool
13+
scw k8s pool set-startup-taint 11111111-1111-1111-1111-111111111111 key=organization.example/gpu value=true effect=NoSchedule
14+
15+
ARGS:
16+
pool-id ID of the pool.
17+
key Key of the taint.
18+
value Value of the taint.
19+
effect Effect of the taint. (NoSchedule | PreferNoSchedule | NoExecute)
20+
[region=fr-par] Region to target. If none is passed will use default region from the config
21+
22+
FLAGS:
23+
-h, --help help for set-startup-taint
24+
--list-sub-commands List all subcommands
25+
26+
GLOBAL FLAGS:
27+
-c, --config string The path to the config file
28+
-D, --debug Enable debug mode
29+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
30+
-p, --profile string The config profile to use
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Apply a taint to all nodes of the pool which will be periodically reconciled by scaleway.
4+
5+
USAGE:
6+
scw k8s pool set-taint <pool-id ...> [arg=value ...]
7+
8+
EXAMPLES:
9+
Apply a taint to a specific pool
10+
scw k8s pool set-taint 11111111-1111-1111-1111-111111111111 key=foo value=bar effect=NoSchedule
11+
12+
Apply a full taint to a specific pool
13+
scw k8s pool set-taint 11111111-1111-1111-1111-111111111111 key=organization.example/gpu value=true effect=NoSchedule
14+
15+
ARGS:
16+
pool-id ID of the pool.
17+
key Key of the taint.
18+
value Value of the taint.
19+
effect Effect of the taint. (NoSchedule | PreferNoSchedule | NoExecute)
20+
[region=fr-par] Region to target. If none is passed will use default region from the config
21+
22+
FLAGS:
23+
-h, --help help for set-taint
24+
--list-sub-commands List all subcommands
25+
26+
GLOBAL FLAGS:
27+
-c, --config string The path to the config file
28+
-D, --debug Enable debug mode
29+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
30+
-p, --profile string The config profile to use

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

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,26 @@ USAGE:
77
scw k8s pool <command>
88

99
AVAILABLE COMMANDS:
10-
add-external-node Add an external node to a Kosmos Pool
11-
create Create a new Pool in a Cluster
12-
delete Delete a Pool in a Cluster
13-
get Get a Pool in a Cluster
14-
list List Pools in a Cluster
15-
update Update a Pool in a Cluster
16-
upgrade Upgrade a Pool in a Cluster
10+
add-external-node Add an external node to a Kosmos Pool
11+
create Create a new Pool in a Cluster
12+
delete Delete a Pool in a Cluster
13+
get Get a Pool in a Cluster
14+
list List Pools in a Cluster
15+
update Update a Pool in a Cluster
16+
upgrade Upgrade a Pool in a Cluster
17+
18+
LABEL COMMANDS:
19+
remove-label Remove a label from a Pool
20+
set-label Apply a label to a Pool
21+
22+
TAINT COMMANDS:
23+
remove-startup-taint Remove a startup taint from a Pool
24+
remove-taint Remove a taint from a Pool
25+
set-startup-taint Apply a startup taint to a Pool
26+
set-taint Apply a taint to a Pool
1727

1828
WORKFLOW COMMANDS:
19-
wait Wait for a pool to reach a stable state
29+
wait Wait for a pool to reach a stable state
2030

2131
FLAGS:
2232
-h, --help help for pool

0 commit comments

Comments
 (0)