|
| 1 | +--- |
| 2 | +title: "4.3.1" |
| 3 | +date: |
| 4 | +draft: false |
| 5 | +weight: 95 |
| 6 | +--- |
| 7 | + |
| 8 | +Crunchy Data announces the release of the [PostgreSQL Operator](https://www.crunchydata.com/products/crunchy-postgresql-operator/) 4.3.1 on May 18, 2020. |
| 9 | + |
| 10 | +The PostgreSQL Operator is released in conjunction with the [Crunchy Container Suite](https://github.com/CrunchyData/crunchy-containers/). |
| 11 | + |
| 12 | +The PostgreSQL Operator 4.3.1 release includes the following software versions upgrades: |
| 13 | + |
| 14 | +- The PostgreSQL containers now use versions 12.3, 11.8, 10.13, 9.6.18, and 9.5.22 |
| 15 | + |
| 16 | +PostgreSQL Operator is tested with Kubernetes 1.13 - 1.18, OpenShift 3.11+, OpenShift 4.3+, Google Kubernetes Engine (GKE), and VMware Enterprise PKS 1.3+. |
| 17 | + |
| 18 | +# Changes |
| 19 | + |
| 20 | +## Initial Support for SCRAM |
| 21 | + |
| 22 | +[SCRAM](https://info.crunchydata.com/blog/how-to-upgrade-postgresql-passwords-to-scram) is a password authentication method in PostgreSQL that has been available since PostgreSQL 10 and is considered to be superior to the `md5` authentication method. The PostgreSQL Operator now introduces support for SCRAM on the [`pgo create user`](https://access.crunchydata.com/documentation/postgres-operator/latest/pgo-client/reference/pgo_create_user/) and [`pgo update user`](https://access.crunchydata.com/documentation/postgres-operator/latest/pgo-client/reference/pgo_update_user/) commands by means of the `--password-type` flag. The following values for `--password-type` will select the following authentication methods: |
| 23 | + |
| 24 | + |
| 25 | +- `--password-type=""`, `--password-type="md5"` => md5 |
| 26 | +- `--password-type="scram"`, `--password-type="scram-sha-256"` => SCRAM-SHA-256 |
| 27 | + |
| 28 | +In turn, the PostgreSQL Operator will hash the passwords based on the chosen method and store the computed hash in PostgreSQL. |
| 29 | + |
| 30 | +When using SCRAM support, it is important to note the following observations and limitations: |
| 31 | + |
| 32 | +- When using one of the password modifications commands on `pgo update user` (e.g. `--password`, `--rotate-password`, `--expires`) with the desire to keep the persisted password using SCRAM, it is necessary to specify the "--password-type=scram-sha-256" directive. |
| 33 | +- SCRAM does not work with the current pgBouncer integration with the PostgreSQL Operator. pgBouncer presently supports only one password-based authentication type at a time. Additionally, to enable support for SCRAM, pgBouncer would require a list of plaintext passwords to be stored in a file that is accessible to it. Future work can evaluate how to leverage SCRAM support with pgBouncer. |
| 34 | + |
| 35 | +## `pgo restart` and `pgo reload` |
| 36 | + |
| 37 | +This release introduces the `pgo restart` command, which allow you to perform a PostgreSQL restart on one or more instances within a PostgreSQL cluster. |
| 38 | + |
| 39 | +You restart all instances at the same time using the following command: |
| 40 | + |
| 41 | +```shell |
| 42 | +pgo restart hippo |
| 43 | +``` |
| 44 | + |
| 45 | +or specify a specific instance to restart using the `--target` flag (which follows a similar behavior to the `--target` flag on `pgo scaledown` and `pgo failover`): |
| 46 | + |
| 47 | +```shell |
| 48 | +pgo restart hippo --target=hippo-abcd |
| 49 | +``` |
| 50 | + |
| 51 | +The restart itself is performed by calling the Patroni `restart` REST endpoint on the specific instance (primary or replica) being restarted. |
| 52 | + |
| 53 | +As with the `pgo failover` and `pgo scaledown` commands it is also possible to specify the `--query` flag to query instances available for restart: |
| 54 | + |
| 55 | +```shell |
| 56 | +pgo restart mycluster --query |
| 57 | +``` |
| 58 | + |
| 59 | +With the new `pgo restart` command, using `--query` flag with the `pgo failover` and `pgo scaledown` commands include the `PENDING RESTART` information, which is now returned with any replication information. |
| 60 | + |
| 61 | + |
| 62 | +This release allows for the `pgo reload` command to properly reloads all instances (i.e. the primary and all replicas) within the cluster. |
| 63 | + |
| 64 | +## Dynamic Namespace Mode and Older Kubernetes Versions |
| 65 | + |
| 66 | +The dynamic namespace mode (e.g. `pgo create namespace` + `pgo delete namespace`) provides the ability to create and remove Kubernetes namespaces and automatically add them unto the purview of the PostgreSQL Operator. Through the course of fixing usability issues with working with the other namespaces modes (`readonly`, `disabled`), a change needed to be introduced that broke compatibility with Kubernetes 1.12 and earlier. |
| 67 | + |
| 68 | +The PostgreSQL Operator still supports managing PostgreSQL Deployments across multiple namespaces in Kubernetes 1.12 and earlier, but only with `readonly` mode. In `readonly` mode, a cluster administrator needs to create the namespace and the RBAC needed to run the PostgreSQL Operator in that namespace. However, it is now possible to define the RBAC required for the PostgreSQL Operator to manage clusters in a namespace via a ServiceAccount, as described in the [Namespace](https://access.crunchydata.com/documentation/postgres-operator/latest/architecture/namespace/) section of the documentation. |
| 69 | + |
| 70 | +The usability change allows for one to add namespace to the PostgreSQL Operator's purview (or deploy the PostgreSQL Operator within a namespace) and automatically set up the appropriate RBAC for the PostgreSQL Operator to correctly operate. |
| 71 | + |
| 72 | +## Other Changes |
| 73 | + |
| 74 | +- The RBAC required for deploying the PostgreSQL Operator is now decomposed into the exact privileges that are needed. This removes the need for requiring a `cluster-admin` privilege for deploying the PostgreSQL Operator. Reported by (@obeyler). |
| 75 | +- With namespace modes `disabled` and `readonly`, the PostgreSQL Operator will now dynamically create the required RBAC when a new namespace is added if that namespace has the RBAC defined in `local-namespace-rbac.yaml`. This occurs when `PGO_DYNAMIC_NAMESPACE` is set to `true`. |
| 76 | +- If the PostgreSQL Operator has permissions to manage it's own RBAC within a namespace, it will now reconcile and auto-heal that RBAC as needed (e.g. if it is invalid or has been removed) to ensure it can properly interact with and manage that namespace. |
| 77 | +- Add default CPU and memory limits for the metrics collection and pgBadger sidecars to help deployments that wish to have a Pod QoS of `Guaranteed`. The metrics defaults are 100m/24Mi and the pgBadger defaults are 500m/24Mi. Reported by (@jose-joye). |
| 78 | +- Introduce `DISABLE_FSGROUP` option as part of the installation. When set to `true`, this does not add a FSGroup to the Pod [Security Context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) when deploying PostgreSQL related containers or pgAdmin 4. This is helpful when deploying the PostgreSQL Operator in certain environments, such as OpenShift with a `restricted` Security Context Constraint. Defaults to `false`. |
| 79 | +- Remove the custom Security Context Constraint (SCC) that would be deployed with the PostgreSQL Operator, so now the PostgreSQL Operator can be deployed using default OpenShift SCCs (e.g. "restricted", though note that `DISABLE_FSGROUP` will need to be set to `true` for that). The example PostgreSQL Operator SCC is left in the [`examples`](https://raw.githubusercontent.com/CrunchyData/postgres-operator/master/examples/pgo-scc.yaml) directory for reference. |
| 80 | +- When `PGO_DISABLE_TLS` is set to `true`, then `PGO_TLS_NO_VERIFY` is set to `true`. |
| 81 | +- Some of the `pgo-deployer` environmental variables that we not needed to be set by a user were internalized. These include `ANSIBLE_CONFIG` and `HOME`. |
| 82 | +- When using the `pgo-deployer` container to install the PostgreSQL Operator, update the default watched namespace to `pgo` as the example only uses this namespace. |
| 83 | + |
| 84 | +# Fixes |
| 85 | +- Fix for cloning a PostgreSQL cluster when the pgBackRest repository is stored in S3. |
| 86 | +- Ensure the `pgo-apiserver` will successfully run if `PGO_DISABLE_TLS` is set to `true`. Reported by (@zhubx007). |
| 87 | +- Prevent a run of `pgo-deployer` from failing if it detects the existence of dependent cluster-wide objects already present. |
| 88 | +- Deployments with `pgo-deployer` using the default file with `hostpathstorage` will now successfully deploy PostgreSQL clusters without any adjustments. |
| 89 | +- Ensure image pull secrets are attached to deployments of the `pgo-client` container. |
| 90 | +- Ensure `client-setup.sh` executes to completion if existing PostgreSQL Operator credentials exist that were created by a different installation method |
| 91 | +- Update the documentation to properly name `CCP_IMAGE_PULL_SECRET_MANIFEST` and `PGO_IMAGE_PULL_SECRET_MANIFEST` in the `pgo-deployer` configuration. |
| 92 | +- Several fixes for selecting default storage configurations and sizes when using the `pgo-deployer` container. These include #1, #4, and #8 in the `STORAGE` family of variables. |
| 93 | +- The custom setup example was updated to reflect the current state of bootstrapping the PostgreSQL container. |
0 commit comments