Skip to content

Commit

Permalink
Updated documentation and schema for the cluster chart
Browse files Browse the repository at this point in the history
Signed-off-by: Itay Grudev <[email protected]>
  • Loading branch information
itay-grudev committed Feb 22, 2024
1 parent 1ca6121 commit 68f44da
Show file tree
Hide file tree
Showing 3 changed files with 356 additions and 15 deletions.
17 changes: 7 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
12 changes: 7 additions & 5 deletions charts/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 | `""` | |
Expand Down
342 changes: 342 additions & 0 deletions charts/cluster/values.schema.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}

0 comments on commit 68f44da

Please sign in to comment.