Skip to content

Commit

Permalink
Specify storageClassName
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillvelikov committed Aug 1, 2023
1 parent d76a999 commit 404aa7e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
2 changes: 1 addition & 1 deletion charts/pg-db/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.2
version: 2.2.3
appVersion: 2.2.0
home: https://docs.percona.com/percona-operator-for-postgresql/2.0/
maintainers:
Expand Down
13 changes: 8 additions & 5 deletions charts/pg-db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ The chart can be customized using the following configurable parameters:
| `instances.tolerations.operator` | The Kubernetes Pod tolerations operator for the PostgreSQL instance | `Equal` |
| `instances.tolerations.value` | The Kubernetes Pod tolerations value for the PostgreSQL instance | `connection-poolers` |
| `instances.priorityClassName` | The Kuberentes Pod priority class for PostgreSQL instance Pods | `high-priority` |
| `instances.walVolumeClaimSpec.storageClassName` | The Kubernetes storageClassName for the PostgreSQL Write-ahead Log storage | `""` |
| `instances.walVolumeClaimSpec.accessModes` | The Kubernetes PersistentVolumeClaim access modes for the PostgreSQL Write-ahead Log storage | `ReadWriteOnce` |
| `instances.walVolumeClaimSpec.resources.requests.storage` | The Kubernetes storage requests for the storage the PostgreSQL instance will use | `1Gi` |
| `instances.dataVolumeClaimSpec.accessModes` | The Kubernetes PersistentVolumeClaim access modes for the PostgreSQL Write-ahead Log storage | `ReadWriteOnce` |
| `instances.walVolumeClaimSpec.resources.requests.storage` | The Kubernetes storage requests for the storage the PostgreSQL instance will use | `1Gi` |
| `instances.dataVolumeClaimSpec.storageClassName` | The Kubernetes storageClassName for the PostgreSQL storage | `""` |
| `instances.dataVolumeClaimSpec.accessModes` | The Kubernetes PersistentVolumeClaim access modes for the PostgreSQL storage | `ReadWriteOnce` |
| `instances.walVolumeClaimSpec.resources.requests.storage` | The Kubernetes storage requests for the storage the PostgreSQL instance will use | `5Gi` |
| `backups.pgbackrest.metadata.labels` | Set labels for pgbackrest | `test-label:test` |
| `backups.pgbackrest.configuration.secret.name` | Name of the Kubernetes Secret object with custom pgBackRest configuration, which will be added to the pgBackRest configuration generated by the Operator | `cluster1-pgbackrest-secrets` |
| `backups.pgbackrest.jobs.priorityClassName` | The Kuberentes Pod priority class for pgBackRest jobs | `high-priority` |
Expand All @@ -107,6 +109,7 @@ The chart can be customized using the following configurable parameters:
| `backups.pgbackrest.repos.repo1.name` | Name of the pgBackRest repository for backups | `repo1` |
| `backups.pgbackrest.repos.repo1.schedules.full` | Scheduled time to make a full backup specified in the crontab format | `0 0 \* \* 6` |
| `backups.pgbackrest.repos.repo1.schedules.differential` | Scheduled time to make a differential backup specified in the crontab format | `0 0 \* \* 6` |
| `backups.pgbackrest.repos.repo1.volume.volumeClaimSpec.storageClassName` | The Kubernetes storageClassName for the pgBackRest Storage | `""` |
| `backups.pgbackrest.repos.repo1.volume.volumeClaimSpec.accessModes` | The Kubernetes PersistentVolumeClaim access modes for the pgBackRest Storage | `ReadWriteOnce` |
| `backups.pgbackrest.repos.repo1.volume.volumeClaimSpec.resources.requests.storage` | The Kubernetes storage requests for the pgBackRest storage | `1Gi` |
| `backups.pgbackrest.repos.repo3.gcs.bucket` | The Google Cloud Storage bucket | `my-bucket` |
Expand All @@ -131,7 +134,7 @@ The chart can be customized using the following configurable parameters:
| `proxy.pgBouncer.tolerations.effect` | The Kubernetes Pod tolerations effect for the PostgreSQL instance | `NoSchedule` |
| `proxy.pgBouncer.tolerations.key` | The Kubernetes Pod tolerations key for the PostgreSQL instance | `role` |
| `proxy.pgBouncer.tolerations.operator` | The Kubernetes Pod tolerations operator for the PostgreSQL instance | `Equal` |
| `proxy.pgBouncer.tolerations.value` | The Kubernetes Pod tolerations value for the PostgreSQL instance
| `proxy.pgBouncer.tolerations.value` | The Kubernetes Pod tolerations value for the PostgreSQL instance
| `proxy.pgBouncer.customTLSSecret.name` | Custom external TLS secret name | `keycloakdb-pgbouncer.tls`|
| `proxy.pgBouncer.affinity.podAntiAffinity` | Pod anti-affinity, allows setting the standard Kubernetes affinity constraints of any complexity | `{}` |
| `proxy.pgBouncer.image` | Set this variable if you need to use a custom pgbouncer image | `percona/percona-postresql-operator:1.4.0-ppg14-pgbouncer` |
Expand Down Expand Up @@ -160,7 +163,7 @@ Notice that you can use multiple replica sets only with sharding enabled.

