PGD Node configuration v1.1.2

The EDB Postgres Distributed for Kubernetes (PGD4K) operator relies on the EDB Postgres for Kubernetes (PG4K) operator to manage individual nodes.

For each PGDGroup, a PGD node is represented as a single-instance PG4K cluster. The PGD4K operator reflects modifications made to the PGDGroup onto the CNP cluster and leverages the PG4K operator to handle these changes. These modifications are specific to the fields spec.cnp and spec.witness within the PGDGroup.

By default, spec.cnp governs the settings for all nodes within the group. If you wish for the witness node to have different configurations from the data nodes, you can define spec.witness. Please note that once spec.witness is defined, you must explicitly specify all configuration parameters; any configurations not explicitly defined will default to the standard settings.

InitDB option

You can specify the options passed to the initdb command within the spec.[cnp|witness].initDBOptions section. The following nodes will initialize from scratch using these options:

  • All witness nodes
  • Data nodes that use logical join
  • The data node that is the first node in the initial group

The supported initdb options within PGDGroup are:

  • dataChecksums
  • encoding
  • walSegmentSize
  • localeCollate
  • localeCType
  • localeProvider
  • locale
  • icuLocale
  • icuRules
  • builtinLocale

PGDGroup passes these initdb options to the underlying PG4K cluster. For more details on supported initdb options, please refer to Passing Options to initdb in the PG4K documentation.

Managed configuration

The PGD operator allows configuring the managed section of a PG4K cluster. The spec.cnp.managed stanza is used for configuring the supported managed roles and services within the cluster.

In this example, a PGDGroup is defined with default read only and read services disabled. Additionally, it is configured to have a managed role named foo with the specified properties set up in postgres.

apiVersion: pgd.k8s.enterprisedb.io/v1beta1
kind: PGDGroup
metadata:
  name: group-example-with-managed
spec:
  [...]
  cnp:
    [...]
    managed:
      roles:
        - name: foo
          comment: Foo
          ensure: present
          connectionLimit: 100
          login: true
          superuser: true
          createdb: true
          createrole: true
          replication: true
      services:
        disabledDefaultServices:
          - ro
          - r

For more information about managed roles, see Database role management in the EDB Postgres for Kubernetes documentation.

Note

The PGD4K operator also leverages the PG4K operator to handle managed configurations. User and role definitions in the managed configuration are created or modified within the postgres database.