Skip to content

Commit

Permalink
Renamed chart to paradedb-cluster (#22)
Browse files Browse the repository at this point in the history
Co-authored-by: Philippe Noël <[email protected]>
  • Loading branch information
itay-grudev and philippemnoel committed Sep 21, 2024
1 parent 90239ca commit 59f001e
Show file tree
Hide file tree
Showing 154 changed files with 235 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/paradedb-publish-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Set Helm Chart Release Versions
id: set_versions
working-directory: charts/cluster/
working-directory: charts/paradedb-cluster/
env:
GH_TOKEN: ${{ secrets.GHA_CREATE_RELEASE_PAT }}
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/paradedb-test-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- "charts/cluster/*"
- "charts/paradedb-cluster/*"
- ".github/workflows/paradedb-test-eks.yml"
repository_dispatch:
workflow_dispatch:
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
kubectl get svc -n cnpg-system cnpg-webhook-service
- name: Test Helm Dependency Update
working-directory: charts/cluster/
working-directory: charts/paradedb-cluster/
run: helm dependency update . --debug

- name: Fetch the latest ParadeDB release tag
Expand All @@ -108,11 +108,11 @@ jobs:
echo "version=$CLEANED_TAG" >> $GITHUB_OUTPUT
- name: Test Helm Install
working-directory: charts/cluster/
working-directory: charts/paradedb-cluster/
run: helm install paradedb . --namespace paradedb --create-namespace --set version.paradedb=${{ steps.paradedb-version.outputs.version }} --debug

- name: Test Helm Upgrade
working-directory: charts/cluster/
working-directory: charts/paradedb-cluster/
run: helm upgrade paradedb . --namespace paradedb --reuse-values --wait --debug

- name: Test PostgreSQL Connection
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-cluster-chainsaw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'gh-pages'

jobs:
test-cluster-standalone:
test-cluster-chainsaw:
runs-on: ubuntu-22.04
steps:
- name: Checkout
Expand All @@ -15,7 +15,7 @@ jobs:
fetch-depth: 0

- name: Set ParadeDB Version to Latest
working-directory: charts/cluster/
working-directory: charts/paradedb-cluster/
env:
GH_TOKEN: ${{ secrets.GHA_CREATE_RELEASE_PAT }}
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
- id: check-docstring-first
- id: check-symlinks
- id: check-yaml
exclude: "charts/cluster/" # Exclude all files in the charts/cluster/ directory, which aren't standard YAML
exclude: "charts/paradedb-cluster/" # Exclude all files in the charts/paradedb-cluster/ directory, which aren't standard YAML
- id: check-json
- id: check-xml
- id: check-ast
Expand All @@ -41,4 +41,4 @@ repos:
rev: v3.0.3
hooks:
- id: prettier
exclude: "charts/cluster/" # Exclude all files in the charts/cluster/ directory, which aren't standard YAML
exclude: "charts/paradedb-cluster/" # Exclude all files in the charts/paradedb-cluster/ directory, which aren't standard YAML
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ docs: ## Generate charts' docs using helm-docs
schema: cluster-schema ## Generate charts' schema using helm-schema-gen

cluster-schema:
@helm schema-gen charts/cluster/values.yaml | cat > charts/cluster/values.schema.json || \
@helm schema-gen charts/paradedb-cluster/values.yaml | cat > charts/paradedb-cluster/values.schema.json || \
(echo "Please, run: helm plugin install https://github.com/karuppiah7890/helm-schema-gen.git" && exit 1)
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ cnpg/cloudnative-pg

### Setting up a ParadeDB CNPG Cluster

Create a `values.yaml` and configure it to your requirements. Here is a basic example:

```yaml
type: paradedb
mode: standalone

cluster:
instances: 2
storage:
size: 256Mi
```
You can refer to the other examples in the [`charts/cluster/examples`](https://github.com/paradedb/charts/tree/main/charts/cluster/examples) directory.

```console
helm repo add paradedb https://paradedb.github.io/charts
helm upgrade --install paradedb \
Expand All @@ -57,7 +71,7 @@ helm upgrade --install paradedb \
paradedb/cluster
```

Refer to the [CloudNativePG Cluster Chart documentation](charts/cluster/README.md) for advanced configuration options.
Refer to the [CloudNativePG Cluster Chart documentation](charts/paradedb-cluster/README.md) for advanced configuration options.

## License

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# limitations under the License.
#
apiVersion: v2
name: cluster
name: paradedb-cluster
description: Deploys and manages a ParadeDB CloudNativePG cluster and its associated resources.
icon: https://raw.githubusercontent.com/paradedb/paradedb/main/docs/logo/light.svg
type: application
Expand All @@ -35,3 +35,4 @@ home: https://paradedb.com
maintainers:
- name: ParadeDB
email: [email protected]
url: https://paradedb.com
20 changes: 9 additions & 11 deletions charts/cluster/README.md → charts/paradedb-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ cluster:
You can refer to the other examples in the [`charts/cluster/examples`](https://github.com/paradedb/charts/tree/main/charts/cluster/examples) directory.

```yaml
```console
helm repo add paradedb https://paradedb.github.io/charts
helm upgrade --install paradedb \
Expand All @@ -57,7 +55,6 @@ To use the ParadeDB Helm Chart, specify `paradedb` via the `type` parameter.
### Modes of operation

The chart has three modes of operation. These are configured via the `mode` parameter:

* `standalone` - Creates new or updates an existing CNPG cluster. This is the default mode.
* `replica` - Creates a replica cluster from an existing CNPG cluster. **_Note_ that this mode is not yet supported.**
* `recovery` - Recovers a CNPG cluster from a backup, object store or via pg_basebackup.
Expand All @@ -74,10 +71,8 @@ providers are supported:
* Google Cloud Storage

Additionally you can specify the following parameters:

* `backups.retentionPolicy` - The retention policy for backups. Defaults to `30d`.
* `backups.scheduledBackups` - An array of scheduled backups containing a name and a crontab schedule. Example:

```yaml
backups:
scheduledBackups:
Expand All @@ -99,7 +94,7 @@ Examples
--------

There are several configuration examples in the [examples](examples) directory. Refer to them for a basic setup and
refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentation/current/) for more advanced configurations.
refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentation/current/) for more advanced configurations.

## Values

Expand Down Expand Up @@ -162,8 +157,8 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentati
| cluster.postgresUID | int | `-1` | The UID of the postgres user inside the image, defaults to 26 |
| cluster.postgresql.parameters | object | `{}` | PostgreSQL configuration options (postgresql.conf) |
| cluster.postgresql.pg_hba | list | `[]` | PostgreSQL Host Based Authentication rules (lines to be appended to the pg_hba.conf file) |
| cluster.postgresql.pg_ident | list | `[]` | PostgreSQL User Name Maps rules (lines to be appended to the pg_ident.conf file) |
| cluster.postgresql.shared_preload_libraries | list | `[]` | Lists of shared preload libraries to add to the default ones |
| cluster.postgresql.pg_ident | list | `[]` | |
| cluster.postgresql.shared_preload_libraries | list | `[]` | |
| 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 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 Expand Up @@ -234,12 +229,15 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentati
| recovery.s3.secretKey | string | `""` | |
| recovery.secret.create | bool | `true` | Whether to create a secret for the backup credentials |
| recovery.secret.name | string | `""` | Name of the backup credentials secret |
| type | string | `"paradedb"` | Type of the CNPG database. Available types: `paradedb` |
| version.paradedb | string | `"0.9.4"` | If using ParadeDB, specify the version |
| type | string | `"paradedb"` | Type of the CNPG database. Available types: * `paradedb` |
| version.paradedb | string | `"0.0.0"` | The ParadeDB version, set in the publish CI workflow from the latest paradedb/paradedb GitHub tag |
| version.postgis | string | `"3.4"` | If using PostGIS, specify the version |
| version.postgresql | string | `"16"` | PostgreSQL major version to use |
| version.timescaledb | string | `"2.15"` | If using TimescaleDB, specify the version |

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| ParadeDB | <[email protected]> | [paradedb.com](https://paradedb.com) |
| ParadeDB | <[email protected]> | <https://paradedb.com> |

115 changes: 115 additions & 0 deletions charts/paradedb-cluster/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# CloudNativePG Cluster


{{ template "chart.deprecationWarning" . }}


This README documents the Helm chart for deploying and managing [ParadeDB](https://github.com/paradedb/paradedb) on Kubernetes via [CloudNativePG](https://cloudnative-pg.io/), including advanced settings.

Kubernetes, and specifically the CloudNativePG operator, is the recommended approach for deploying ParadeDB in production. ParadeDB also provides a [Docker image](https://hub.docker.com/r/paradedb/paradedb) and [prebuilt binaries](https://github.com/paradedb/paradedb/releases) for Debian, Ubuntu and Red Hat Enterprise Linux.

## Getting Started

### Installing the Operator

Skip this step if the CNPG operator is already installed in your cluster.

```console
helm repo add cnpg https://cloudnative-pg.github.io/charts
helm upgrade --install cnpg \
--namespace cnpg-system \
--create-namespace \
cnpg/cloudnative-pg
```

### Setting up a ParadeDB CNPG Cluster

Create a `values.yaml` and configure it to your requirements. Here is a basic example:

```yaml
type: paradedb
mode: standalone

cluster:
instances: 2
storage:
size: 256Mi
```

You can refer to the other examples in the [`charts/cluster/examples`](https://github.com/paradedb/charts/tree/main/charts/cluster/examples) directory.

```console
helm repo add paradedb https://paradedb.github.io/charts
helm upgrade --install paradedb \
--namespace paradedb-database \
--create-namespace \
--values values.yaml \
paradedb/cluster
```

A more detailed guide can be found in the [Getting Started docs](<./docs/Getting Started.md>).

Cluster Configuration
---------------------

### Database types

To use the ParadeDB Helm Chart, specify `paradedb` via the `type` parameter.

### Modes of operation

The chart has three modes of operation. These are configured via the `mode` parameter:
* `standalone` - Creates new or updates an existing CNPG cluster. This is the default mode.
* `replica` - Creates a replica cluster from an existing CNPG cluster. **_Note_ that this mode is not yet supported.**
* `recovery` - Recovers a CNPG cluster from a backup, object store or via pg_basebackup.

### Backup configuration

CNPG implements disaster recovery via [Barman](https://pgbarman.org/). The following section configures the barman object
store where backups will be stored. Barman performs backups of the cluster filesystem base backup and WALs. Both are
stored in the specified location. The backup provider is configured via the `backups.provider` parameter. The following
providers are supported:

* S3 or S3-compatible stores, like MinIO
* Microsoft Azure Blob Storage
* Google Cloud Storage

Additionally you can specify the following parameters:
* `backups.retentionPolicy` - The retention policy for backups. Defaults to `30d`.
* `backups.scheduledBackups` - An array of scheduled backups containing a name and a crontab schedule. Example:
```yaml
backups:
scheduledBackups:
- 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
below. Refer to the table for the full list of parameters and place the configuration under the appropriate key: `backup.s3`,
`backup.azure`, or `backup.google`.


Recovery
--------

There is a separate document outlining the recovery procedure here: **[Recovery](docs/recovery.md)**


Examples
--------

There are several configuration examples in the [examples](examples) directory. Refer to them for a basic setup and
refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentation/current/) for more advanced configurations.


{{ template "chart.requirementsSection" . }}


{{ template "chart.valuesSection" . }}


{{ template "chart.maintainersSection" . }}


{{ template "helm-docs.versionFooter" . }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
{{- if not (has $alert .excludeRules) -}}
alert: {{ $alert }}
annotations:
summary: CNPG Cluster has no standby replicas!
summary: ParadeDB Cluster has no standby replicas!
description: |-
CloudNativePG Cluster "{{ .labels.job }}" has no ready standby replicas. Your cluster at a severe
ParadeDB Cluster "{{ .labels.job }}" has no ready standby replicas. Your cluster at a severe
risk of data loss and downtime if the primary instance fails.
The primary instance is still online and able to serve queries, although connections to the `-ro` endpoint
Expand All @@ -15,7 +15,7 @@ annotations:
This alarm will be always trigger if your cluster is configured to run with only 1 instance. In this
case you may want to silence it.
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHACritical.md
runbook_url: https://github.com/paradedb/charts/blob/main/charts/paradedb-cluster/docs/runbooks/CNPGClusterHACritical.md
expr: |
max by (job) (cnpg_pg_replication_streaming_replicas{namespace="{{ .namespace }}"} - cnpg_pg_replication_is_wal_receiver_up{namespace="{{ .namespace }}"}) < 1
for: 5m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
{{- if not (has $alert .excludeRules) -}}
alert: {{ $alert }}
annotations:
summary: CNPG Cluster less than 2 standby replicas.
summary: ParadeDB Cluster less than 2 standby replicas.
description: |-
CloudNativePG Cluster "{{ .labels.job }}" has only {{ .value }} standby replicas, putting
ParadeDB Cluster "{{ .labels.job }}" has only {{ .value }} standby replicas, putting
your cluster at risk if another instance fails. The cluster is still able to operate normally, although
the `-ro` and `-r` endpoints operate at reduced capacity.
Expand All @@ -13,7 +13,7 @@ annotations:
This alarm will be constantly triggered if your cluster is configured to run with less than 3 instances.
In this case you may want to silence it.
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHAWarning.md
runbook_url: https://github.com/paradedb/charts/blob/main/charts/paradedb-cluster/docs/runbooks/CNPGClusterHAWarning.md
expr: |
max by (job) (cnpg_pg_replication_streaming_replicas{namespace="{{ .namespace }}"} - cnpg_pg_replication_is_wal_receiver_up{namespace="{{ .namespace }}"}) < 2
for: 5m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{{- if not (has $alert .excludeRules) -}}
alert: {{ $alert }}
annotations:
summary: CNPG Instance maximum number of connections critical!
summary: ParadeDB Instance maximum number of connections critical!
description: |-
CloudNativePG Cluster "{{ .namespace }}/{{ .cluster }}" instance {{ .labels.pod }} is using {{ .value }}% of
ParadeDB Cluster "{{ .namespace }}/{{ .cluster }}" instance {{ .labels.pod }} is using {{ .value }}% of
the maximum number of connections.
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHighConnectionsCritical.md
runbook_url: https://github.com/paradedb/charts/blob/main/charts/paradedb-cluster/docs/runbooks/CNPGClusterHighConnectionsCritical.md
expr: |
sum by (pod) (cnpg_backends_total{namespace="{{ .namespace }}", pod=~"{{ .podSelector }}"}) / max by (pod) (cnpg_pg_settings_setting{name="max_connections", namespace="{{ .namespace }}", pod=~"{{ .podSelector }}"}) * 100 > 95
for: 5m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
{{- if not (has $alert .excludeRules) -}}
alert: {{ $alert }}
annotations:
summary: CNPG Instance is approaching the maximum number of connections.
summary: ParadeDB Instance is approaching the maximum number of connections.
description: |-
CloudNativePG Cluster "{{ .namespace }}/{{ .cluster }}" instance {{ .labels.pod }} is using {{ .value }}% of
ParadeDB Cluster "{{ .namespace }}/{{ .cluster }}" instance {{ .labels.pod }} is using {{ .value }}% of
the maximum number of connections.
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHighConnectionsWarning.md
runbook_url: https://github.com/paradedb/charts/blob/main/charts/paradedb-cluster/docs/runbooks/CNPGClusterHighConnectionsWarning.md
expr: |
sum by (pod) (cnpg_backends_total{namespace="{{ .namespace }}", pod=~"{{ .podSelector }}"}) / max by (pod) (cnpg_pg_settings_setting{name="max_connections", namespace="{{ .namespace }}", pod=~"{{ .podSelector }}"}) * 100 > 80
for: 5m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{{- if not (has $alert .excludeRules) -}}
alert: {{ $alert }}
annotations:
summary: CNPG Cluster high replication lag
summary: ParadeDB Cluster high replication lag
description: |-
CloudNativePG Cluster "{{ .namespace }}/{{ .cluster }}" is experiencing a high replication lag of
ParadeDB Cluster "{{ .namespace }}/{{ .cluster }}" is experiencing a high replication lag of
{{ .value }}ms.
High replication lag indicates network issues, busy instances, slow queries or suboptimal configuration.
runbook_url: https://github.com/cloudnative-pg/charts/blob/main/charts/cluster/docs/runbooks/CNPGClusterHighReplicationLag.md
runbook_url: https://github.com/paradedb/charts/blob/main/charts/paradedb-cluster/docs/runbooks/CNPGClusterHighReplicationLag.md
expr: |
max(cnpg_pg_replication_lag{namespace="{{ .namespace }}",pod=~"{{ .podSelector }}"}) * 1000 > 1000
for: 5m
Expand Down
Loading

0 comments on commit 59f001e

Please sign in to comment.