|
83 | 83 | - -c |
84 | 84 | - | |
85 | 85 | UPDATE customers |
86 | | - SET email = 'user' || id || '@example.invalid', |
| 86 | + SET full_name = 'Masked Customer', |
| 87 | + email = 'user' || id || '@example.invalid', |
87 | 88 | phone = '+1-555-0000'; |
88 | 89 | resources: |
89 | 90 | requests: |
@@ -146,11 +147,11 @@ The branch's data is anonymized: |
146 | 147 | ```bash |
147 | 148 | $ kubectl exec -it -n demo dev-postgres-masked-0 -c postgres -- psql -U postgres \ |
148 | 149 | -c "SELECT id, full_name, email, phone FROM customers ORDER BY id LIMIT 3;" |
149 | | - id | full_name | email | phone |
150 | | -----+------------+-----------------------+------------- |
151 | | - 1 | Customer 1 | user1@example.invalid | +1-555-0000 |
152 | | - 2 | Customer 2 | user2@example.invalid | +1-555-0000 |
153 | | - 3 | Customer 3 | user3@example.invalid | +1-555-0000 |
| 150 | + id | full_name | email | phone |
| 151 | +----+-----------------+-----------------------+------------- |
| 152 | + 1 | Masked Customer | user1@example.invalid | +1-555-0000 |
| 153 | + 2 | Masked Customer | user2@example.invalid | +1-555-0000 |
| 154 | + 3 | Masked Customer | user3@example.invalid | +1-555-0000 |
154 | 155 | (3 rows) |
155 | 156 | ``` |
156 | 157 |
|
@@ -231,6 +232,9 @@ Create it and wait for the first copy: |
231 | 232 | $ kubectl apply -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/guides/postgres/branch/customization/examples/dev-branch-refresh.yaml |
232 | 233 | branch.courier.kubedb.com/dev-branch-refresh created |
233 | 234 |
|
| 235 | +$ kubectl wait --for=condition=Ready branch/dev-branch-refresh -n demo --timeout=10m |
| 236 | +branch.courier.kubedb.com/dev-branch-refresh condition met |
| 237 | +
|
234 | 238 | $ kubectl exec -n demo dev-postgres-refresh-0 -c postgres -- psql -U postgres -tAc "SELECT count(*) FROM customers;" |
235 | 239 | 1001 |
236 | 240 | ``` |
@@ -346,6 +350,9 @@ namespace/dev created |
346 | 350 | $ kubectl apply -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/guides/postgres/branch/customization/examples/dev-branch-xns.yaml |
347 | 351 | branch.courier.kubedb.com/dev-branch-xns created |
348 | 352 |
|
| 353 | +$ kubectl wait --for=condition=Ready branch/dev-branch-xns -n demo --timeout=10m |
| 354 | +branch.courier.kubedb.com/dev-branch-xns condition met |
| 355 | +
|
349 | 356 | $ kubectl get branch -n demo dev-branch-xns |
350 | 357 | NAME PHASE MODE TARGET FRESHNESS AGE |
351 | 358 | dev-branch-xns Ready Local dev-postgres-xns 1s 61s |
@@ -381,9 +388,15 @@ Deploy a 3-replica source and branch it exactly as before: |
381 | 388 | $ kubectl apply -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/guides/postgres/branch/customization/examples/sample-postgres-ha.yaml |
382 | 389 | postgres.kubedb.com/sample-postgres-ha created |
383 | 390 |
|
| 391 | +$ kubectl wait --for=condition=Ready pg/sample-postgres-ha -n demo --timeout=10m |
| 392 | +postgres.kubedb.com/sample-postgres-ha condition met |
| 393 | +
|
384 | 394 | $ kubectl apply -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/guides/postgres/branch/customization/examples/dev-branch-ha.yaml |
385 | 395 | branch.courier.kubedb.com/dev-branch-ha created |
386 | 396 |
|
| 397 | +$ kubectl wait --for=condition=Ready branch/dev-branch-ha -n demo --timeout=10m |
| 398 | +branch.courier.kubedb.com/dev-branch-ha condition met |
| 399 | +
|
387 | 400 | $ kubectl get branch -n demo dev-branch-ha |
388 | 401 | NAME PHASE MODE TARGET FRESHNESS AGE |
389 | 402 | dev-branch-ha Ready Local dev-postgres-ha 1s 81s |
@@ -489,6 +502,9 @@ spec: |
489 | 502 | ```bash |
490 | 503 | $ kubectl apply -f https://github.com/kubedb/docs/raw/{{< param "info.version" >}}/docs/guides/postgres/branch/customization/examples/dev-branch-vsc.yaml |
491 | 504 | branch.courier.kubedb.com/dev-branch-vsc created |
| 505 | +
|
| 506 | +$ kubectl wait --for=condition=Ready branch/dev-branch-vsc -n demo --timeout=10m |
| 507 | +branch.courier.kubedb.com/dev-branch-vsc condition met |
492 | 508 | ``` |
493 | 509 |
|
494 | 510 | Only the pinned branch uses that class; every other branch created in this guide left the field unset and took the driver's default, `topolvm-provisioner-thin`: |
@@ -521,8 +537,10 @@ For problems with the core branch flow — snapshotting, cloning, provisioning |
521 | 537 |
|
522 | 538 | ## Cleaning up |
523 | 539 |
|
| 540 | +This page created five branches alongside the source in `demo`, plus one extra database and one extra namespace. Delete each branch by name rather than `--all`, so an unrelated branch left over from another walkthrough in the same `demo` namespace is not swept up. `kubectl delete` on a `Branch` blocks until Courier's cleanup finalizer clears, so there is nothing further to wait for: |
| 541 | + |
524 | 542 | ```bash |
525 | | -$ kubectl delete branch -n demo --all |
| 543 | +$ kubectl delete branch -n demo dev-branch-masked dev-branch-refresh dev-branch-xns dev-branch-ha dev-branch-vsc |
526 | 544 | $ kubectl delete pg -n demo sample-postgres-ha |
527 | 545 | $ kubectl delete ns dev |
528 | 546 | ``` |
|
0 commit comments