Skip to content

Latest commit

 

History

History
40 lines (29 loc) · 3.66 KB

configuration.md

File metadata and controls

40 lines (29 loc) · 3.66 KB

Configuration

Postgres Operator is configured through the upstream Zalando Postgres Operator chart as well as a UDS configuration chart. It implements a database for many applications within UDS Software Factory when one is not available in your cloud provider.

Networking

Network policies are controlled via the uds-postgres-config chart in accordance with the common patterns for networking within UDS Software Factory. Because Postgres does not interact with external resources like object storage it only implements custom networking for the postgres-operator namespace:

  • additionalNetworkAllow: sets custom network policies for the postgres-operator namespace (as a break glass in case you deploy your own postgres cluster custom resources - see below)

Postgres Clusters

Postgres Operator is configured through acid.zalan.do/v1 Postgresql custom resources. The uds-postgres-config chart creates one of these by default which is configurable through the following:

  • postgresql.enabled: whether to create the default Postgresql custom resource (if disabled you will need to apply your own CRs to the cluster)
  • postgresql.teamId: the name of the team the cluster belongs to (i.e. uds)
  • postgresql.volume.size: the size of the database on disk (i.e. 1Gi)
  • postgresql.numberOfInstances: The number of cluster Pods to run in the cluster (i.e. 2)
  • postgresql.users: The users to create for the database in the form {namespace}.{username} (i.e. gitlab.gitlab: [])
  • postgresql.databases: The database names to create and the users they map to (i.e. gitlabdb: gitlab.gitlab)
  • postgresql.version: The version of Postgres to run (i.e. 14)
  • postgresql.ingress: A list of ingress entries to create for this cluster (follows the custom networking definition except for direction which is always Ingress and selector which is always cluster-name: pg-cluster)
  • postgresql.resources: A Kubernetes Pod resource specification to define requests and limits
  • postgresql.additionalVolumes: A list of additional volumes to map into the Postgres container if needed (see below)
  • postgresql.tls: TLS configuration for the Postgres cluster to use (follows the tls section of the Zalando Postgres CR)

Postgres HugePages

Postgres Operator can also support HugePages by setting the following keys appropriately for your environment. You can learn more about HugePages in Kubernetes in their Manage HugePages documentation and learn more about these fields in the Postgresql custom resource reference documentation.

  • postgresql.resources: This allows you to set the desired hugepages limits and requests
  • postgresql.additionalVolumes: This allows you to map the correct hugepages volumes into the container, e.g.:
  - name: hugepage-2mi
    mountPath: /hugepages-2Mi
    volumeSource:
      emptyDir:
        medium: HugePages-2Mi