Skip to content

Commit 2b8b9d0

Browse files
wilybraceandrewlecuyer
authored andcommitted
adds documentation on expected shell environment (#1049)
* adds documentation on expected shell environment While environment variables are primarily used by the Bash installation but utility scripts also expect common environment variables to exist. This restructuring helps clarify the necessary execution environment, whether the installation is performed via Ansible or Bash. * incorporates review feedback recommending linkage Updates prerequisite information in the Bash and Ansible installs to directly refer to the environment configuration if missed from the TOC
1 parent 8d4c4b5 commit 2b8b9d0

File tree

6 files changed

+49
-8
lines changed

6 files changed

+49
-8
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: "Operator Environment"
3+
date:
4+
draft: false
5+
weight: 50
6+
---
7+
8+
For various scripts used by the Operator, the `expenv` utility is required as are certain environment variables.
9+
10+
Download the `expenv` utility from its [Github Releases page](https://github.com/blang/expenv/releases), and place it into your PATH (e.g. $HOME/odev/bin).
11+
12+
The following environment variables are heavily used in the Bash installation procedures and may be used in Operator helper scripts.
13+
14+
Variable | Ansible Inventory | Example | Description
15+
-------- | ----------------- | ------- | -----------
16+
`DISABLE_EVENTING` | pgo_disable_eventing | false | Disable Operator eventing subsystem
17+
`DISABLE_TLS` | pgo_disable_tls | false | Disable TLS for Operator
18+
`GOPATH` | | $HOME/odev | Golang project directory
19+
`GOBIN` | | $GOPATH/bin | Golang binary target directory
20+
`NAMESPACE` | namespace | pgouser1 | Namespaces monitored by Operator
21+
`PGOROOT` | | $GOPATH/src/github.com/crunchydata/postgres-operator | Operator repository location
22+
`PGO_APISERVER_PORT` | pgo_apiserver_port | 8443 | HTTP(S) port for Operator API server
23+
`PGO_BASEOS` | | centos7 | Base OS for container images
24+
`PGO_CA_CERT` | | $PGOROOT/conf/postgres-operator/server.crt | Server certificate and CA trust
25+
`PGO_CMD` | | kubectl | Cluster management tool executable
26+
`PGO_CLIENT_CERT` | | $PGOROOT/conf/postgres-operator/server.crt | TLS Client certificate
27+
`PGO_CLIENT_KEY` | | $PGOROOT/conf/postgres-operator/server.crt | TLS Client certificate private key
28+
`PGO_IMAGE_PREFIX` | pgo_image_prefix | crunchydata | Container image prefix
29+
`PGO_IMAGE_TAG` | pgo_image_tag | $PGO_BASEOS-$PGO_VERSION | OS/Version tagging info for images
30+
`PGO_INSTALLATION_NAME` | pgo_installation_name | devtest | Unique name given to Operator installation
31+
`PGO_OPERATOR_NAMESPACE` | pgo_operator_namespace | pgo | Kubernetes namespace for the operator
32+
`PGO_VERSION` | | 4.1.0 | Operator version
33+
`TLS_NO_VERIFY` | pgo_tls_no_verify | false | Disable certificate verification (e.g. strict hostname checking)
34+
35+
{{% notice tip %}}
36+
`examples/envs.sh` contains the above variable definitions as well
37+
{{% /notice %}}
38+

hugo/content/Installation/developer-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Developer Setup"
33
date:
44
draft: false
5-
weight: 305
5+
weight: 300
66
---
77

88
# Developing

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Install `pgo` Client"
33
date:
44
draft: false
5-
weight: 1
5+
weight: 400
66
---
77

88
# Install the Postgres Operator (`pgo`) Client

hugo/content/Installation/install-with-ansible/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Install Operator Using Ansible"
33
date:
44
draft: false
5-
weight: 1
5+
weight: 100
66
---
77

88
# Crunchy Data PostgreSQL Operator Playbooks

hugo/content/Installation/install-with-ansible/prerequisites.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ are required:
3232
* [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install-win10)
3333
* [Ubuntu for Windows](https://www.microsoft.com/en-us/p/ubuntu/9nblggh4msv6)
3434

35+
## Environment
36+
37+
Ensure the appropriate [environment variables]({{< relref "common-env.md" >}}) are set.
38+
3539
## Permissions
3640

3741
The installation of the Crunchy PostgreSQL Operator requires elevated privileges.
@@ -46,8 +50,6 @@ can install:
4650

4751
However, if the user wishes to add a new watched namespace after installation, where the user would normally use pgo create namespace to add the new namespace, they should instead run the add-targeted-namespace.sh script or they may give themselves cluster-admin privileges instead of having to run setupnamespaces.sh script. Again, this is only required when running on a Kuberenetes distribution whose version is below 1.12. In Kubernetes version 1.12+ the pgo create namespace command works as expected.
4852

49-
add-targeted-namespace.sh requires the additional environment variable PGO_INSTALLATION_NAME set to the unique name given to the Operator's installation
50-
5153
{{% /notice %}}
5254

5355
## Obtaining Operator Ansible Role

hugo/content/Installation/operator-install.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "Install Operator Using Bash"
33
date:
44
draft: false
5-
weight: 300
5+
weight: 200
66
---
77

88
A full installation of the Operator includes the following steps:
@@ -43,6 +43,9 @@ Environment variables control aspects of the Operator installation. You can cop
4343
cat $HOME/odev/src/github.com/crunchydata/postgres-operator/examples/envs.sh >> $HOME/.bashrc
4444
source $HOME/.bashrc
4545

46+
To manually configure the environment variables, refer to the [environment documentation]({{< relref "common-env.md" >}}).
47+
48+
4649
For various scripts used by the Operator, the *expenv* utility is required, download this utility from the Github Releases page, and place it into your PATH (e.g. $HOME/odev/bin).
4750
{{% notice tip %}}There is also a Makefile target that includes is *expenv* and several other dependencies that are only needed if you plan on building from source:
4851

@@ -83,8 +86,6 @@ created as part of the default installation.
8386

8487
However, if the user wishes to add a new watched namespace after installation, where the user would normally use pgo create namespace to add the new namespace, they should instead run the add-targeted-namespace.sh script or they may give themselves cluster-admin privileges instead of having to run setupnamespaces.sh script. Again, this is only required when running on a Kuberenetes distribution whose version is below 1.12. In Kubernetes version 1.12+ the pgo create namespace command works as expected.
8588

86-
add-targeted-namespace.sh requires the additional environment variable PGO_INSTALLATION_NAME set to the unique name given to the Operator's installation
87-
8889
{{% /notice %}}
8990

9091
The *PGO_OPERATOR_NAMESPACE* environment variable is a comma separated list

0 commit comments

Comments
 (0)