Skip to content

Commit 41b454e

Browse files
feat(k8s): expose ACL feature (scaleway#4371)
Co-authored-by: Rémy Léone <[email protected]>
1 parent fb7a771 commit 41b454e

File tree

7 files changed

+355
-3
lines changed

7 files changed

+355
-3
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Add new ACL rules for a specific cluster.
4+
5+
USAGE:
6+
scw k8s acl add [arg=value ...]
7+
8+
ARGS:
9+
cluster-id ID of the cluster whose ACLs will be added
10+
[acls.{index}.ip] IP subnet to allow
11+
[acls.{index}.scaleway-ranges] Allow access to cluster from all Scaleway ranges as defined in https://www.scaleway.com/en/docs/console/account/reference-content/scaleway-network-information/#ip-ranges-used-by-scaleway.
12+
[acls.{index}.description] Description of the ACL
13+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
14+
15+
FLAGS:
16+
-h, --help help for add
17+
18+
GLOBAL FLAGS:
19+
-c, --config string The path to the config file
20+
-D, --debug Enable debug mode
21+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
22+
-p, --profile string The config profile to use
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Delete an existing ACL.
4+
5+
USAGE:
6+
scw k8s acl delete [arg=value ...]
7+
8+
ARGS:
9+
acl-id ID of the ACL rule to delete
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
11+
12+
FLAGS:
13+
-h, --help help for delete
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
List ACLs for a specific cluster.
4+
5+
USAGE:
6+
scw k8s acl list [arg=value ...]
7+
8+
ARGS:
9+
cluster-id ID of the cluster whose ACLs will be listed
10+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)
11+
12+
FLAGS:
13+
-h, --help help for list
14+
15+
GLOBAL FLAGS:
16+
-c, --config string The path to the config file
17+
-D, --debug Enable debug mode
18+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
19+
-p, --profile string The config profile to use
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Set new ACL rules for a specific cluster.
4+
5+
USAGE:
6+
scw k8s acl set [arg=value ...]
7+
8+
ARGS:
9+
cluster-id ID of the cluster whose ACLs will be set
10+
[acls.{index}.ip] IP subnet to allow
11+
[acls.{index}.scaleway-ranges] Allow access to cluster from all Scaleway ranges as defined in https://www.scaleway.com/en/docs/console/account/reference-content/scaleway-network-information/#ip-ranges-used-by-scaleway.
12+
[acls.{index}.description] Description of the ACL
13+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
14+
15+
FLAGS:
16+
-h, --help help for set
17+
18+
GLOBAL FLAGS:
19+
-c, --config string The path to the config file
20+
-D, --debug Enable debug mode
21+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
22+
-p, --profile string The config profile to use

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
Network Access Control Lists (ACLs) allow you to manage inbound network traffic by setting up ACL rules.
44

55
USAGE:
6-
scw k8s acl
6+
scw k8s acl <command>
7+
8+
AVAILABLE COMMANDS:
9+
add Add new ACLs
10+
delete Delete an existing ACL
11+
list List ACLs
12+
set Set new ACLs
713

814
FLAGS:
915
-h, --help help for acl
@@ -13,3 +19,5 @@ GLOBAL FLAGS:
1319
-D, --debug Enable debug mode
1420
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
1521
-p, --profile string The config profile to use
22+
23+
Use "scw k8s acl [command] --help" for more information about a command.

docs/commands/k8s.md

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
This API allows you to manage Kubernetes Kapsule and Kosmos clusters.
44

55
- [Access Control List (ACL) management commands](#access-control-list-(acl)-management-commands)
6+
- [Add new ACLs](#add-new-acls)
7+
- [Delete an existing ACL](#delete-an-existing-acl)
8+
- [List ACLs](#list-acls)
9+
- [Set new ACLs](#set-new-acls)
610
- [Kapsule cluster management commands](#kapsule-cluster-management-commands)
711
- [Create a new Cluster](#create-a-new-cluster)
812
- [Delete a Cluster](#delete-a-cluster)
@@ -46,15 +50,92 @@ This API allows you to manage Kubernetes Kapsule and Kosmos clusters.
4650

4751
Network Access Control Lists (ACLs) allow you to manage inbound network traffic by setting up ACL rules.
4852

49-
Network Access Control Lists (ACLs) allow you to manage inbound network traffic by setting up ACL rules.
53+
54+
### Add new ACLs
55+
56+
Add new ACL rules for a specific cluster.
57+
58+
**Usage:**
59+
60+
```
61+
scw k8s acl add [arg=value ...]
62+
```
63+
64+
65+
**Args:**
66+
67+
| Name | | Description |
68+
|------|---|-------------|
69+
| cluster-id | Required | ID of the cluster whose ACLs will be added |
70+
| acls.{index}.ip | | IP subnet to allow |
71+
| acls.{index}.scaleway-ranges | | Allow access to cluster from all Scaleway ranges as defined in https://www.scaleway.com/en/docs/console/account/reference-content/scaleway-network-information/#ip-ranges-used-by-scaleway. |
72+
| acls.{index}.description | | Description of the ACL |
73+
| 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 |
74+
75+
76+
77+
### Delete an existing ACL
78+
79+
Delete an existing ACL.
80+
81+
**Usage:**
82+
83+
```
84+
scw k8s acl delete [arg=value ...]
85+
```
86+
87+
88+
**Args:**
89+
90+
| Name | | Description |
91+
|------|---|-------------|
92+
| acl-id | Required | ID of the ACL rule to delete |
93+
| 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 |
94+
95+
96+
97+
### List ACLs
98+
99+
List ACLs for a specific cluster.
50100

51101
**Usage:**
52102

53103
```
54-
scw k8s acl
104+
scw k8s acl list [arg=value ...]
55105
```
56106

57107

108+
**Args:**
109+
110+
| Name | | Description |
111+
|------|---|-------------|
112+
| cluster-id | Required | ID of the cluster whose ACLs will be listed |
113+
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config |
114+
115+
116+
117+
### Set new ACLs
118+
119+
Set new ACL rules for a specific cluster.
120+
121+
**Usage:**
122+
123+
```
124+
scw k8s acl set [arg=value ...]
125+
```
126+
127+
128+
**Args:**
129+
130+
| Name | | Description |
131+
|------|---|-------------|
132+
| cluster-id | Required | ID of the cluster whose ACLs will be set |
133+
| acls.{index}.ip | | IP subnet to allow |
134+
| acls.{index}.scaleway-ranges | | Allow access to cluster from all Scaleway ranges as defined in https://www.scaleway.com/en/docs/console/account/reference-content/scaleway-network-information/#ip-ranges-used-by-scaleway. |
135+
| acls.{index}.description | | Description of the ACL |
136+
| 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 |
137+
138+
58139

59140
## Kapsule cluster management commands
60141

0 commit comments

Comments
 (0)