Skip to content
Open
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
1 change: 1 addition & 0 deletions docs/reference/cli/kubectl-dba.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ kubectl-dba [flags]
* [kubectl-dba completion](/docs/reference/cli/kubectl-dba_completion.md) - Generate completion script
* [kubectl-dba connect](/docs/reference/cli/kubectl-dba_connect.md) - Connect to a database.
* [kubectl-dba data](/docs/reference/cli/kubectl-dba_data.md) - Insert, Drop or Verify data in a database
* [kubectl-dba dc-dr](/docs/reference/cli/kubectl-dba_dc-dr.md) - Cross data center DR operations: switchover, failover, pins, and diagnosis
* [kubectl-dba debug](/docs/reference/cli/kubectl-dba_debug.md) - Debug any Database issue
* [kubectl-dba describe](/docs/reference/cli/kubectl-dba_describe.md) - Show details of a specific resource or group of resources
* [kubectl-dba exec](/docs/reference/cli/kubectl-dba_exec.md) - Execute script or command to a database.
Expand Down
68 changes: 68 additions & 0 deletions docs/reference/cli/kubectl-dba_dc-dr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
title: Kubectl-Dba Dc-Dr
menu:
docs_{{ .version }}:
identifier: kubectl-dba-dc-dr
name: Kubectl-Dba Dc-Dr
parent: reference-cli
menu_name: docs_{{ .version }}
section_menu_id: reference
---
## kubectl-dba dc-dr

Cross data center DR operations: switchover, failover, pins, and diagnosis

### Synopsis

Operate a KubeDB database that is distributed across data centers: trigger and monitor planned switchovers, accept a held failover's data loss, move the failover authority, pin a data center, and diagnose a failover that is not happening.

```
kubectl-dba dc-dr
```

### Options

```
-h, --help help for dc-dr
```

### Options inherited from parent commands

```
--as string Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--as-uid string UID to impersonate for the operation.
--cache-dir string Default cache directory (default "/home/runner/.kube/cache")
--certificate-authority string Path to a cert file for the certificate authority
--client-certificate string Path to a client certificate file for TLS
--client-key string Path to a client key file for TLS
--cluster string The name of the kubeconfig cluster to use
--context string The name of the kubeconfig context to use
--default-seccomp-profile-type string Default seccomp profile
--disable-compression If true, opt-out of response compression for all requests to the server
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
--match-server-version Require server version to match client version
-n, --namespace string If present, the namespace scope for this CLI request
--password string Password for basic authentication to the API server
--request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
-s, --server string The address and port of the Kubernetes API server
--tls-server-name string Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
--token string Bearer token for authentication to the API server
--user string The name of the kubeconfig user to use
--username string Username for basic authentication to the API server
```

### SEE ALSO

* [kubectl-dba](/docs/reference/cli/kubectl-dba.md) - kubectl plugin for KubeDB
* [kubectl-dba dc-dr abort](/docs/reference/cli/kubectl-dba_dc-dr_abort.md) - Abort an in-flight planned switchover and restore writes to the current active DC
* [kubectl-dba dc-dr accept-data-loss](/docs/reference/cli/kubectl-dba_dc-dr_accept-data-loss.md) - Release a failover held by the RPO budget, explicitly accepting the data loss
* [kubectl-dba dc-dr active-dc](/docs/reference/cli/kubectl-dba_dc-dr_active-dc.md) - Print the data center that currently holds the primary role
* [kubectl-dba dc-dr debug](/docs/reference/cli/kubectl-dba_dc-dr_debug.md) - Diagnose DC-DR symptoms: failover not happening, switchover stuck, fenced database
* [kubectl-dba dc-dr handoff](/docs/reference/cli/kubectl-dba_dc-dr_handoff.md) - Move the failover authority for a scope by handing off its primary-DC Lease
* [kubectl-dba dc-dr pin-primary](/docs/reference/cli/kubectl-dba_dc-dr_pin-primary.md) - Pin this data center as primary (break-glass override): no failover, writable through a control-plane outage
* [kubectl-dba dc-dr pin-standby](/docs/reference/cli/kubectl-dba_dc-dr_pin-standby.md) - Pin this data center as a standby (standby-hold): it never promotes
* [kubectl-dba dc-dr status](/docs/reference/cli/kubectl-dba_dc-dr_status.md) - Show DC-DR state and switchover progress once (re-run to see further progress)
* [kubectl-dba dc-dr switchover](/docs/reference/cli/kubectl-dba_dc-dr_switchover.md) - Trigger a planned zero-RPO switchover of a distributed database to another data center