### Deploy for tests - single PostgreSQL node and automated PVCs deletion

Such a setup is good for testing, as it does not require a lot of compute power
Such a setup is good for testing, as it does not require a lot of compute power
and performs and automated clean up of the Persistent Volume Claims (PVCs).
It also deploys just one pgBouncer node, instead of 3.
```bash
Expand All @@ -178,7 +181,7 @@ Expose the cluster's pgBouncer with a LoadBalancer:

```bash
$ helm install my-test percona/pg-db \
--set proxy.pgBouncer.expose.type=LoadBalancer
--set proxy.pgBouncer.expose.type=LoadBalancer
```

### Add a custom user and a database
Expand Down
19 changes: 14 additions & 5 deletions charts/pg-db/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
pgouser: admin
{{ include "pg-database.labels" . | indent 4 }}
finalizers:
{{ .Values.finalizers | toYaml | indent 4 }}
{{ .Values.finalizers | toYaml | indent 4 }}
name: {{ include "pg-database.fullname" . }}
spec:
crVersion: {{ .Values.crVersion}}
Expand Down Expand Up @@ -42,7 +42,7 @@ spec:
users:
{{- range $user := .Values.users }}
- name: {{ $user.name }}
{{- if $user.databases }}
{{- if $user.databases }}
databases:
{{- range $database := $user.databases }}
- {{ $database }}
Expand Down Expand Up @@ -152,15 +152,21 @@ spec:

{{- if $instance.walVolumeClaimSpec }}
walVolumeClaimSpec:
{{- if $instance.walVolumeClaimSpec.storageClassName }}
storageClassName: {{ $instance.walVolumeClaimSpec.storageClassName }}
{{- end }}
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: {{ $instance.walVolumeClaimSpec.resources.requests.storage }}
{{- end }}
dataVolumeClaimSpec:
{{- if $instance.dataVolumeClaimSpec.storageClassName }}
storageClassName: {{ $instance.dataVolumeClaimSpec.storageClassName }}
{{- end }}
accessModes:
- ReadWriteOnce
- "ReadWriteOnce"
resources:
requests:
storage: {{ $instance.dataVolumeClaimSpec.resources.requests.storage }}
Expand Down Expand Up @@ -323,11 +329,14 @@ spec:
full: {{ $repo.schedules.full }}
volume:
volumeClaimSpec:
{{- if $repo.volume.volumeClaimSpec.storageClassName }}
storageClassName: {{ $repo.volume.volumeClaimSpec.storageClassName }}
{{- end }}
accessModes:
- ReadWriteOnce
- "ReadWriteOnce"
resources:
requests:
storage: {{ $repo.volume.volumeClaimSpec.resources.requests.storage}}
storage: {{ $repo.volume.volumeClaimSpec.resources.requests.storage }}
{{- end }}
{{- if eq $repo.name "repo2" }}
s3:
Expand Down
7 changes: 5 additions & 2 deletions charts/pg-db/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,17 @@ instances:
# priorityClassName: high-priority
#
# walVolumeClaimSpec:
# storageClassName: ""
# accessModes:
# - "ReadWriteOnce"
# resources:
# requests:
# storage: 1Gi
#
dataVolumeClaimSpec:
storageClassName: ""
accessModes:
- ReadWriteOnce
- "ReadWriteOnce"
resources:
requests:
storage: 5Gi
Expand Down Expand Up @@ -227,8 +229,9 @@ backups:
# differential: "0 1 * * 1-6"
volume:
volumeClaimSpec:
storageClassName: ""
accessModes:
- ReadWriteOnce
- "ReadWriteOnce"
resources:
requests:
storage: 1Gi
Expand Down

0 comments on commit 404aa7e

Please sign in to comment.