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

docs(k8s): fix examples for pool #1976

Merged
merged 3 commits into from
Oct 7, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ USAGE:

EXAMPLES:
Create a pool named bar with 2 DEV1-XL on a given cluster
scw k8s pool create 11111111-1111-1111-111111111111 name=bar node-type=DEV1-XL size=2
scw k8s pool create cluster-id=11111111-1111-1111-111111111111 name=bar node-type=DEV1-XL size=2

Create a pool named fish with 5 GP1-L with autoscaling enabled within 0 and 10 nodes, autohealing enabled, and containerd as the container runtime on a given cluster
scw k8s pool create 11111111-1111-1111-111111111111 name=fish node-type=GP1-L size=5 min-size=0 max-size=10 autoscaling=true autohealing=true container-runtime=containerd
scw k8s pool create cluster-id=11111111-1111-1111-111111111111 name=fish node-type=GP1-L size=5 min-size=0 max-size=10 autoscaling=true autohealing=true container-runtime=containerd

Create a tagged pool named turtle with 1 GP1-S which is using the already created placement group 2222222222222-2222-222222222222 for all the nodes in the pool on a given cluster
scw k8s pool create 11111111-1111-1111-111111111111 name=turtle node-type=GP1-S size=1 placement-group-id=2222222222222-2222-222222222222 tags.0=turtle tags.1=placement-group
scw k8s pool create cluster-id=11111111-1111-1111-111111111111 name=turtle node-type=GP1-S size=1 placement-group-id=2222222222222-2222-222222222222 tags.0=turtle tags.1=placement-group

ARGS:
cluster-id The ID of the cluster in which the pool will be created
Expand Down
8 changes: 4 additions & 4 deletions cmd/scw/testdata/test-all-usage-k8s-pool-list-usage.golden
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ USAGE:

EXAMPLES:
List all pools for a given cluster
scw k8s pool list 11111111-1111-1111-111111111111
scw k8s pool list cluster-id=11111111-1111-1111-111111111111

List all scaling pools for a given cluster
scw k8s pool list 11111111-1111-1111-111111111111 status=scaling
scw k8s pool list cluster-id=11111111-1111-1111-111111111111 status=scaling

List all pools for a given cluster that contain the word foo in the pool name
scw k8s pool list 11111111-1111-1111-111111111111 name=foo
scw k8s pool list cluster-id=11111111-1111-1111-111111111111 name=foo

List all pools for a given cluster and order them by ascending creation date
scw k8s pool list 11111111-1111-1111-111111111111 order-by=created_at_asc
scw k8s pool list cluster-id=11111111-1111-1111-111111111111 order-by=created_at_asc

ARGS:
cluster-id The ID of the cluster from which the pools will be listed from
Expand Down
14 changes: 7 additions & 7 deletions docs/commands/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -736,17 +736,17 @@ scw k8s pool create [arg=value ...]

Create a pool named bar with 2 DEV1-XL on a given cluster
```
scw k8s pool create 11111111-1111-1111-111111111111 name=bar node-type=DEV1-XL size=2
scw k8s pool create cluster-id=11111111-1111-1111-111111111111 name=bar node-type=DEV1-XL size=2
```

Create a pool named fish with 5 GP1-L with autoscaling enabled within 0 and 10 nodes, autohealing enabled, and containerd as the container runtime on a given cluster
```
scw k8s pool create 11111111-1111-1111-111111111111 name=fish node-type=GP1-L size=5 min-size=0 max-size=10 autoscaling=true autohealing=true container-runtime=containerd
scw k8s pool create cluster-id=11111111-1111-1111-111111111111 name=fish node-type=GP1-L size=5 min-size=0 max-size=10 autoscaling=true autohealing=true container-runtime=containerd
```

Create a tagged pool named turtle with 1 GP1-S which is using the already created placement group 2222222222222-2222-222222222222 for all the nodes in the pool on a given cluster
```
scw k8s pool create 11111111-1111-1111-111111111111 name=turtle node-type=GP1-S size=1 placement-group-id=2222222222222-2222-222222222222 tags.0=turtle tags.1=placement-group
scw k8s pool create cluster-id=11111111-1111-1111-111111111111 name=turtle node-type=GP1-S size=1 placement-group-id=2222222222222-2222-222222222222 tags.0=turtle tags.1=placement-group
```


Expand Down Expand Up @@ -839,22 +839,22 @@ scw k8s pool list [arg=value ...]

List all pools for a given cluster
```
scw k8s pool list 11111111-1111-1111-111111111111
scw k8s pool list cluster-id=11111111-1111-1111-111111111111
```

List all scaling pools for a given cluster
```
scw k8s pool list 11111111-1111-1111-111111111111 status=scaling
scw k8s pool list cluster-id=11111111-1111-1111-111111111111 status=scaling
```

List all pools for a given cluster that contain the word foo in the pool name
```
scw k8s pool list 11111111-1111-1111-111111111111 name=foo
scw k8s pool list cluster-id=11111111-1111-1111-111111111111 name=foo
```

List all pools for a given cluster and order them by ascending creation date
```
scw k8s pool list 11111111-1111-1111-111111111111 order-by=created_at_asc
scw k8s pool list cluster-id=11111111-1111-1111-111111111111 order-by=created_at_asc
```


Expand Down
14 changes: 7 additions & 7 deletions internal/namespaces/k8s/v1/k8s_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -1108,19 +1108,19 @@ func k8sPoolList() *core.Command {
Examples: []*core.Example{
{
Short: "List all pools for a given cluster",
Raw: `scw k8s pool list 11111111-1111-1111-111111111111`,
Raw: `scw k8s pool list cluster-id=11111111-1111-1111-111111111111`,
},
{
Short: "List all scaling pools for a given cluster",
Raw: `scw k8s pool list 11111111-1111-1111-111111111111 status=scaling`,
Raw: `scw k8s pool list cluster-id=11111111-1111-1111-111111111111 status=scaling`,
},
{
Short: "List all pools for a given cluster that contain the word foo in the pool name",
Raw: `scw k8s pool list 11111111-1111-1111-111111111111 name=foo`,
Raw: `scw k8s pool list cluster-id=11111111-1111-1111-111111111111 name=foo`,
},
{
Short: "List all pools for a given cluster and order them by ascending creation date",
Raw: `scw k8s pool list 11111111-1111-1111-111111111111 order-by=created_at_asc`,
Raw: `scw k8s pool list cluster-id=11111111-1111-1111-111111111111 order-by=created_at_asc`,
},
},
View: &core.View{Fields: []*core.ViewField{
Expand Down Expand Up @@ -1312,15 +1312,15 @@ func k8sPoolCreate() *core.Command {
Examples: []*core.Example{
{
Short: "Create a pool named bar with 2 DEV1-XL on a given cluster",
Raw: `scw k8s pool create 11111111-1111-1111-111111111111 name=bar node-type=DEV1-XL size=2`,
Raw: `scw k8s pool create cluster-id=11111111-1111-1111-111111111111 name=bar node-type=DEV1-XL size=2`,
},
{
Short: "Create a pool named fish with 5 GP1-L with autoscaling enabled within 0 and 10 nodes, autohealing enabled, and containerd as the container runtime on a given cluster",
Raw: `scw k8s pool create 11111111-1111-1111-111111111111 name=fish node-type=GP1-L size=5 min-size=0 max-size=10 autoscaling=true autohealing=true container-runtime=containerd`,
Raw: `scw k8s pool create cluster-id=11111111-1111-1111-111111111111 name=fish node-type=GP1-L size=5 min-size=0 max-size=10 autoscaling=true autohealing=true container-runtime=containerd`,
},
{
Short: "Create a tagged pool named turtle with 1 GP1-S which is using the already created placement group 2222222222222-2222-222222222222 for all the nodes in the pool on a given cluster",
Raw: `scw k8s pool create 11111111-1111-1111-111111111111 name=turtle node-type=GP1-S size=1 placement-group-id=2222222222222-2222-222222222222 tags.0=turtle tags.1=placement-group`,
Raw: `scw k8s pool create cluster-id=11111111-1111-1111-111111111111 name=turtle node-type=GP1-S size=1 placement-group-id=2222222222222-2222-222222222222 tags.0=turtle tags.1=placement-group`,
},
},
}
Expand Down