forked from cloudnative-pg/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add chart for pgbench (cloudnative-pg#43)
Signed-off-by: Jitendra Wadle <[email protected]> Signed-off-by: Gabriele Bartolini <[email protected]> Signed-off-by: Hai He <[email protected]> Co-authored-by: Gabriele Bartolini <[email protected]> Co-authored-by: Hai He <[email protected]>
- Loading branch information
1 parent
7ab800f
commit 1892b17
Showing
12 changed files
with
797 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# | ||
# Copyright The CloudNativePG Contributors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
apiVersion: v2 | ||
name: pgbench | ||
description: A Helm chart that starts a CNPG Cluster and executes a | ||
PgBench job on it. | ||
type: application | ||
version: 0.1.0 | ||
home: https://cloudnative-pg.io | ||
sources: | ||
- https://github.com/cloudnative-pg/charts | ||
|
||
maintainers: | ||
- name: Jitendra | ||
email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# pgbench | ||
|
||
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) | ||
|
||
A Helm chart that starts a CNPG Cluster and executes a PgBench job on it. | ||
|
||
**Homepage:** <https://cloudnative-pg.io> | ||
|
||
## Maintainers | ||
|
||
| Name | Email | Url | | ||
| ---- | ------ | --- | | ||
| Jitendra | <[email protected]> | | | ||
|
||
## Source Code | ||
|
||
* <https://github.com/cloudnative-pg/charts> | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| cnpg.existingCluster | bool | `false` | Whether the benchmark should be run against an existing cluster or a new one has to be created | | ||
| cnpg.existingCredentials | string | `""` | The name of a Secret of type basic-auth containing the existing cluster credentials | | ||
| cnpg.existingDatabase | string | `""` | The port where PostgreSQL is listening on the specified host (default: 5432) | | ||
| cnpg.existingHost | string | `""` | The address of the existing cluster (default: empty) | | ||
| cnpg.existingPort | string | `""` | The name of the existing database (default: empty) | | ||
| cnpg.image | string | `"ghcr.io/cloudnative-pg/postgresql:14.5"` | The PostgreSQL image used by CNPG and PgBench. | | ||
| cnpg.instances | int | `1` | The amount of PostgreSQL instances in the CNPG Cluster. | | ||
| cnpg.monitoring | object | `{"customQueriesConfigMap":[],"customQueriesSecret":[]}` | Configures custom queries for monitoring. The arrays accept a Dictionary made by name: string (resource name), key: string (resource data field containing the queries). Documentation on the accepted values: https://docs.enterprisedb.io/cloud-native-postgresql/latest/monitoring/ | | ||
| cnpg.nodeSelector | object | `{"workload":"postgres"}` | Dictionary of key-value pairs used to define the nodes where the cluster instances can run; used to avoid pgbench and PostgreSQL running on the same node. | | ||
| cnpg.pooler.instances | int | `0` | The number of pooler replicas that receive the connections. If >0 the benchmarks are run with connection pooling | | ||
| cnpg.pooler.nodeSelector.workload | string | `"pooler"` | | | ||
| cnpg.pooler.pgbouncer.parameters | object | `{}` | PgBouncer configuration. | | ||
| cnpg.pooler.pgbouncer.poolMode | string | `"session"` | The pool mode, accepted values: session, transaction | | ||
| cnpg.postgreSQLParameters | object | `{"log_autovacuum_min_duration":"1s","log_checkpoints":"on","log_lock_waits":"on","log_min_duration_statement":"1000","log_statement":"ddl","log_temp_files":"1024","maintenance_work_mem":"128MB","shared_buffers":"512MB"}` | Dictionary of key-value pairs representing PostgreSQL configuration. | | ||
| cnpg.storage.size | string | `"1Gi"` | The size of the PVCs used by CNPG instances. | | ||
| cnpg.storage.storageClass | string | `""` | The storage class used to create PVCs for CNPG instances. | | ||
| pgbench.clients | int | `1` | The number of clients used by pgbench. | | ||
| pgbench.initialize | bool | `true` | Invoke the initialization mode (TPC-B-like test scenario) | | ||
| pgbench.jobs | int | `1` | The number of jobs used by pgbench. | | ||
| pgbench.nodeSelector | object | `{"workload":"pgbench"}` | Dictionary of key-value pairs used to define the nodes where the pgbench pod can run; used to avoid pgbench and PostgreSQL running on the same node. | | ||
| pgbench.reportLatencies | bool | `false` | Report the average per-statement latency (execution time from the perspective of the client) of each command after the benchmark finishes. See below for details | | ||
| pgbench.scaleFactor | int | `1` | Scale factor used to initialize pgbench (if initialize is set to true). | | ||
| pgbench.skipVacuum | bool | `false` | Perform no vacuuming before running the test. | | ||
| pgbench.time | int | `30` | The amount of seconds the pgbench will run for. | | ||
| pgbench.warmTime | int | `0` | If >0, run an initContainer that runs pgbench for the defined amount of time (using the -T option) with the same clients and jobs that will be used for the main pgbench run; can be useful with storage classes that allow I/O bursts where could affect the actual benchmark result. | | ||
|
||
---------------------------------------------- | ||
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{{ if .Values.cnpg.nodeSelector -}} | ||
Make sure at least a node has the following labels to be able to schedule the | ||
{{ include "pgbench.fullname" . }} CNPG cluster: | ||
{{- toYaml .Values.cnpg.nodeSelector | nindent 2}} | ||
{{- end }} | ||
|
||
{{ if .Values.pgbench.nodeSelector -}} | ||
Make sure at least a node has the following labels to be able to schedule the | ||
{{ include "pgbench.fullname" . }} job running pgbench: | ||
{{- toYaml .Values.pgbench.nodeSelector | nindent 2}} | ||
{{- end }} | ||
|
||
{{ if .Values.cnpg.pooler.instances -}} | ||
The benchmark is being run with connection pooling. | ||
Make sure at least a node has the following labels to be able to schedule the | ||
pooler-{{ include "pgbench.fullname" . }} pooler: | ||
{{- toYaml .Values.cnpg.pooler.nodeSelector | nindent 2}} | ||
{{ end }} | ||
|
||
After the {{ include "pgbench.fullname" . }} job completes run | ||
|
||
kubectl logs -n {{ .Release.Namespace }} job/{{ include "pgbench.fullname" . }} | ||
|
||
to gather the pgbench results. You can then uninstall the chart | ||
|
||
helm uninstall {{ .Release.Name }} -n {{ .Release.Namespace }} |
Oops, something went wrong.