Postgres Deployment Properties
This topic describes the properties you can define in a Postgres operator manifest file.
Synopsis
apiVersion: sql.tanzu.vmware.com/v1
kind: Postgres
metadata:
name: <string>
spec:
memory: <memory-limit>
cpu: <cpu-limit>
storageClassName: <storage-class>
storageSize: <size>
pgConfig:
dbname: <pg-instance-name>
username: <pg-username>
serviceType: <LoadBalancer|ClusterIP>
highAvailability:
enabled: <true|false>
backupLocationSecret:
name: <backup-secret>
Description
You specify Postgres instance configuration properties to the Postgres operator with a YAML-formatted manifest file. A sample manifest file is provided in pg-instance-example.yaml
. The current version of the manifest supports configuring the Postgres instance name, default database name and user name, backup credentials, and memory, cpu, and storage settings for the instance. See also Deploying a New Postgres Instance for information about deploying a new Postgres instance using a manifest file.
Keywords and Values
Instance Metadata
name: <string>
-0
to the end of the name when it creates the instance pod, for example pg-instance-example-0
. The new Postgres instance includes a default database with the same name as the instance unless you change the default database name with dbname
.You can filter the output of
kubectl
commands using this name. For example, if you set the name to pg-instance-example
then you can use commands like kubectl get all -l postgres-instance=pg-instance-example
or kubectl get pvc -l postgres-instance=pg-instance-example
to get all resources or pvc associated with the Postgres instance respectively.Instance Configuration
memory: <memory-limit>
4.5Gi
.). If left empty, the default for the Postgres instance is 800 mebibytes, or about 800 megabytes. See Assign Memory Resources to Containers and Pods in the Kubernetes documentation for more information. cpu: <cpu-limit>
cpu: "1.2"
). If left empty, the pod has no upper bound on the CPU resource it can use or inherits the default limit if one is specified in its deployed namespace. See Assign CPU Resources to Containers and Pods in the Kubernetes documentation for more information.Note: If you do not want to specify a custom cpu limit, comment-out or remove the
cpu:
keyword from the YAML file, or specify an empty string for its value (cpu: ""
). If the keyword appears in the YAML file, you must assign a valid string value to it.storageClassName: <storage-class>
For best performance, use persistent volumes that are backed by a local SSD with the XFS filesystem, using
readahead
cache for best performance. Use the mount options rw,nodev,noatime,nobarrier,inode64
to mount the volume. See Creating Local Persistent Volumes for Greenplum for information about manually provisioning local persistent volumes. See Optimizing Persistent Disk and Local SSD Performance in the Google Cloud documentation for information about the performance characteristics of different storage types.storageSize: <size>
100G
, 1T
).dbname: <pg-instance-name>
name:
string) is used as the default database name. See Custom Database Name and User Account.username: <pg-username>
serviceType: <LoadBalancer|ClusterIP>
LoadBalancer
is used by default, which exposes the Postgres service externally using the Kubernetes load balancer. ClusterIP
uses cluster-internal IP address instead of a load balancer. See Publishing Services (ServiceTypes) in the Kubernetes documentation for more information.highAvailability: enabled: <true|false>
false
, creates single node cluster. See Configuring High Availability for more information about clustered Postgres deployments.backupLocationSecret: name: <backup-secret>