postgres-operator

by ckotzbauer

Helm chartv1.12.2App 1.12.0Verified publisher

Postgres Operator creates and manages PostgreSQL clusters running in Kubernetes

About this chart

Postgres-operator

Postgres Operator creates and manages PostgreSQL clusters running in Kubernetes

Learn more: https://github.com/zalando/postgres-operator

TL;DR;

$ helm install ckotzbauer/postgres-operator

Installing the Chart

To install the chart with the release name my-release:

$ helm install my-release ckotzbauer/postgres-operator

The command deploys the operator on the Kubernetes cluster using the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall/delete the my-release installation:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Postgres-operator chart and their default values.

KeyTypeDefaultDescription
image.registrystring"registry.opensource.zalan.do"
image.repositorystring"acid/postgres-operator"
image.tagstring"v1.12.0"
image.pullPolicystring"IfNotPresent"
podAnnotationsobject{}
podLabelsobject{}
enableJsonLoggingboolfalse
configGeneral.enable_crd_registrationbooltrue
configGeneral.crd_categories[0]string"all"
configGeneral.enable_lazy_spilo_upgradeboolfalse
configGeneral.enable_pgversion_env_varbooltrue
configGeneral.enable_shm_volumebooltrue
configGeneral.enable_spilo_wal_path_compatboolfalse
configGeneral.etcd_hoststring""
configGeneral.docker_imagestring"registry.opensource.zalan.do/acid/spilo-14:2.1-p5"
configGeneral.min_instancesint-1
configGeneral.max_instancesint-1
configGeneral.repair_periodstring"5m"
configGeneral.resync_periodstring"30m"
configGeneral.workersint8
configUsers.enable_password_rotationboolfalse
configUsers.password_rotation_intervalint90
configUsers.password_rotation_user_retentionint180
configUsers.replication_usernamestring"standby"
configUsers.super_usernamestring"postgres"
configMajorVersionUpgrade.major_version_upgrade_modestring"off"
configMajorVersionUpgrade.minimal_major_versionstring"9.6"
configMajorVersionUpgrade.target_major_versionstring"14"
configKubernetes.cluster_domainstring"cluster.local"
configKubernetes.cluster_labels.applicationstring"spilo"
configKubernetes.cluster_name_labelstring"cluster-name"
configKubernetes.enable_cross_namespace_secretboolfalse
configKubernetes.enable_init_containersbooltrue
configKubernetes.enable_pod_antiaffinityboolfalse
configKubernetes.enable_pod_disruption_budgetbooltrue
configKubernetes.enable_sidecarsbooltrue
configKubernetes.pdb_name_formatstring"postgres-{cluster}-pdb"
configKubernetes.pod_antiaffinity_topology_keystring"kubernetes.io/hostname"
configKubernetes.pod_management_policystring"ordered_ready"
configKubernetes.pod_role_labelstring"spilo-role"
configKubernetes.pod_terminate_grace_periodstring"5m"
configKubernetes.secret_name_templatestring"{username}.{cluster}.credentials.{tprkind}.{tprgroup}"
configKubernetes.spilo_privilegedboolfalse
configKubernetes.spilo_allow_privilege_escalationbooltrue
configKubernetes.storage_resize_modestring"pvc"
configKubernetes.watched_namespacestring"*"
configPostgresPodResources.default_cpu_limitstring"1"
configPostgresPodResources.default_cpu_requeststring"100m"
configPostgresPodResources.default_memory_limitstring"500Mi"
configPostgresPodResources.default_memory_requeststring"100Mi"
configPostgresPodResources.min_cpu_limitstring"250m"
configPostgresPodResources.min_memory_limitstring"250Mi"
configTimeouts.patroni_api_check_intervalstring"1s"
configTimeouts.patroni_api_check_timeoutstring"5s"
configTimeouts.pod_deletion_wait_timeoutstring"10m"
configTimeouts.pod_label_wait_timeoutstring"10m"
configTimeouts.ready_wait_intervalstring"3s"
configTimeouts.ready_wait_timeoutstring"30s"
configTimeouts.resource_check_intervalstring"3s"
configTimeouts.resource_check_timeoutstring"10m"
configLoadBalancer.db_hosted_zonestring"db.example.com"
configLoadBalancer.enable_master_load_balancerboolfalse
configLoadBalancer.enable_master_pooler_load_balancerboolfalse
configLoadBalancer.enable_replica_load_balancerboolfalse
configLoadBalancer.enable_replica_pooler_load_balancerboolfalse
configLoadBalancer.external_traffic_policystring"Cluster"
configLoadBalancer.master_dns_name_formatstring"{cluster}.{team}.{hostedzone}"
configLoadBalancer.replica_dns_name_formatstring"{cluster}-repl.{team}.{hostedzone}"
configDebug.debug_loggingbooltrue
configDebug.enable_database_accessbooltrue
configLoggingRestApi.api_portint8080
configLoggingRestApi.cluster_history_entriesint1000
configLoggingRestApi.ring_log_linesint100
configAwsOrGcp.aws_regionstring"eu-central-1"
configAwsOrGcp.enable_ebs_gp3_migrationboolfalse
configLogicalBackup.logical_backup_docker_imagestring"registry.opensource.zalan.do/acid/logical-backup:v1.8.0"
configLogicalBackup.logical_backup_job_prefixstring"logical-backup-"
configLogicalBackup.logical_backup_providerstring"s3"
configLogicalBackup.logical_backup_s3_access_key_idstring""
configLogicalBackup.logical_backup_s3_bucketstring"my-bucket-url"
configLogicalBackup.logical_backup_s3_regionstring""
configLogicalBackup.logical_backup_s3_endpointstring""
configLogicalBackup.logical_backup_s3_secret_access_keystring""
configLogicalBackup.logical_backup_s3_ssestring"AES256"
configLogicalBackup.logical_backup_s3_retention_timestring""
configLogicalBackup.logical_backup_schedulestring"30 00 * * *"
configTeamsApi.enable_admin_role_for_usersbooltrue
configTeamsApi.enable_postgres_team_crdboolfalse
configTeamsApi.enable_postgres_team_crd_superusersboolfalse
configTeamsApi.enable_team_member_deprecationboolfalse
configTeamsApi.enable_team_superuserboolfalse
configTeamsApi.enable_teams_apiboolfalse
configTeamsApi.pam_role_namestring"zalandos"
configTeamsApi.postgres_superuser_teams[0]string"postgres_superusers"
configTeamsApi.protected_role_names[0]string"admin"
configTeamsApi.protected_role_names[1]string"cron_admin"
configTeamsApi.role_deletion_suffixstring"_deleted"
configTeamsApi.team_admin_rolestring"admin"
configTeamsApi.team_api_role_configuration.log_statementstring"all"
configConnectionPooler.connection_pooler_schemastring"pooler"
configConnectionPooler.connection_pooler_userstring"pooler"
configConnectionPooler.connection_pooler_imagestring"registry.opensource.zalan.do/acid/pgbouncer:master-22"
configConnectionPooler.connection_pooler_max_db_connectionsint60
configConnectionPooler.connection_pooler_modestring"transaction"
configConnectionPooler.connection_pooler_number_of_instancesint2
configConnectionPooler.connection_pooler_default_cpu_requeststring"500m"
configConnectionPooler.connection_pooler_default_memory_requeststring"100Mi"
configConnectionPooler.connection_pooler_default_cpu_limitstring"1"
configConnectionPooler.connection_pooler_default_memory_limitstring"100Mi"
enableStreamsboolfalse
rbac.createbooltrue
rbac.createAggregateClusterRolesboolfalse
serviceAccount.createbooltrue
serviceAccount.namestringnil
podServiceAccount.namestring"postgres-pod"
priorityClassNamestring""
podPriorityClassNamestring""
resources.limits.cpustring"500m"
resources.limits.memorystring"500Mi"
resources.requests.cpustring"100m"
resources.requests.memorystring"250Mi"
securityContext.runAsUserint1000
securityContext.runAsNonRootbooltrue
securityContext.readOnlyRootFilesystembooltrue
securityContext.allowPrivilegeEscalationboolfalse
securityContext.capabilities.drop[0]string"ALL"
affinityobject{}
nodeSelectorobject{}
tolerationslist[]
controllerID.createboolfalse
controllerID.namestringnil
pod_environment_configobject{}

Changes compared to the official chart

  • No ConfigMap config-target.
  • pod_environment_configmap is created automatically. Contents can be configured via pod_environment_config.
  • Enhanced security (dropped ALL capabilities for the operator-pod).

Deploy postgres-operator with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has postgres-operator on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpostgres-operator is pinned at v1.12.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply