Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(k8s): expose ACL feature #4371

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions cmd/scw/testdata/test-all-usage-k8s-acl-add-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Add new ACL rules for a specific cluster.

USAGE:
scw k8s acl add [arg=value ...]

ARGS:
cluster-id ID of the cluster whose ACLs will be added
[acls.{index}.ip] IP subnet to allow
[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.
[acls.{index}.description] Description of the ACL
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for add

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-k8s-acl-delete-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete an existing ACL.

USAGE:
scw k8s acl delete [arg=value ...]

ARGS:
acl-id ID of the ACL rule to delete
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for delete

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-k8s-acl-list-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
List ACLs for a specific cluster.

USAGE:
scw k8s acl list [arg=value ...]

ARGS:
cluster-id ID of the cluster whose ACLs will be listed
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all)

FLAGS:
-h, --help help for list

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
22 changes: 22 additions & 0 deletions cmd/scw/testdata/test-all-usage-k8s-acl-set-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Set new ACL rules for a specific cluster.

USAGE:
scw k8s acl set [arg=value ...]

ARGS:
cluster-id ID of the cluster whose ACLs will be set
[acls.{index}.ip] IP subnet to allow
[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.
[acls.{index}.description] Description of the ACL
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

FLAGS:
-h, --help help for set

GLOBAL FLAGS:
-c, --config string The path to the config file
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use
10 changes: 9 additions & 1 deletion cmd/scw/testdata/test-all-usage-k8s-acl-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
Network Access Control Lists (ACLs) allow you to manage inbound network traffic by setting up ACL rules.

USAGE:
scw k8s acl
scw k8s acl <command>

AVAILABLE COMMANDS:
add Add new ACLs
delete Delete an existing ACL
list List ACLs
set Set new ACLs

FLAGS:
-h, --help help for acl
Expand All @@ -13,3 +19,5 @@ GLOBAL FLAGS:
-D, --debug Enable debug mode
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
-p, --profile string The config profile to use

Use "scw k8s acl [command] --help" for more information about a command.
85 changes: 83 additions & 2 deletions docs/commands/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This API allows you to manage Kubernetes Kapsule and Kosmos clusters.

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

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

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

### Add new ACLs

Add new ACL rules for a specific cluster.

**Usage:**

```
scw k8s acl add [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| cluster-id | Required | ID of the cluster whose ACLs will be added |
| acls.{index}.ip | | IP subnet to allow |
| 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. |
| acls.{index}.description | | Description of the ACL |
| 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 |



### Delete an existing ACL

Delete an existing ACL.

**Usage:**

```
scw k8s acl delete [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| acl-id | Required | ID of the ACL rule to delete |
| 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 |



### List ACLs

List ACLs for a specific cluster.

**Usage:**

```
scw k8s acl
scw k8s acl list [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| cluster-id | Required | ID of the cluster whose ACLs will be listed |
| 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 |



### Set new ACLs

Set new ACL rules for a specific cluster.

**Usage:**

```
scw k8s acl set [arg=value ...]
```


**Args:**

| Name | | Description |
|------|---|-------------|
| cluster-id | Required | ID of the cluster whose ACLs will be set |
| acls.{index}.ip | | IP subnet to allow |
| 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. |
| acls.{index}.description | | Description of the ACL |
| 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 |



## Kapsule cluster management commands

Expand Down
Loading
Loading