4.3.0 Beta 2
Pre-releaseCrunchy Data announces the release of the 'PostgreSQL Operator 4.3.0 Beta 2](https://www.crunchydata.com/developers/download-postgres/containers/postgres-operator).
Changes since Beta 1:
Breaking Changes
- "Limit" resource parameters are no longer set on the containers, in particular, the PostgreSQL container, due to undesired behavior stemming from the host machine OOM killer. Further details can be found in the original pull request.
- Added
DefaultInstanceMemory,DefaultBackrestMemory, andDefaultPgBouncerMemoryoptions to thepgo.yamlconfiguration to allow for the setting of default memory requests for PostgreSQL instances, the pgBackRest repository, and pgBouncer instances respectively. - If unset by either the PostgreSQL Operator configuration or one-off, the default memory resource requests for the following applications are:
- PostgreSQL: 512Mi
- pgBackRest: 48Mi
- pgBouncer: 24Mi
- Remove the
Default...ContainerResourcesset of parameters from thepgo.yamlconfiguration file. - Remove the
PreferredFailoverNodefeature, as it had already been effictively removed. - Remove explicit
rmcalls when cleaning up PostgreSQL clusters. This behavior is left to the storage provsioner that one deploys with their PostgreSQL instances
Features
Elimination of ClusterRole Requirement for the PostgreSQL Operator
PostgreSQL Operator 4.0 introduced the ability to manage PostgreSQL clusters
across multiple Kubernetes Namespaces. PostgreSQL Operator 4.1 built on this
functionality by allowing users to dynamically control which Namespaces it
managed as well as the PostgreSQL clusters deployed to them. In order to
leverage this feature, one must grant a ClusterRole
level permission via a ServiceAccount to the PostgreSQL Operator.
There are a lot of deployment environments for the PostgreSQL Operator that only
need for it to exists within a single namespace and as such, granting
cluster-wide privileges is superfluous, and in many cases, undesirable. As such,
it should be possible to deploy the PostgreSQL Operator to a single namespace
without requiring a ClusterRole.
To do this, but maintain the aforementioned Namespace functionality for those
who require it, PostgreSQL Operator 4.3 introduces the ability to opt into
deploying it with minimum required ClusterRole privileges and in turn, the
ability to deploy the PostgreSQL Operator without a ClusterRole. To do so, the
PostgreSQL Operator introduces the concept of "namespace operating mode" which
lets one select the type deployment to create. The namespace mode is set at the
install time for the PostgreSQL Operator, and files into one of three options:
-
dynamic: This is the default. This enables full dynamic Namespace
management capabilities, in which the PostgreSQL Operator can create, delete and
update any Namespaces within the Kubernetes cluster, while then also having the
ability to create the Roles, Role Bindings and Service Accounts within those
Namespaces for normal operations. The PostgreSQL Operator can also listen for
Namespace events and create or remove controllers for various Namespaces as
changes are made to Namespaces from Kubernetes and the PostgreSQL Operator's
management. -
readonly: In this mode, the PostgreSQL Operator is able to listen for
namespace events within the Kubernetetes cluster, and then manage controllers
as Namespaces are added, updated or deleted. While this still requires a
ClusterRole, the permissions mirror those of a "read-only" environment, and as
such the PostgreSQL Operator is unable to create, delete or update Namespaces
itself nor create RBAC that it requires in any of those Namespaces. Therefore,
while inreadonly, mode namespaces must be preconfigured with the proper RBAC
as the PostgreSQL Operator cannot create the RBAC itself. -
disabled: Use this mode if you do not want to deploy the PostgreSQL Operator
with anyClusterRoleprivileges, especially if you are only deploying the
PostgreSQL Operator to a single namespace. This disables any Namespace
management capabilities within the PostgreSQL Operator and will simply attempt
to work with the target Namespaces specified during installation. If no target
Namespaces are specified, then the Operator will be configured to work within
the namespace in which it is deployed. As with thereadonlymode, while in
this mode, Namespaces must be pre-configured with the proper RBAC, since the
PostgreSQL Operator cannot create the RBAC itself.
Based on the installer you use, the variables to set this mode are either named:
PGO_NAMESPACE_MODEnamespace_mode
pgo-installer Improvements
The new pgo-installer container can now be run directly from kubectl, i.e.
kubectl apply -f /path/to/install.ymlOther New Features
pgo create clusternow supports the--pgbackrest-storage-configflag to specify specific a specific storage configuration for the pgBackRest repository in a clusterpgo create clusternow supports the--pgbackrest-cpu,--pgbackrest-memory,--pgbouncer-cpu, and--pgbouncer-memoryresource request flags for the pgBackRest repository and the pgBouncer instances respectively.pgo create pgbouncernow supports the--cpu, and--memoryresource request flags for requesting container resources for the pgBouncer instancespgo update clusternow supports the--pgbackrest-cpu,--pgbackrest-memoryresource request flags for modifying container resources for the pgBackRest repository.pgo update pgbouncernow supports the--cpu, and--memoryresource request flags for requesting container resources for the pgBouncer instances.- Specify a different S3 Certificate Authority (CA) with
pgo create clusterby using the--pgbackrest-s3-ca-secretflag, which refers to an existing Secret that contains a key calledaws-s3-ca.crtthat contains the CA. Reported by Aurelien Marie @(aurelienmarie)
Fixes
- Default the recovery action to "promote" when performing a "point-in-time-recovery" (PITR), which will ensure that a PITR process completes.
- Fix performance degradation discovered in certain environments that use the dynamic Namespace feature. Reported by (@dadez)
- Remove
backoffLimitfrom Jobs that can be retried, which is most of them. Reported by Leo Khomenko (@lkhomenk)