From 99ef8dba656775ca50a0a3614e53672e397021a0 Mon Sep 17 00:00:00 2001 From: Tarun Singh Date: Tue, 24 Dec 2024 18:39:06 +0530 Subject: [PATCH] Updated readme and values Signed-off-by: Tarun Singh --- charts/pg-operator-db/README.md | 41 ++++++++++++++++++++ charts/pg-operator-db/templates/backup.yaml | 8 ++++ charts/pg-operator-db/templates/restore.yaml | 8 ++++ charts/pg-operator-db/values.yaml | 10 +++++ 4 files changed, 67 insertions(+) diff --git a/charts/pg-operator-db/README.md b/charts/pg-operator-db/README.md index c579fa4..98877a7 100644 --- a/charts/pg-operator-db/README.md +++ b/charts/pg-operator-db/README.md @@ -22,6 +22,23 @@ helm install my-db --namespace my-namespace The chart can be customized using the following configurable parameters: +#These parameters are for pg-operator: + +| Parameter | Description | Default | +| -------------------- | ---------------------------------------------------------------------------------- | ------------------------------------------- | +| `image` | PG Operator Container image full path | `percona/percona-postgresql-operator:2.5.0` | +| `imagePullPolicy` | PG Operator Container pull policy | `Always` | +| `resources` | Resource requests and limits | `{}` | +| `nodeSelector` | Labels for Pod assignment | `{}` | +| `logStructured` | Force PG operator to print JSON-wrapped log messages | `false` | +| `logLevel` | PG Operator logging level | `INFO` | +| `disableTelemetry` | Disable sending PG Operator telemetry data to Percona | `false` | +| `podAnnotations` | Add annotations to the Operator Pod | `{}` | +| `watchNamespace` | Set this variable if the target cluster namespace differs from operators namespace | `` | +| `watchAllNamespaces` | K8S Cluster-wide operation | `false` + +#These parameters are for pg-db: + | Parameter | Description | Default | | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | | `finalizers` | Finalizers list | `{}` | @@ -222,6 +239,30 @@ The chart can be customized using the following configurable parameters: | `secrets.pgbouncer` | pgbouncer user password | `autogenerated by operator` | | `secrets.` | Default user password | `autogenerated by operator` | +# Parameters for Backup + +| Parameter | Description | +| --------------- | -------------------------------------------------- | +| `enabled` | Specifies whether the backup is enabled | +| `annotations` | Annotations for the resource | +| `name` | Name of the backup resource | +| `labels` | Labels for the resource | +| `pgCluster` | Name of the PostgreSQL cluster to backup | +| `repoName` | Name of the storage configuration for the backup | +| `options` | Additional options for the backup operation | + +# Parameters for Restore + +| Parameter | Description | +| --------------- | -------------------------------------------------- | +| `enabled` | Specifies whether the restore is enabled | +| `annotations` | Annotations for the resource | +| `name` | Name of the restore resource | +| `labels` | Labels for the resource | +| `pgCluster` | Name of the PostgreSQL cluster to restore | +| `repoName` | Name of the backup repository to restore from | +| `options` | Additional options for the restore operation | + Specify parameters using `--set key=value[,key=value]` argument to `helm install` Notice that you can use multiple replica sets only with sharding enabled. diff --git a/charts/pg-operator-db/templates/backup.yaml b/charts/pg-operator-db/templates/backup.yaml index 0f4ea42..2c6bdd5 100644 --- a/charts/pg-operator-db/templates/backup.yaml +++ b/charts/pg-operator-db/templates/backup.yaml @@ -3,6 +3,14 @@ apiVersion: pgv2.percona.com/v2 kind: PerconaPGBackup metadata: name: {{ .Values.backup.name }} +{{- if .Values.backup.annotations }} + annotations: +{{ .Values.backup.annotations | toYaml | indent 4 }} +{{- end }} +{{- if .Values.backup.labels }} + labels: +{{ .Values.backup.labels | toYaml | indent 4 }} +{{- end }} spec: pgCluster: {{ .Values.backup.pgCluster }} repoName: {{ .Values.backup.repoName }} diff --git a/charts/pg-operator-db/templates/restore.yaml b/charts/pg-operator-db/templates/restore.yaml index e6e34fa..0d8b69f 100644 --- a/charts/pg-operator-db/templates/restore.yaml +++ b/charts/pg-operator-db/templates/restore.yaml @@ -3,6 +3,14 @@ apiVersion: pgv2.percona.com/v2 kind: PerconaPGRestore metadata: name: {{ .Values.restore.name }} +{{- if .Values.restore.annotations }} + annotations: +{{ .Values.restore.annotations | toYaml | indent 4 }} +{{- end }} +{{- if .Values.restore.labels }} + labels: +{{ .Values.restore.labels | toYaml | indent 4 }} +{{- end }} spec: pgCluster: {{ .Values.restore.pgCluster }} repoName: {{ .Values.restore.repoName }} diff --git a/charts/pg-operator-db/values.yaml b/charts/pg-operator-db/values.yaml index b5b8c2b..23928d4 100644 --- a/charts/pg-operator-db/values.yaml +++ b/charts/pg-operator-db/values.yaml @@ -643,7 +643,12 @@ pg-db: backup: enabled: true + annotations: + description: "test" name: backup1 + labels: + app: postgres-backup + environment: testing pgCluster: postgres-pg-db repoName: repo4 options: @@ -651,7 +656,12 @@ backup: restore: enabled: true + annotations: + description: "test" name: restore1 + labels: + app: postgres-restore + environment: testing pgCluster: postgres-pg-db repoName: repo4 options: