Skip to content

Commit e2d9751

Browse files
author
Jonathan S. Katz
committed
Use Services in the examples of port-forwarding
The Service name stays consistent, whereas Pod names change, so this provides an easier example for working with the PostgreSQL Operator.
1 parent 34a8ecd commit e2d9751

File tree

5 files changed

+58
-47
lines changed

5 files changed

+58
-47
lines changed

docs/content/Installation/install-pgo-client/_index.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The following will setup the `pgo` client to be used on a Linux or MacOS system.
3333
### Installing the Client
3434

3535
First, download the `pgo` client from the
36-
[GitHub official releases](https://github.com/CrunchyData/postgres-operator/releases). Crunchy Enterprise Customers can download the pgo binaries from https://access.crunchydata.com/ on the downloads page.
36+
[GitHub official releases](https://github.com/CrunchyData/postgres-operator/releases). Crunchy Enterprise Customers can download the pgo binaries from https://access.crunchydata.com/ on the downloads page.
3737

3838
Next, install `pgo` in `/usr/local/bin` by running the following:
3939

@@ -115,13 +115,17 @@ ensure connection can be made outside of the cluster:
115115

116116
```bash
117117
# If deployed to Kubernetes
118-
kubectl port-forward <OPERATOR_POD_NAME> -n <OPERATOR_NAMESPACE> 8443:8443
118+
kubectl port-forward -n pgo svc/postgres-operator 8443:8443
119119

120120
# If deployed to OpenShift
121-
oc port-forward <OPERATOR_POD_NAME> -n <OPERATOR_NAMESPACE> 8443:8443
121+
oc port-forward -n pgo svc/postgres-operator 8443:8443
122122
```
123123

124-
**Note**: the port-forward will be required for the duration of `pgo` usage.
124+
In the above examples, you can substitute `pgo` for the namespace that you
125+
deployed the PostgreSQL Operator into.
126+
127+
**Note**: The port-forward will be required for the duration of using the
128+
PostgreSQL client.
125129

126130
Next, set the following environment variable to configure the API server address:
127131

@@ -141,18 +145,18 @@ source ${HOME?}/.bashrc
141145

142146
## PGO-Client Container
143147

144-
The following will setup the `pgo` client image in a Kubernetes or Openshift
148+
The following will setup the `pgo` client image in a Kubernetes or Openshift
145149
environment. The image must be installed using the Ansible installer.
146150

147151
### Installing the PGO-Client Container
148152
The pgo-client container can be installed with the Ansible installer by updating
149-
the `pgo_client_container_install` variable in the inventory file. Set this
150-
variable to true in the inventory file and run the ansible-playbook. As part of
153+
the `pgo_client_container_install` variable in the inventory file. Set this
154+
variable to true in the inventory file and run the ansible-playbook. As part of
151155
the install the `pgo.tls` and `pgouser-<username>` secrets are used to configure
152-
the `pgo` client.
156+
the `pgo` client.
153157

154158
### Using the PGO-Client Deployment
155-
Once the container has been installed you can access it by exec'ing into the
159+
Once the container has been installed you can access it by exec'ing into the
156160
pod. You can run single commands with the kubectl or oc command line tools
157161
or multiple commands by exec'ing into the pod with bash.
158162

@@ -255,13 +259,17 @@ ensure connection can be made outside of the cluster:
255259

256260
```bash
257261
# If deployed to Kubernetes
258-
kubectl port-forward <OPERATOR_POD_NAME> -n <OPERATOR_NAMESPACE> 8443:8443
262+
kubectl port-forward -n pgo svc/postgres-operator 8443:8443
259263

260264
# If deployed to OpenShift
261-
oc port-forward <OPERATOR_POD_NAME> -n <OPERATOR_NAMESPACE> 8443:8443
265+
oc port-forward -n pgo svc/postgres-operator 8443:8443
262266
```
263267

264-
**Note**: the port-forward will be required for the duration of `pgo` usage.
268+
In the above examples, you can substitute `pgo` for the namespace that you
269+
deployed the PostgreSQL Operator into.
270+
271+
**Note**: The port-forward will be required for the duration of using the
272+
PostgreSQL client.
265273

266274
Next, set the following environment variable to configure the API server address:
267275

docs/content/Installation/install-with-ansible/installing-metrics.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ weight: 22
77

88
# Installing
99

10-
PostgreSQL clusters created by the Crunchy PostgreSQL Operator can optionally be
11-
configured to serve performance metrics via Prometheus Exporters. The metric exporters
12-
included in the database pod serve realtime metrics for the database container. In
13-
order to store and view this data, Grafana and Prometheus are required. The Crunchy
14-
PostgreSQL Operator does not create this infrastructure, however, they can be installed
10+
PostgreSQL clusters created by the Crunchy PostgreSQL Operator can optionally be
11+
configured to serve performance metrics via Prometheus Exporters. The metric exporters
12+
included in the database pod serve realtime metrics for the database container. In
13+
order to store and view this data, Grafana and Prometheus are required. The Crunchy
14+
PostgreSQL Operator does not create this infrastructure, however, they can be installed
1515
using the provided Ansible roles.
1616

1717
## Prerequisites
1818

1919
The following assumes the proper [prerequisites are satisfied](/installation/install-with-ansible/prerequisites/)
2020
we can now install the PostgreSQL Operator.
2121

22-
At a minimum, the following inventory variables should be configured to install the
22+
At a minimum, the following inventory variables should be configured to install the
2323
metrics infrastructure:
2424

2525
| Name | Default | Description |
@@ -45,7 +45,7 @@ metrics infrastructure:
4545
| `prometheus_storage_class_name` | | Set to the name of the storage class used when creating Prometheus persistent volumes. |
4646

4747
{{% notice tip %}}
48-
Administrators can choose to install Grafana, Prometheus or both by configuring the
48+
Administrators can choose to install Grafana, Prometheus or both by configuring the
4949
`grafana_install` and `prometheus_install` variables in the inventory files.
5050
{{% /notice %}}
5151

@@ -60,7 +60,7 @@ For more information on storage classes see the [official Kubernetes documentati
6060

6161
## Installing on Linux
6262

63-
On a Linux host with Ansible installed we can run the following command to install
63+
On a Linux host with Ansible installed we can run the following command to install
6464
the Metrics stack:
6565

6666
```bash
@@ -79,7 +79,7 @@ ansible-playbook -i /path/to/inventory --tags=install-metrics --ask-become-pass
7979

8080
## Installing on MacOS
8181

82-
On a MacOS host with Ansible installed we can run the following command to install
82+
On a MacOS host with Ansible installed we can run the following command to install
8383
the Metrics stack:
8484

8585
```bash
@@ -88,7 +88,7 @@ ansible-playbook -i /path/to/inventory --tags=install-metrics main.yml
8888

8989
## Installing on Windows
9090

91-
On a Windows host with the Ubuntu subsystem we can run the following commands to install
91+
On a Windows host with the Ubuntu subsystem we can run the following commands to install
9292
the Metrics stack:
9393

9494
```bash
@@ -97,7 +97,7 @@ ansible-playbook -i /path/to/inventory --tags=install-metrics main.yml
9797

9898
## Verifying the Installation
9999

100-
This may take a few minutes to deploy. To check the status of the deployment run
100+
This may take a few minutes to deploy. To check the status of the deployment run
101101
the following:
102102

103103
```bash
@@ -112,15 +112,15 @@ oc get pods -n <NAMESPACE_NAME>
112112

113113
## Verify Grafana
114114

115-
In a separate terminal we need to setup a port forward to the Crunchy Grafana deployment
115+
In a separate terminal we need to setup a port forward to the Crunchy Grafana deployment
116116
to ensure connection can be made outside of the cluster:
117117

118118
```bash
119119
# If deployed to Kubernetes
120-
kubectl port-forward <GRAFANA_POD_NAME> -n <METRICS_NAMESPACE> 3000:3000
120+
kubectl port-forward -n <METRICS_NAMESPACE> svc/grafana 3000:3000
121121

122122
# If deployed to OpenShift
123-
oc port-forward <GRAFANA_POD_NAME> -n <METRICS_NAMESPACE> 3000:3000
123+
oc port-forward -n <METRICS_NAMESPACE> svc/grafana 3000:3000
124124
```
125125

126126
In a browser navigate to `http://127.0.0.1:3000` to access the Grafana dashboard.
@@ -136,21 +136,21 @@ pgo create cluster <NAME OF CLUSTER> --metrics --namespace=<NAMESPACE>
136136

137137
## Verify Prometheus
138138

139-
In a separate terminal we need to setup a port forward to the Crunchy Prometheus deployment
139+
In a separate terminal we need to setup a port forward to the Crunchy Prometheus deployment
140140
to ensure connection can be made outside of the cluster:
141141

142142
```bash
143143
# If deployed to Kubernetes
144-
kubectl port-forward <PROMETHEUS_POD_NAME> -n <METRICS_NAMESPACE> 9090:9090
144+
kubectl port-forward -n <METRICS_NAMESPACE> svc/prometheus 9090:9090
145145

146146
# If deployed to OpenShift
147-
oc port-forward <PROMETHEUS_POD_NAME> -n <METRICS_NAMESPACE> 9090:9090
147+
oc port-forward -n <METRICS_NAMESPACE> svc/prometheus 9090:9090
148148
```
149149

150150
In a browser navigate to `http://127.0.0.1:9090` to access the Prometheus dashboard.
151151

152152
{{% notice tip %}}
153-
No metrics will be scraped if no exporters are available. To create a PostgreSQL
153+
No metrics will be scraped if no exporters are available. To create a PostgreSQL
154154
cluster with metric exporters run the following command:
155155

156156
```bash

docs/content/Installation/install-with-ansible/installing-operator.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,16 @@ Operator to ensure connection can be made outside of the cluster:
105105

106106
```bash
107107
# If deployed to Kubernetes
108-
kubectl port-forward <OPERATOR_POD_NAME> -n <OPERATOR_NAMESPACE> 8443:8443
108+
kubectl port-forward -n pgo svc/postgres-operator 8443:8443
109109

110110
# If deployed to OpenShift
111-
oc port-forward <OPERATOR_POD_NAME> -n <OPERATOR_NAMESPACE> 8443:8443
111+
oc port-forward -n pgo svc/postgres-operator 8443:8443
112112
```
113113

114-
On a separate terminal verify the `pgo` can communicate with the Crunchy PostgreSQL
114+
You can subsitute `pgo` in the above examples with the namespace that you
115+
deployed the PostgreSQL Operator into.
116+
117+
On a separate terminal verify the PostgreSQL client can communicate with the Crunchy PostgreSQL
115118
Operator:
116119

117120
```bash

docs/content/Installation/install-with-ansible/updating-operator.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ weight: 30
77

88
# Updating
99

10-
Updating the Crunchy PostgreSQL Operator is essential to the lifecycle management
10+
Updating the Crunchy PostgreSQL Operator is essential to the lifecycle management
1111
of the service. Using the `update` flag will:
1212

1313
* Update and redeploy the operator deployment
@@ -19,8 +19,8 @@ of the service. Using the `update` flag will:
1919
The following assumes the proper [prerequisites are satisfied](/installation/install-with-ansible/prerequisites/)
2020
we can now update the PostgreSQL Operator.
2121

22-
The commands should be run in the directory where the Crunchy PostgreSQL Operator
23-
playbooks is stored. See the `ansible` directory in the Crunchy PostgreSQL Operator
22+
The commands should be run in the directory where the Crunchy PostgreSQL Operator
23+
playbooks is stored. See the `ansible` directory in the Crunchy PostgreSQL Operator
2424
project for the inventory file, main playbook and ansible roles.
2525

2626
## Updating on Linux
@@ -62,7 +62,7 @@ ansible-playbook -i /path/to/inventory --tags=update --ask-become-pass main.yml
6262

6363
## Verifying the Update
6464

65-
This may take a few minutes to deploy. To check the status of the deployment run
65+
This may take a few minutes to deploy. To check the status of the deployment run
6666
the following:
6767

6868
```bash
@@ -77,7 +77,7 @@ oc get pods -n <NAMESPACE_NAME>
7777

7878
## Configure Environment Variables
7979

80-
After the Crunchy PostgreSQL Operator has successfully been updated we will need
80+
After the Crunchy PostgreSQL Operator has successfully been updated we will need
8181
to configure local environment variables before using the `pgo` client.
8282

8383
To configure the environment variables used by `pgo` run the following command:
@@ -104,25 +104,25 @@ source ~/.bashrc
104104

105105
## Verify `pgo` Connection
106106

107-
In a separate terminal we need to setup a port forward to the Crunchy PostgreSQL
107+
In a separate terminal we need to setup a port forward to the Crunchy PostgreSQL
108108
Operator to ensure connection can be made outside of the cluster:
109109

110110
```bash
111111
# If deployed to Kubernetes
112-
kubectl port-forward <OPERATOR_POD_NAME> -n <OPERATOR_NAMESPACE> 8443:8443
112+
kubectl port-forward -n pgo svc/postgres-operator 8443:8443
113113

114114
# If deployed to OpenShift
115-
oc port-forward <OPERATOR_POD_NAME> -n <OPERATOR_NAMESPACE> 8443:8443
115+
oc port-forward -n pgo svc/postgres-operator 8443:8443
116116
```
117+
In the above examples, you can substitute `pgo` for the namespace that you
118+
deployed the PostgreSQL Operator into.
117119

118-
Note: If a port other than 8443 was configured, update the above command accordingly.
119-
120-
On a separate terminal verify the `pgo` can communicate with the Crunchy PostgreSQL
121-
Operator:
120+
On a separate terminal verify the PostgreSQL Operator client can communicate
121+
with the PostgreSQL Operator:
122122

123123
```bash
124124
pgo version
125125
```
126126

127-
If the above command outputs versions of both the client and API server, the Crunchy
127+
If the above command outputs versions of both the client and API server, the Crunchy
128128
PostgreSQL Operator has been updated successfully.

docs/content/architecture/eventing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ event stream. If you have the correct priviledges
2727
to connect to the Operator pod, you can port forward
2828
as follows to form a connection to the event stream:
2929

30-
kubectl port-forward postgres-operator-XXXXXX 14150:4150 -n pgo
30+
kubectl port-forward svc/postgres-operator 14150:4150 -n pgo
3131

3232
## Event Topics
3333

0 commit comments

Comments
 (0)