@@ -5,7 +5,7 @@ draft: false
55weight : 20
66---
77
8- While the full [ ` pgo ` client reference] ( /pgo-cli /reference/ ) will tell you
8+ While the full [ ` pgo ` client reference] ( /pgo-client /reference/ ) will tell you
99everything you need to know about how to use ` pgo ` , it may be helpful to see
1010several examples on how to conduct "day-in-the-life" tasks for administrating
1111PostgreSQL cluster with the PostgreSQL Operator.
@@ -24,7 +24,7 @@ onerous for the intents of this guide.
2424If you install the PostgreSQL Operator using the [ quickstart] ( /quickstart/ )
2525guide, you will have two namespaces installed: ` pgouser1 ` and ` pgouser2 ` . We
2626can choose to always use one of these namespaces by setting the ` PGO_NAMESPACE `
27- environmental variable, which is detailed in the global [ ` pgo ` Client] ( /pgo-cli / )
27+ environmental variable, which is detailed in the global [ ` pgo ` Client] ( /pgo-client / )
2828reference,
2929
3030For convenience, we will use the ` pgouser1 ` namespace in the examples below.
@@ -74,7 +74,7 @@ environment.
7474### Checking Connectivity to the PostgreSQL Operator
7575
7676A common task when working with the PostgreSQL Operator is to check connectivity
77- to the PostgreSQL Operator. This can be accomplish with the [ ` pgo version ` ] ( /pgo-cli /reference/pgo_version/ )
77+ to the PostgreSQL Operator. This can be accomplish with the [ ` pgo version ` ] ( /pgo-client /reference/pgo_version/ )
7878command:
7979
8080``` shell
@@ -90,7 +90,7 @@ pgo-apiserver version 4.2.0
9090
9191### Inspecting the PostgreSQL Operator Configuration
9292
93- The [ ` pgo show config ` ] ( /pgo-cli /reference/pgo_status/ ) command allows you to
93+ The [ ` pgo show config ` ] ( /pgo-client /reference/pgo_status/ ) command allows you to
9494view the current configuration that the PostgreSQL Operator is using. This can
9595be helpful for troubleshooting issues such as which PostgreSQL images are being
9696deployed by default, which storage classes are being used, etc.
@@ -177,7 +177,7 @@ DefaultPgbouncerResources: ""
177177
178178### Viewing PostgreSQL Operator Key Metrics
179179
180- The [` pgo status`](/pgo-cli /reference/pgo_status/) command provides a
180+ The [` pgo status`](/pgo-client /reference/pgo_status/) command provides a
181181generalized statistical view of the overall resource consumption of the
182182PostgreSQL Operator. These stats include :
183183
@@ -248,7 +248,7 @@ know which namespaces the PostgreSQL Operator can use for deploying PostgreSQL
248248clusters.
249249
250250You can view which namespaces the PostgreSQL Operator can utilize by using
251- the [`pgo show namespace`](/pgo-cli /reference/pgo_show_namespace/) command. To
251+ the [`pgo show namespace`](/pgo-client /reference/pgo_show_namespace/) command. To
252252list out the namespaces that the PostgreSQL Operator has access to, you can run
253253the following command :
254254
@@ -281,7 +281,7 @@ described in the [general notes](#general-notes) on this page.
281281
282282# ## Creating a PostgreSQL Cluster
283283
284- You can create a cluster using the [`pgo create cluster`](/pgo-cli /reference/pgo_create_cluster/)
284+ You can create a cluster using the [`pgo create cluster`](/pgo-client /reference/pgo_create_cluster/)
285285command :
286286
287287` ` ` shell
@@ -309,7 +309,7 @@ pgo create cluster hagiscluster --ccp-image=crunchy-postgres-gis-ha
309309A new PostgreSQL cluster can take a few moments to provision. You may have
310310noticed that the `pgo create cluster` command returns something called a
311311" workflow id" . This workflow ID allows you to track the progress of your new
312- PostgreSQL cluster while it is being provisioned using the [`pgo show workflow`](/pgo-cli /reference/pgo_show_workflow/)
312+ PostgreSQL cluster while it is being provisioned using the [`pgo show workflow`](/pgo-client /reference/pgo_show_workflow/)
313313command :
314314
315315` ` ` shell
@@ -329,7 +329,7 @@ workflowid ae714d12-f5d0-4fa9-910f-21944b41dec8
329329
330330# ## View PostgreSQL Cluster Details
331331
332- To see details about your PostgreSQL cluster, you can use the [`pgo show cluster`](/pgo-cli /reference/pgo_show_cluster/)
332+ To see details about your PostgreSQL cluster, you can use the [`pgo show cluster`](/pgo-client /reference/pgo_show_cluster/)
333333command. These details include elements such as :
334334
335335- The version of PostgreSQL that the cluster is using
@@ -403,7 +403,7 @@ pgo delete cluster hacluster --keep-backups
403403
404404# # Testing PostgreSQL Cluster Availability
405405
406- You can test the availability of your cluster by using the [`pgo test`](/pgo-cli /reference/pgo_test/)
406+ You can test the availability of your cluster by using the [`pgo test`](/pgo-client /reference/pgo_test/)
407407command. The `pgo test` command checks to see if the Kubernetes Services and
408408the Pods that comprise the PostgreSQL cluster are available to receive
409409connections. This includes :
@@ -593,7 +593,7 @@ pgo restore hacluster --node-label=failure-domain.beta.kubernetes.io/zone=us-cen
593593
594594There are very few reasons why you will want to execute a full restore. If you
595595want to make a copy of your PostgreSQL cluster, please use
596- [`pgo clone`](/pgo-cli /reference/pgo_clone).
596+ [`pgo clone`](/pgo-client /reference/pgo_clone).
597597
598598# ### Point-in-time-Recovery (PITR)
599599
@@ -762,7 +762,7 @@ destroy.
762762# # Clone a PostgreSQL Cluster
763763
764764You can create a copy of an existing PostgreSQL cluster in a new PostgreSQL
765- cluster by using the [`pgo clone`](/pgo-cli /reference/pgo_clone/) command. To
765+ cluster by using the [`pgo clone`](/pgo-client /reference/pgo_clone/) command. To
766766create a new copy of a PostgreSQL cluster, you can execute the following
767767command :
768768
@@ -781,32 +781,39 @@ volume claim size by entering the following:
781781pgo df hacluster -n pgouser1
782782` ` `
783783
784- # ## Label Operations
784+ # # Labels
785785
786- # ### Apply a Label to a Cluster
786+ Labels are a helpful way to organize PostgreSQL clusters, such as by application
787+ type or environment. The PostgreSQL Operator supports managing Kubernetes Labels
788+ as a convenient way to group PostgreSQL clusters together.
787789
788- You can apply a Kubernetes label to a Postgres cluster as follows :
790+ You can view which labels are assigned to a PostgreSQL cluster using the
791+ [`pgo show cluster`](/pgo-client/reference/pgo_show_cluster/) command. You are also
792+ able to see these labels when using `kubectl` or `oc`.
789793
790- pgo label hacluster --label=environment=prod -n pgouser1
794+ # ## Add a Label to a PostgreSQL Cluster
791795
792- In this example, the label key is *environment* and the label
793- value is *prod*.
796+ Labels can be added to PostgreSQL clusters using the [`pgo label`](/pgo-client/reference/pgo_label/)
797+ command. For example, to add a label with a key/value pair of `env=production`,
798+ you could execute the following command :
794799
795- You can apply labels across a category of Postgres clusters by
796- using the *--selector* command flag as follows :
797-
798- pgo label --selector=clustertypes=research --label=environment=prod -n pgouser1
800+ ` ` ` shell
801+ pgo label hacluster --label=env=production
802+ ` ` `
799803
800- In this example, any Postgres cluster with the label of *clustertypes=research*
801- will have the label *environment=prod* set.
804+ # ## Add a Label to Multiple PostgreSQL Clusters
802805
803- In the following command, you can also view Postgres clusters by
804- using the *--selector* command flag which specifies a label key value
805- to search with :
806+ You can add also add a label to multiple PostgreSQL clusters simultaneously
807+ using the `--selector` flag on the `pgo label` command. For example, to add a
808+ label with a key/value pair of `env=production` to clusters that have a label
809+ key/value pair of `app=payment`, you could execute the following command :
806810
807- pgo show cluster --selector=environment=prod -n pgouser1
811+ ` ` ` shell
812+ pgo label --selector=app=payment --label=env=production
813+ ` ` `
808814
809815# # Policy Management
816+
810817# ## Create a Policy
811818
812819To create a SQL policy, enter the following :
0 commit comments