diff --git a/charts/pg-db/Chart.yaml b/charts/pg-db/Chart.yaml index d59f1c43..cc1dfa8d 100644 --- a/charts/pg-db/Chart.yaml +++ b/charts/pg-db/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: pg-db description: 'A Helm chart to deploy the PostgreSQL database with the Percona Operator for PostgreSQL' type: application -version: 2.2.3 +version: 2.2.5 appVersion: 2.2.0 home: https://docs.percona.com/percona-operator-for-postgresql/2.0/ maintainers: diff --git a/charts/pg-db/templates/cluster.yaml b/charts/pg-db/templates/cluster.yaml index 5c053003..41d0edcf 100644 --- a/charts/pg-db/templates/cluster.yaml +++ b/charts/pg-db/templates/cluster.yaml @@ -34,10 +34,8 @@ spec: {{- end }} {{- end }} - {{- if .Values.openshift }} - openshift: .Values.openshift - {{- end }} - + openshift: {{ default false .Values.openshift }} + {{- if .Values.users }} users: {{- range $user := .Values.users }} @@ -99,16 +97,11 @@ spec: expose: type: {{ .Values.expose.type }} annotations: - {{- range $annotation := .Values.expose.annotations}} - $annotation - {{- end }} + {{ .Values.expose.annotations | toYaml | indent 6 }} labels: - {{- range $label := .Values.expose.labels}} - $labels - {{- end }} + {{ .Values.expose.labels | toYaml | indent 6 }} {{- end }} - instances: {{- range $instance := .Values.instances }} - name: {{ $instance.name }} @@ -128,14 +121,14 @@ spec: {{- end }} {{- if $instance.topologySpreadConstraints }} topologySpreadConstraints: - - maxSkew: {{ $instance.topologySpreadConstraints.maxSkew}} - topologyKey: {{ $instance.topologySpreadConstraints.topologyKey }} - whenUnsatisfiable: {{ $instance.topologySpreadConstraints.whenUnsatisfiable}} - labelSelector: - matchLabels: - {{- range $label := $instance.topologySpreadConstraints.labelSelector.matchLabels}} - $label - {{- end }} + {{- range $constraint := $instance.topologySpreadConstraints }} + - maxSkew: {{ $constraint.maxSkew }} + topologyKey: {{ $constraint.topologyKey }} + whenUnsatisfiable: {{ $constraint.whenUnsatisfiable }} + labelSelector: + matchLabels: + {{ $constraint.labelSelector.matchLabels | toYaml | indent 6 }} + {{- end }} {{- end }} {{- if $instance.tolerations }} @@ -188,13 +181,9 @@ spec: expose: type: {{ .Values.proxy.pgBouncer.expose.type }} annotations: - {{- range $annotation := .Values.proxy.pgBouncer.expose.annotations}} - $annotation - {{- end }} + {{ .Values.proxy.pgBouncer.expose.annotations | toYaml | indent 10 }} labels: - {{- range $label := .Values.proxy.pgBouncer.expose.labels}} - $labels - {{- end }} + {{.Values.proxy.pgBouncer.expose.labels | toYaml | indent 10 }} {{- end }} {{- if .Values.proxy.pgBouncer.sidecars }} sidecars: @@ -210,35 +199,30 @@ spec: {{- if .Values.proxy.pgBouncer.config }} config: global: - {{- range $setting := .Values.proxy.pgBouncer.config.global }} - $setting - {{- end }} + {{ .Values.proxy.pgBouncer.config.global | toYaml | indent 10 }} {{- end }} {{- if .Values.proxy.pgBouncer.topologySpreadConstraints }} topologySpreadConstraints: - - maxSkew: {{.Values.proxy.pgBouncer.topologySpreadConstraints.maxSkew}} - topologyKey: {{ .Values.proxy.pgBouncer.topologySpreadConstraints.topologyKey }} - whenUnsatisfiable: {{ .Values.proxy.pgBouncer.topologySpreadConstraints.whenUnsatisfiable}} - labelSelector: - matchLabels: - {{- range $label := .Values.proxy.pgBouncer.topologySpreadConstraints.labelSelector.matchLabels}} - $label - {{- end }} + {{- range $constraint := .Values.proxy.pgBouncer.topologySpreadConstraints }} + - maxSkew: {{ $constraint.maxSkew }} + topologyKey: {{ $constraint.topologyKey }} + whenUnsatisfiable: {{ $constraint.whenUnsatisfiable }} + labelSelector: + matchLabels: + {{ $constraint.labelSelector.matchLabels | toYaml | indent 6 }} + {{- end }} {{- end }} - {{- if .Values.proxy.pgBouncer.affinity }} affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - - weight: {{ .Values.proxy.pgBouncer.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight }} - podAffinityTerm: - labelSelector: - matchLabels: - {{- range $label := .Values.proxy.pgBouncer.affinity.podAntiAffinity.podAffinityTerm.labelSelector.matchLabels }} - $label - {{- end }} - topologyKey: {{ .Values.proxy.pgBouncer.affinity.podAntiAffinity.podAffinityTerm.topologyKey }} + - weight: {{ .Values.proxy.pgBouncer.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight }} + podAffinityTerm: + labelSelector: + matchLabels: +{{ .Values.proxy.pgBouncer.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchLabels | toYaml | indent 18 }} + topologyKey: {{ .Values.proxy.pgBouncer.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.topologyKey }} {{- end }} {{- if .Values.proxy.pgBouncer.tolerations }} tolerations: @@ -279,36 +263,32 @@ spec: {{- end }} {{- if .Values.backups.pgbackrest.global }} global: - {{- range $setting := .Values.backups.pgbackrest.global }} - $setting - {{- end }} + {{ .Values.backups.pgbackrest.global | toYaml | indent 8 }} {{- end }} {{- if .Values.backups.pgbackrest.repoHost }} repoHost: priorityClassName: {{ .Values.backups.pgbackrest.repoHost.priorityClassName }} {{- if .Values.backups.pgbackrest.repoHost.topologySpreadConstraints }} topologySpreadConstraints: - - maxSkew: {{.Values.backups.pgbackrest.repoHost.topologySpreadConstraints.maxSkew}} - topologyKey: {{ .Values.backups.pgbackrest.repoHost.topologySpreadConstraints.topologyKey }} - whenUnsatisfiable: {{ .Values.backups.pgbackrest.repoHost.topologySpreadConstraints.whenUnsatisfiable }} - labelSelector: - matchLabels: - {{- range $label := .Values.backups.pgbackrest.repoHost.topologySpreadConstraints.labelSelector.matchLabels }} - $label - {{- end }} + {{- range $constraint := .Values.backups.pgbackrest.repoHost.topologySpreadConstraints }} + - maxSkew: {{ $constraint.maxSkew }} + topologyKey: {{ $constraint.topologyKey }} + whenUnsatisfiable: {{ $constraint.whenUnsatisfiable }} + labelSelector: + matchLabels: + {{ $constraint.labelSelector.matchLabels | toYaml | indent 6 }} + {{- end }} {{- end }} {{- if .Values.backups.pgbackrest.repoHost.affinity }} affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - - weight: {{ .Values.backups.pgbackrest.repoHost.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight }} - podAffinityTerm: - labelSelector: - matchLabels: - {{- range $label := .Values.backups.pgbackrest.repoHost.affinity.podAntiAffinity.podAffinityTerm.labelSelector.matchLabels }} - $label - {{- end }} - topologyKey: {{ .Values.backups.pgbackrest.repoHost.affinity.podAntiAffinity.podAffinityTerm.topologyKey }} + - weight: {{ .Values.backups.pgbackrest.repoHost.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.weight }} + podAffinityTerm: + labelSelector: + matchLabels: +{{ .Values.backups.pgbackrest.repoHost.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.labelSelector.matchLabels | toYaml | indent 18 }} + topologyKey: {{ .Values.backups.pgbackrest.repoHost.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution.podAffinityTerm.topologyKey }} {{- end }} {{- end }} manual: @@ -344,26 +324,16 @@ spec: container: {{ $repo.azure.container}} {{- end }} {{- end }} - {{- if .Values.backups.pgbackrest.restore }} - restore: - enabled: {{ .Values.backups.pgbackrest.restore.enabled }} - repoName: {{ .Values.backups.pgbackrest.restore.repoName }} - {{- if .Values.backups.pgbackrest.options }} - options: - {{- range $option := .Values.backups.pgbackrest.options }} -# PITR restore in place - - $option - {{- end }} - {{- end }} - {{- end }} - {{- if .Values.patroni}} - patroni: - dynamicConfiguration: - postgresql: - parameters: - max_parallel_workers: {{ .Values.patroni.dynamicConfiguration.postgresql.parameters.max_parallel_workers }} - max_worker_processes: {{ .Values.patroni.dynamicConfiguration.postgresql.parameters.max_worker_processes }} - shared_buffers: {{ .Values.patroni.dynamicConfiguration.postgresql.parameters.shared_buffers }} - work_mem: {{ .Values.patroni.dynamicConfiguration.postgresql.parameters.work_mem }} - {{- end }} + +{{- if .Values.patroni }} + patroni: + dynamicConfiguration: + postgresql: + parameters: + {{- .Values.patroni.dynamicConfiguration.postgresql.parameters | toYaml | nindent 10 }} + pg_hba: + {{- range $pg_hba_entry := .Values.patroni.dynamicConfiguration.postgresql.pg_hba }} + - {{ $pg_hba_entry }} + {{- end }} +{{- end }} diff --git a/charts/pg-db/values.yaml b/charts/pg-db/values.yaml index f04ddc74..3bf181ea 100644 --- a/charts/pg-db/values.yaml +++ b/charts/pg-db/values.yaml @@ -244,15 +244,6 @@ backups: # azure: # container: "" # -# restore: -# enabled: true -# repoName: repo1 -# options: -# PITR restore in place -# - --type=time -# - --target="2021-06-09 14:15:11-04" -# restore individual databases -# - --db-include=hippo pmm: enabled: false diff --git a/charts/pxc-operator/Chart.yaml b/charts/pxc-operator/Chart.yaml index 030c79dc..949e0e38 100644 --- a/charts/pxc-operator/Chart.yaml +++ b/charts/pxc-operator/Chart.yaml @@ -3,7 +3,7 @@ appVersion: 1.13.0 description: A Helm chart for deploying the Percona Operator for MySQL (based on Percona XtraDB Cluster) name: pxc-operator home: https://docs.percona.com/percona-operator-for-mysql/pxc/ -version: 1.13.0 +version: 1.13.1 maintainers: - name: tplavcic email: tomislav.plavcic@percona.com diff --git a/charts/pxc-operator/README.md b/charts/pxc-operator/README.md index ac5e178f..75b4acbe 100644 --- a/charts/pxc-operator/README.md +++ b/charts/pxc-operator/README.md @@ -28,6 +28,7 @@ The chart can be customized using the following configurable parameters: | ------------------------------- | -----------------------------------------------------------------------------------------------| -------------------------------------------------| | `image` | PXC Operator Container image full path | `percona/percona-xtradb-cluster-operator:1.13.0` | | `imagePullPolicy` | PXC Operator Container pull policy | `Always` | +| `containerSecurityContext` | PXC Operator Container securityContext | `{}` | | `imagePullSecrets` | PXC Operator Pod pull secret | `[]` | | `replicaCount` | PXC Operator Pod quantity | `1` | | `tolerations` | List of node taints to tolerate | `[]` | diff --git a/charts/pxc-operator/templates/deployment.yaml b/charts/pxc-operator/templates/deployment.yaml index 5f70d75c..2a2dc98d 100644 --- a/charts/pxc-operator/templates/deployment.yaml +++ b/charts/pxc-operator/templates/deployment.yaml @@ -67,6 +67,10 @@ spec: scheme: HTTP resources: {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.containerSecurityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/pxc-operator/values.yaml b/charts/pxc-operator/values.yaml index 24c3f506..725945f0 100644 --- a/charts/pxc-operator/values.yaml +++ b/charts/pxc-operator/values.yaml @@ -45,6 +45,8 @@ resources: cpu: 100m memory: 20Mi +containerSecurityContext: {} + nodeSelector: {} tolerations: []