|
| 1 | +apiVersion: postgres-operator.crunchydata.com/v1beta1 |
| 2 | +kind: PostgresCluster |
| 3 | +metadata: |
| 4 | + name: {{ template "crunchy-postgres.fullname" . }} |
| 5 | + labels: {{ include "crunchy-postgres.labels" . | nindent 4 }} |
| 6 | +spec: |
| 7 | + openshift: {{ .Values.openshift }} |
| 8 | + metadata: |
| 9 | + labels: {{ include "crunchy-postgres.labels" . | nindent 6 }} |
| 10 | + {{ if .Values.crunchyImage }} |
| 11 | + image: {{ .Values.crunchyImage }} |
| 12 | + {{ end }} |
| 13 | + imagePullPolicy: {{.Values.imagePullPolicy}} |
| 14 | + postgresVersion: {{ .Values.postgresVersion }} |
| 15 | + {{ if .Values.postGISVersion }} |
| 16 | + postGISVersion: {{ .Values.postGISVersion | quote }} |
| 17 | + {{ end }} |
| 18 | + postgresVersion: {{ .Values.postgresVersion }} |
| 19 | + |
| 20 | + {{ if .Values.pgmonitor.enabled }} |
| 21 | + |
| 22 | + monitoring: |
| 23 | + pgmonitor: |
| 24 | + # this stuff is for the "exporter" container in the "postgres-cluster-ha" set of pods |
| 25 | + exporter: |
| 26 | + {{ if .Values.pgmonitor.exporter.image}} |
| 27 | + image: {{ .Values.pgmonitor.exporter.image}} |
| 28 | + {{ end }} |
| 29 | + resources: |
| 30 | + requests: |
| 31 | + cpu: {{ .Values.pgmonitor.exporter.requests.cpu }} |
| 32 | + memory: {{ .Values.pgmonitor.exporter.requests.memory }} |
| 33 | + {{ if .Values.pgmonitor.exporter.limits }} |
| 34 | + limits: |
| 35 | + cpu: {{ .Values.pgmonitor.exporter.limits.cpu }} |
| 36 | + memory: {{ .Values.pgmonitor.exporter.limits.memory }} |
| 37 | + {{ end }} |
| 38 | + |
| 39 | + {{ end }} |
| 40 | + |
| 41 | + instances: |
| 42 | + - name: {{ .Values.instances.name }} |
| 43 | + replicas: {{ .Values.instances.replicas }} |
| 44 | + resources: |
| 45 | + requests: |
| 46 | + cpu: {{ .Values.instances.requests.cpu }} |
| 47 | + memory: {{ .Values.instances.requests.memory }} |
| 48 | + {{ if .Values.instances.limits }} |
| 49 | + limits: |
| 50 | + cpu: {{ .Values.instances.limits.cpu }} |
| 51 | + memory: {{ .Values.instances.limits.memory }} |
| 52 | + {{ end }} |
| 53 | + sidecars: |
| 54 | + replicaCertCopy: |
| 55 | + resources: |
| 56 | + requests: |
| 57 | + cpu: {{ .Values.instances.replicaCertCopy.requests.cpu }} |
| 58 | + memory: {{ .Values.instances.replicaCertCopy.requests.memory }} |
| 59 | + {{ if .Values.instances.replicaCertCopy.limits }} |
| 60 | + limits: |
| 61 | + cpu: {{ .Values.instances.replicaCertCopy.limits.cpu }} |
| 62 | + memory: {{ .Values.instances.replicaCertCopy.limits.memory }} |
| 63 | + {{ end }} |
| 64 | + dataVolumeClaimSpec: |
| 65 | + accessModes: |
| 66 | + - "ReadWriteOnce" |
| 67 | + resources: |
| 68 | + requests: |
| 69 | + storage: {{ .Values.instances.dataVolumeClaimSpec.storage }} |
| 70 | + storageClassName: {{ .Values.instances.dataVolumeClaimSpec.storageClassName }} |
| 71 | + affinity: |
| 72 | + podAntiAffinity: |
| 73 | + preferredDuringSchedulingIgnoredDuringExecution: |
| 74 | + - weight: 1 |
| 75 | + podAffinityTerm: |
| 76 | + topologyKey: topology.kubernetes.io/zone |
| 77 | + labelSelector: |
| 78 | + matchLabels: |
| 79 | + postgres-operator.crunchydata.com/cluster: |
| 80 | + {{ template "crunchy-postgres.fullname" . }} |
| 81 | + postgres-operator.crunchydata.com/instance-set: {{ .Values.instances.name }}-ha |
| 82 | + |
| 83 | + users: |
| 84 | + - name: {{ template "crunchy-postgres.fullname" . }} |
| 85 | + databases: |
| 86 | + - {{ template "crunchy-postgres.fullname" . }} |
| 87 | + options: "CREATEROLE" |
| 88 | + - name: postgres |
| 89 | + databases: |
| 90 | + - {{ template "crunchy-postgres.fullname" . }} |
| 91 | + |
| 92 | + {{ if .Values.dataSource.enabled }} |
| 93 | + dataSource: |
| 94 | + pgbackrest: |
| 95 | + configuration: |
| 96 | + - secret: |
| 97 | + name: {{ .Values.dataSource.secretName }} |
| 98 | + global: |
| 99 | + {{ .Values.dataSource.repo.name }}-path: {{ .Values.dataSource.repo.path | quote }} |
| 100 | + repo: |
| 101 | + name: {{ .Values.dataSource.repo.name }} |
| 102 | + s3: |
| 103 | + bucket: {{ .Values.dataSource.repo.s3.bucket }} |
| 104 | + endpoint: {{ .Values.dataSource.repo.s3.endpoint }} |
| 105 | + region: {{ .Values.dataSource.repo.s3.region }} |
| 106 | + stanza: {{ .Values.dataSource.stanza }} |
| 107 | + {{ end }} |
| 108 | + |
| 109 | + backups: |
| 110 | + pgbackrest: |
| 111 | + {{ if .Values.pgBackRest.image }} |
| 112 | + image: {{ .Values.pgBackRest.image }} |
| 113 | + {{ end }} |
| 114 | + configuration: |
| 115 | + - secret: |
| 116 | + name: {{ .Values.pgBackRest.s3.s3Secret }} |
| 117 | + global: |
| 118 | + {{- range .Values.pgBackRest.repos }} |
| 119 | + {{ .name }}-path: {{ .path | quote }} |
| 120 | + {{ .name }}-retention-full: {{ .retention | quote }} |
| 121 | + {{ .name }}-retention-full-type: {{ .retentionFullType }} |
| 122 | + {{ .name }}-s3-uri-style: {{ $.Values.pgBackRest.s3.s3UriStyle }} |
| 123 | + {{- end }} |
| 124 | + repos: |
| 125 | + {{- range .Values.pgBackRest.repos }} |
| 126 | + - name: {{ .name }} |
| 127 | + schedules: |
| 128 | + full: {{ .fullSchedule | quote }} |
| 129 | + s3: |
| 130 | + bucket: {{ $.Values.pgBackRest.s3.bucket }} |
| 131 | + endpoint: {{ $.Values.pgBackRest.s3.endpoint }} |
| 132 | + region: {{ $.Values.pgBackRest.s3.region }} |
| 133 | + {{- end }} |
| 134 | + # this stuff is for the "pgbackrest" container (the only non-init container) in the "postgres-crunchy-repo-host" pod |
| 135 | + repoHost: |
| 136 | + resources: |
| 137 | + requests: |
| 138 | + cpu: {{ .Values.pgBackRest.repoHost.requests.cpu }} |
| 139 | + memory: {{ .Values.pgBackRest.repoHost.requests.memory }} |
| 140 | + {{- if .Values.pgBackRest.repoHost.limits }} |
| 141 | + limits: |
| 142 | + cpu: {{ .Values.pgBackRest.repoHost.limits.cpu }} |
| 143 | + memory: {{ .Values.pgBackRest.repoHost.limits.memory }} |
| 144 | + {{- end }} |
| 145 | + sidecars: |
| 146 | + # this stuff is for the "pgbackrest" container in the "postgres-crunchy-ha" set of pods |
| 147 | + pgbackrest: |
| 148 | + resources: |
| 149 | + requests: |
| 150 | + cpu: {{ .Values.pgBackRest.sidecars.requests.cpu }} |
| 151 | + memory: {{ .Values.pgBackRest.sidecars.requests.memory }} |
| 152 | + {{- if .Values.pgBackRest.sidecars.limits }} |
| 153 | + limits: |
| 154 | + cpu: {{ .Values.pgBackRest.sidecars.limits.cpu }} |
| 155 | + memory: {{ .Values.pgBackRest.sidecars.limits.memory }} |
| 156 | + {{- end }} |
| 157 | + pgbackrestConfig: |
| 158 | + resources: |
| 159 | + requests: |
| 160 | + cpu: {{ .Values.pgBackRest.sidecars.requests.cpu }} |
| 161 | + memory: {{ .Values.pgBackRest.sidecars.requests.memory }} |
| 162 | + {{- if .Values.pgBackRest.sidecars.limits }} |
| 163 | + limits: |
| 164 | + cpu: {{ .Values.pgBackRest.sidecars.limits.cpu }} |
| 165 | + memory: {{ .Values.pgBackRest.sidecars.limits.memory }} |
| 166 | + {{- end }} |
| 167 | + standby: |
| 168 | + enabled: {{ .Values.standby.enabled }} |
| 169 | + repoName: {{ .Values.standby.repoName }} |
| 170 | + |
| 171 | + patroni: |
| 172 | + dynamicConfiguration: |
| 173 | + postgresql: |
| 174 | + pg_hba: |
| 175 | + - {{ .Values.patroni.postgresql.pg_hba}} |
| 176 | + parameters: |
| 177 | + shared_buffers: {{ .Values.patroni.postgresql.parameters.shared_buffers }} |
| 178 | + wal_buffers: {{ .Values.patroni.postgresql.parameters.wal_buffers }} |
| 179 | + min_wal_size: {{ .Values.patroni.postgresql.parameters.min_wal_size }} |
| 180 | + max_wal_size: {{ .Values.patroni.postgresql.parameters.max_wal_size }} |
| 181 | + max_slot_wal_keep_size: {{ .Values.patroni.postgresql.parameters.max_slot_wal_keep_size }} |
| 182 | + |
| 183 | + proxy: |
| 184 | + pgBouncer: |
| 185 | + config: |
| 186 | + global: |
| 187 | + client_tls_sslmode: disable |
| 188 | + {{ if .Values.proxy.pgBouncer.image }} |
| 189 | + image: {{ .Values.proxy.pgBouncer.image }} |
| 190 | + {{ end }} |
| 191 | + replicas: {{ .Values.proxy.pgBouncer.replicas }} |
| 192 | + # these resources are for the "pgbouncer" container in the "postgres-crunchy-ha-pgbouncer" set of pods |
| 193 | + # there is a sidecar in these pods which are not mentioned here, but the requests/limits are teeny weeny by default so no worries there. |
| 194 | + resources: |
| 195 | + requests: |
| 196 | + cpu: {{ .Values.proxy.pgBouncer.requests.cpu }} |
| 197 | + memory: {{ .Values.proxy.pgBouncer.requests.memory }} |
| 198 | + {{ if .Values.proxy.pgBouncer.limits }} |
| 199 | + limits: |
| 200 | + cpu: {{ .Values.proxy.pgBouncer.limits.cpu }} |
| 201 | + memory: {{ .Values.proxy.pgBouncer.limits.memory }} |
| 202 | + {{ end }} |
| 203 | + affinity: |
| 204 | + podAntiAffinity: |
| 205 | + preferredDuringSchedulingIgnoredDuringExecution: |
| 206 | + - weight: 1 |
| 207 | + podAffinityTerm: |
| 208 | + topologyKey: topology.kubernetes.io/zone |
| 209 | + labelSelector: |
| 210 | + matchLabels: |
| 211 | + postgres-operator.crunchydata.com/cluster: |
| 212 | + {{ template "crunchy-postgres.fullname" . }} |
| 213 | + postgres-operator.crunchydata.com/role: pgbouncer |
0 commit comments