69 changes: 69 additions & 0 deletions docs/reference/cli/kubectl-dba_dc-dr_abort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: Kubectl-Dba Dc-Dr Abort
menu:
docs_{{ .version }}:
identifier: kubectl-dba-dc-dr-abort
name: Kubectl-Dba Dc-Dr Abort
parent: reference-cli
menu_name: docs_{{ .version }}
section_menu_id: reference
---
## kubectl-dba dc-dr abort

Abort an in-flight planned switchover and restore writes to the current active DC

### Synopsis

Sets the dr.kubedb.com/switchover-abort annotation. Its PRESENCE aborts: the hub clears the quiesce so the original active data center resumes accepting writes, and removes every switchover annotation once done.

Do NOT abort by deleting the switchover-to annotation: in a scope shared by several databases the hub re-propagates it to every sibling each pass, so a bare removal silently reappears. This explicit abort signal is propagated and honored scope-wide. A switchover that cannot complete also auto-aborts on its own after the switchover timeout (default 10m, dr.kubedb.com/switchover-timeout to override).

KUBECONFIG: the hub cluster.

```
kubectl-dba dc-dr abort DB_NAME [flags]
```

### Examples

```
kubectl dba dc-dr abort pg-dcdr -n demo
```

### Options

```
-h, --help help for abort
```

### Options inherited from parent commands

```
--as string Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--as-uid string UID to impersonate for the operation.
--cache-dir string Default cache directory (default "/home/runner/.kube/cache")
--certificate-authority string Path to a cert file for the certificate authority
--client-certificate string Path to a client certificate file for TLS
--client-key string Path to a client key file for TLS
--cluster string The name of the kubeconfig cluster to use
--context string The name of the kubeconfig context to use
--default-seccomp-profile-type string Default seccomp profile
--disable-compression If true, opt-out of response compression for all requests to the server
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
--match-server-version Require server version to match client version
-n, --namespace string If present, the namespace scope for this CLI request
--password string Password for basic authentication to the API server
--request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
-s, --server string The address and port of the Kubernetes API server
--tls-server-name string Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
--token string Bearer token for authentication to the API server
--user string The name of the kubeconfig user to use
--username string Username for basic authentication to the API server
```

### SEE ALSO

* [kubectl-dba dc-dr](/docs/reference/cli/kubectl-dba_dc-dr.md) - Cross data center DR operations: switchover, failover, pins, and diagnosis

74 changes: 74 additions & 0 deletions docs/reference/cli/kubectl-dba_dc-dr_accept-data-loss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: Kubectl-Dba Dc-Dr Accept-Data-Loss
menu:
docs_{{ .version }}:
identifier: kubectl-dba-dc-dr-accept-data-loss
name: Kubectl-Dba Dc-Dr Accept-Data-Loss
parent: reference-cli
menu_name: docs_{{ .version }}
section_menu_id: reference
---
## kubectl-dba dc-dr accept-data-loss

Release a failover held by the RPO budget, explicitly accepting the data loss

### Synopsis

