diff --git a/Makefile b/Makefile index 29b256f2eb..ac2030a883 100644 --- a/Makefile +++ b/Makefile @@ -12,15 +12,12 @@ docs: ## Generate charts' docs using helm-docs (echo "Please, install https://github.com/norwoodj/helm-docs first" && exit 1) .PHONY: schema -schema: ## Generate charts' schema usign helm schema-gen plugin - @helm schema-gen charts/cloudnative-pg/values.yaml > charts/cloudnative-pg/values.schema.json || \ - (echo "Please, run: helm plugin install https://github.com/karuppiah7890/helm-schema-gen.git" && exit 1) +schema: cloudnative-pg-schema cluster-schema ## Generate charts' schema using helm-schema-gen -.PHONY: pgbench-deploy -pgbench-deploy: ## Installs pgbench chart - helm dependency update charts/pgbench - helm upgrade --install pgbench --atomic charts/pgbench +cloudnative-pg-schema: + @helm schema-gen charts/cloudnative-pg/values.yaml | cat > charts/cloudnative-pg/values.schema.json || \ + (echo "Please, run: helm plugin install https://github.com/karuppiah7890/helm-schema-gen.git" && exit 1) -.PHONY: pgbench-uninstall -pgbench-uninstall: ## Uninstalls cnpg-pgbench chart if present - @helm uninstall pgbench +cluster-schema: + @helm schema-gen charts/cluster/values.yaml | cat > charts/cluster/values.schema.json || \ + (echo "Please, run: helm plugin install https://github.com/karuppiah7890/helm-schema-gen.git" && exit 1) diff --git a/charts/cluster/README.md b/charts/cluster/README.md index d334c43894..8126853641 100644 --- a/charts/cluster/README.md +++ b/charts/cluster/README.md @@ -88,9 +88,9 @@ Additionally you can specify the following parameters: ```yaml backups: scheduledBackups: - - name: daily-backup - schedule: "0 0 0 * * *" # Daily at midnight - backupOwnerReference: self + - name: daily-backup + schedule: "0 0 0 * * *" # Daily at midnight + backupOwnerReference: self ``` Each backup adapter takes it's own set of parameters, listed in the [Configuration options](#Configuration-options) section @@ -149,8 +149,10 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat | cluster.instances | int | `3` | Number of instances | | cluster.logLevel | string | `"info"` | The instances' log level, one of the following values: error, warning, info (default), debug, trace | | cluster.monitoring.customQueries | list | `[]` | | -| cluster.monitoring.enablePodMonitor | bool | `false` | | -| cluster.postgresql | string | `nil` | Configuration of the PostgreSQL server See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-PostgresConfiguration | +| cluster.monitoring.enabled | bool | `false` | | +| cluster.monitoring.podMonitor.enabled | bool | `true` | | +| cluster.monitoring.prometheusRule.enabled | bool | `true` | | +| cluster.postgresql | object | `{}` | Configuration of the PostgreSQL server See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-PostgresConfiguration | | cluster.primaryUpdateMethod | string | `"switchover"` | Method to follow to upgrade the primary server during a rolling update procedure, after all replicas have been successfully updated. It can be switchover (default) or in-place (restart). | | cluster.primaryUpdateStrategy | string | `"unsupervised"` | Strategy to follow to upgrade the primary server during a rolling update procedure, after all replicas have been successfully updated: it can be automated (unsupervised - default) or manual (supervised) | | cluster.priorityClassName | string | `""` | | diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json new file mode 100644 index 0000000000..49550780b0 --- /dev/null +++ b/charts/cluster/values.schema.json @@ -0,0 +1,342 @@ +{ + "$schema": "http://json-schema.org/schema#", + "type": "object", + "properties": { + "backups": { + "type": "object", + "properties": { + "azure": { + "type": "object", + "properties": { + "connectionString": { + "type": "string" + }, + "containerName": { + "type": "string" + }, + "inheritFromAzureAD": { + "type": "boolean" + }, + "path": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "storageAccount": { + "type": "string" + }, + "storageKey": { + "type": "string" + }, + "storageSasToken": { + "type": "string" + } + } + }, + "destinationPath": { + "type": "string" + }, + "enabled": { + "type": "boolean" + }, + "endpointURL": { + "type": "string" + }, + "google": { + "type": "object", + "properties": { + "applicationCredentials": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "gkeEnvironment": { + "type": "boolean" + }, + "path": { + "type": "string" + } + } + }, + "provider": { + "type": "string" + }, + "retentionPolicy": { + "type": "string" + }, + "s3": { + "type": "object", + "properties": { + "accessKey": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "path": { + "type": "string" + }, + "region": { + "type": "string" + }, + "secretKey": { + "type": "string" + } + } + }, + "scheduledBackups": { + "type": "array", + "items": { + "type": "object", + "properties": { + "backupOwnerReference": { + "type": "string" + }, + "name": { + "type": "string" + }, + "schedule": { + "type": "string" + } + } + } + } + } + }, + "cluster": { + "type": "object", + "properties": { + "additionalLabels": { + "type": "object" + }, + "affinity": { + "type": "object", + "properties": { + "topologyKey": { + "type": "string" + } + } + }, + "annotations": { + "type": "object" + }, + "certificates": { + "type": "null" + }, + "enableSuperuserAccess": { + "type": "boolean" + }, + "imageName": { + "type": "string" + }, + "imagePullPolicy": { + "type": "string" + }, + "imagePullSecrets": { + "type": "array" + }, + "initdb": { + "type": "object" + }, + "instances": { + "type": "integer" + }, + "logLevel": { + "type": "string" + }, + "monitoring": { + "type": "object", + "properties": { + "customQueries": { + "type": "array" + }, + "enabled": { + "type": "boolean" + }, + "podMonitor": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, + "prometheusRule": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + } + } + }, + "postgresql": { + "type": "object" + }, + "primaryUpdateMethod": { + "type": "string" + }, + "primaryUpdateStrategy": { + "type": "string" + }, + "priorityClassName": { + "type": "string" + }, + "resources": { + "type": "null" + }, + "storage": { + "type": "object", + "properties": { + "size": { + "type": "string" + }, + "storageClass": { + "type": "string" + } + } + }, + "superuserSecret": { + "type": "string" + } + } + }, + "fullnameOverride": { + "type": "string" + }, + "mode": { + "type": "string" + }, + "nameOverride": { + "type": "string" + }, + "pooler": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + }, + "instances": { + "type": "integer" + }, + "parameters": { + "type": "object", + "properties": { + "default_pool_size": { + "type": "string" + }, + "max_client_conn": { + "type": "string" + } + } + }, + "poolMode": { + "type": "string" + } + } + }, + "recovery": { + "type": "object", + "properties": { + "azure": { + "type": "object", + "properties": { + "connectionString": { + "type": "string" + }, + "containerName": { + "type": "string" + }, + "inheritFromAzureAD": { + "type": "boolean" + }, + "path": { + "type": "string" + }, + "serviceName": { + "type": "string" + }, + "storageAccount": { + "type": "string" + }, + "storageKey": { + "type": "string" + }, + "storageSasToken": { + "type": "string" + } + } + }, + "backupName": { + "type": "string" + }, + "clusterName": { + "type": "string" + }, + "destinationPath": { + "type": "string" + }, + "endpointURL": { + "type": "string" + }, + "google": { + "type": "object", + "properties": { + "applicationCredentials": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "gkeEnvironment": { + "type": "boolean" + }, + "path": { + "type": "string" + } + } + }, + "method": { + "type": "string" + }, + "pitrTarget": { + "type": "object", + "properties": { + "time": { + "type": "string" + } + } + }, + "provider": { + "type": "string" + }, + "s3": { + "type": "object", + "properties": { + "accessKey": { + "type": "string" + }, + "bucket": { + "type": "string" + }, + "path": { + "type": "string" + }, + "region": { + "type": "string" + }, + "secretKey": { + "type": "string" + } + } + } + } + }, + "type": { + "type": "string" + } + } +}