Skip to content

Commit 48fa817

Browse files
authored
feat(rdb): add support for read-replicas (#2434)
1 parent c49c798 commit 48fa817

23 files changed

+468
-21
lines changed

cmd/scw/testdata/test-all-usage-instance-volume-create-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ARGS:
2020
[project-id] Project ID to use. If none is passed the default project ID will be used
2121
[tags.{index}] The volume tags
2222
[volume-type] The volume type (l_ssd | b_ssd | unified)
23-
[size] The volume disk size
23+
[size] The volume disk size, must be a multiple of 512
2424
[base-volume] The ID of the volume on which this volume will be based
2525
[base-snapshot] The ID of the snapshot on which this volume will be based
2626
[organization-id] Organization ID to use. If none is passed the default organization ID will be used

cmd/scw/testdata/test-all-usage-instance-volume-update-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ ARGS:
1919
volume-id UUID of the volume
2020
[name] The volume name
2121
[tags.{index}] The tags of the volume
22-
[size] The volume disk size
22+
[size] The volume disk size, must be a multiple of 512
2323
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | fr-par-3 | nl-ams-1 | nl-ams-2 | pl-waw-1)
2424

2525
FLAGS:

cmd/scw/testdata/test-all-usage-k8s-node-delete-usage.golden

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,22 @@
33
This method allows to delete a specific node. Note that when there is not enough space to reschedule all the pods (in a one node cluster for instance), you may experience some disruption of your applications.
44

55
USAGE:
6-
scw k8s node delete [arg=value ...]
6+
scw k8s node delete <node-id ...> [arg=value ...]
77

88
EXAMPLES:
99
Delete a given node
1010
scw k8s node delete 11111111-1111-1111-111111111111
1111

12+
Delete a given node without evicting workloads
13+
scw k8s node delete 11111111-1111-1111-111111111111 skip-drain=true
14+
15+
Replace a given node by a new one
16+
scw k8s node delete 11111111-1111-1111-111111111111 replace=true
17+
1218
ARGS:
13-
node-id
19+
node-id The ID of the node to replace
20+
[skip-drain] Skip draining node from its workload
21+
[replace] Add a new node after the deletion of this node
1422
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
1523

1624
FLAGS:

cmd/scw/testdata/test-all-usage-k8s-node-list-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ARGS:
2020
[pool-id] The pool ID on which to filter the returned nodes
2121
[order-by] The sort order of the returned nodes (created_at_asc | created_at_desc)
2222
[name] The name on which to filter the returned nodes
23-
[status] The status on which to filter the returned nodes (unknown | creating | not_ready | ready | deleting | deleted | locked | rebooting | creation_error | upgrading | starting)
23+
[status] The status on which to filter the returned nodes (unknown | creating | not_ready | ready | deleting | deleted | locked | rebooting | creation_error | upgrading | starting | registering)
2424
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
2525

2626
FLAGS:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Create a new endpoint for a given read replica.
4+
5+
USAGE:
6+
scw rdb read-replica create-endpoint <read-replica-id ...> [arg=value ...]
7+
8+
ARGS:
9+
read-replica-id UUID of the read replica
10+
[endpoint-spec.{index}.private-network.private-network-id] UUID of the private network to be connected to the read replica
11+
[endpoint-spec.{index}.private-network.service-ip] Endpoint IPv4 adress with a CIDR notation. Check documentation about IP and subnet limitations.
12+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
13+
14+
FLAGS:
15+
-h, --help help for create-endpoint
16+
17+
GLOBAL FLAGS:
18+
-c, --config string The path to the config file
19+
-D, --debug Enable debug mode
20+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
21+
-p, --profile string The config profile to use
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Create a read replica.
4+
5+
USAGE:
6+
scw rdb read-replica create <instance-id ...> [arg=value ...]
7+
8+
ARGS:
9+
instance-id UUID of the instance you want a read replica of
10+
[endpoint-spec.{index}.private-network.private-network-id] UUID of the private network to be connected to the read replica
11+
[endpoint-spec.{index}.private-network.service-ip] Endpoint IPv4 adress with a CIDR notation. Check documentation about IP and subnet limitations.
12+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)
13+
14+
FLAGS:
15+
-h, --help help for create
16+
17+
GLOBAL FLAGS:
18+
-c, --config string The path to the config file
19+
-D, --debug Enable debug mode
20+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
21+
-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 a read replica.
4+
5+
USAGE:
6+
scw rdb read-replica delete <read-replica-id ...> [arg=value ...]
7+
8+
ARGS:
9+
read-replica-id UUID of the read replica
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+
Get a read replica.
4+
5+
USAGE:
6+
scw rdb read-replica get <read-replica-id ...> [arg=value ...]
7+
8+
ARGS:
9+
read-replica-id UUID of the read replica
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 get
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+
Reset a read replica.
4+
5+
USAGE:
6+
scw rdb read-replica reset <read-replica-id ...> [arg=value ...]
7+
8+
ARGS:
9+
read-replica-id UUID of the read replica
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 reset
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

cmd/scw/testdata/test-all-usage-rdb-read-replica-usage.golden

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
A read replica is a live copy of the main database instance only available for reading. Read replica allows you to scale your database instance for read-heavy database workloads. Read replicas can also be used for Business Intelligence workloads.
44

55
USAGE:
6-
scw rdb read-replica
6+
scw rdb read-replica <command>
7+
8+
AVAILABLE COMMANDS:
9+
create Create a read replica
10+
create-endpoint Create a new endpoint for a given read replica
11+
delete Delete a read replica
12+
get Get a read replica
13+
reset Reset a read replica
714

815
FLAGS:
916
-h, --help help for read-replica
@@ -13,3 +20,5 @@ GLOBAL FLAGS:
1320
-D, --debug Enable debug mode
1421
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
1522
-p, --profile string The config profile to use
23+
24+
Use "scw rdb read-replica [command] --help" for more information about a command.

0 commit comments

Comments
 (0)