When the surviving data center lags more than spec.replication.bestEffortCrossDCLagBytesForFailover (or its lag cannot be measured), the promotion is HELD: the un-replicated WAL of the lost data center is unrecoverable, so choosing between an outage and a loss larger than the budget belongs to a human. This command records that decision by setting dr.kubedb.com/accept-failover-data-loss=true; both promotion paths (the hub gate and the coordinator's data-plane gate) honor it within seconds, and the operator removes the annotation automatically once the failover it authorized lands, so it cannot linger and approve a later, unrelated loss.

Where the hold is visible before you decide: status.disasterRecovery.protectionMessage (the measured lag), condition DCDRPromotionStalled, and dc-dr status.

KUBECONFIG: the hub cluster.

```
kubectl-dba dc-dr accept-data-loss DB_NAME --yes [flags]
```

### Examples

```
# See what would be lost first
kubectl dba dc-dr status pg-dcdr -n demo

# Accept it
kubectl dba dc-dr accept-data-loss pg-dcdr -n demo --yes
```

### Options

```
-h, --help help for accept-data-loss
--yes Confirm accepting data loss beyond the configured RPO budget
```

### Options inherited from parent commands

```
--as string Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--as-uid string UID to impersonate for the operation.
--cache-dir string Default cache directory (default "/home/runner/.kube/cache")
--certificate-authority string Path to a cert file for the certificate authority
--client-certificate string Path to a client certificate file for TLS
--client-key string Path to a client key file for TLS
--cluster string The name of the kubeconfig cluster to use
--context string The name of the kubeconfig context to use
--default-seccomp-profile-type string Default seccomp profile
--disable-compression If true, opt-out of response compression for all requests to the server
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
--match-server-version Require server version to match client version
-n, --namespace string If present, the namespace scope for this CLI request
--password string Password for basic authentication to the API server
--request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
-s, --server string The address and port of the Kubernetes API server
--tls-server-name string Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
--token string Bearer token for authentication to the API server
--user string The name of the kubeconfig user to use
--username string Username for basic authentication to the API server
```

### SEE ALSO

* [kubectl-dba dc-dr](/docs/reference/cli/kubectl-dba_dc-dr.md) - Cross data center DR operations: switchover, failover, pins, and diagnosis

82 changes: 82 additions & 0 deletions docs/reference/cli/kubectl-dba_dc-dr_active-dc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
title: Kubectl-Dba Dc-Dr Active-Dc
menu:
docs_{{ .version }}:
identifier: kubectl-dba-dc-dr-active-dc
name: Kubectl-Dba Dc-Dr Active-Dc
parent: reference-cli
menu_name: docs_{{ .version }}
section_menu_id: reference
---
## kubectl-dba dc-dr active-dc

Print the data center that currently holds the primary role

### Synopsis

Reads the primary-DC Lease from the coordination control plane, the authority for which data center is active.

Given a database name, its failover scope is resolved first (the PlacementPolicy's failoverPolicy trigger, exactly as the operator resolves it) and the matching Lease is read. Given --lease, that Lease is read directly, which also works for a scope whose database is gone.

KUBECONFIG: the hub cluster (to read the Postgres and its PlacementPolicy, and by default to read the coordination kubeconfig Secret). The coordination plane itself is reached with the --coord-* flags.

```
kubectl-dba dc-dr active-dc [DB_NAME] [--lease NAME] [flags]
```

### Examples

```
# By database
kubectl dba dc-dr active-dc pg-dcdr -n demo

# By Lease name, with an explicit coordination kubeconfig file
kubectl dba dc-dr active-dc --lease primary-dc --coord-kubeconfig /tmp/coord.yaml

# Scriptable: just the DC name
kubectl dba dc-dr active-dc pg-dcdr -n demo -q
```

### Options

```
--coord-kubeconfig string Path to a kubeconfig file for the coordination control plane (overrides the secret/configmap sources)
--coord-kubeconfig-configmap string ConfigMap ([namespace/]name, key "kubeconfig") on the current cluster holding the coordination-plane kubeconfig
--coord-kubeconfig-secret string Secret ([namespace/]name, key "kubeconfig") on the current cluster holding the coordination-plane kubeconfig (default "dc-failover/coord-kubeconfig")
--coord-namespace string Namespace on the coordination plane that holds the primary-DC Leases (default "dc-failover")
-h, --help help for active-dc
--lease string Read this Lease directly instead of resolving a database's scope
-q, --quiet Print only the active DC name
```

### Options inherited from parent commands

```
--as string Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--as-uid string UID to impersonate for the operation.
--cache-dir string Default cache directory (default "/home/runner/.kube/cache")
--certificate-authority string Path to a cert file for the certificate authority
--client-certificate string Path to a client certificate file for TLS
--client-key string Path to a client key file for TLS
--cluster string The name of the kubeconfig cluster to use
--context string The name of the kubeconfig context to use
--default-seccomp-profile-type string Default seccomp profile
--disable-compression If true, opt-out of response compression for all requests to the server
--insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
--kubeconfig string Path to the kubeconfig file to use for CLI requests.
--match-server-version Require server version to match client version
-n, --namespace string If present, the namespace scope for this CLI request
--password string Password for basic authentication to the API server
--request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
-s, --server string The address and port of the Kubernetes API server
--tls-server-name string Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
--token string Bearer token for authentication to the API server
--user string The name of the kubeconfig user to use
--username string Username for basic authentication to the API server
```

### SEE ALSO

* [kubectl-dba dc-dr](/docs/reference/cli/kubectl-dba_dc-dr.md) - Cross data center DR operations: switchover, failover, pins, and diagnosis

Loading
Loading