Skip to content

Commit

Permalink
feat: Enable monitoring via Prometheus and Grafana (rebased) (#48)
Browse files Browse the repository at this point in the history
Rm extra files

Remove duplicate block in README
  • Loading branch information
philippemnoel committed Nov 3, 2024
1 parent 46afb84 commit d103e8b
Show file tree
Hide file tree
Showing 12 changed files with 187 additions and 16,208 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/paradedb-test-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ jobs:
- name: Install the CloudNativePG Operator
run: |
helm repo add cnpg https://cloudnative-pg.github.io/charts
helm upgrade --install cnpg --namespace cnpg-system --create-namespace cnpg/cloudnative-pg
helm upgrade --atomic --install cnpg --namespace cnpg-system --create-namespace cnpg/cloudnative-pg
- name: Wait for CNPG Webhook Service to be Ready
- name: Install the Prometheus Operator
run: |
kubectl wait --namespace cnpg-system --for=condition=available --timeout=120s deployment/cnpg-cloudnative-pg
kubectl get svc -n cnpg-system cnpg-webhook-service
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm upgrade --atomic --install prometheus-community --namespace prometheus-community --create-namespace prometheus-community/prometheus-operator-crds
- name: Test Helm Dependency Update
working-directory: charts/paradedb/
Expand Down
2 changes: 1 addition & 1 deletion .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-chainsaw:
test-cluster-standalone:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
55 changes: 40 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,36 @@ The [ParadeDB](https://github.com/paradedb/paradedb) Helm Chart is based on the

Kubernetes, and specifically the CloudNativePG operator, is the recommended approach for deploying ParadeDB in production, with high availability. 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.

The chart is also available on [ArtifactHub](https://artifacthub.io/packages/helm/paradedb/paradedb).
The chart is also available on [Artifact Hub](https://artifacthub.io/packages/helm/paradedb/paradedb).

## Getting Started

First, install [Helm](https://helm.sh/docs/intro/install/). The following steps assume you have a Kubernetes cluster running v1.25+. If you are testing locally, we recommend using [Minikube](https://minikube.sigs.k8s.io/docs/start/).

### Installing the Prometheus Stack

The ParadeDB Helm chart supports monitoring via Prometheus and Grafana. To enable this, you need to have the Prometheus CRDs installed before installing the CloudNativePG operator. If you do not yet have the Prometheus CRDs installed on your Kubernetes cluster, you can install it with:

```bash
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm upgrade --atomic --install prometheus-community \
--create-namespace \
--namespace prometheus-community \
--values https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/docs/src/samples/monitoring/kube-stack-config.yaml \
prometheus-community/kube-prometheus-stack
```

### Installing the CloudNativePG Operator

Skip this step if the CNPG operator is already installed in your cluster.
Skip this step if the CloudNativePG operator is already installed in your cluster. If you do not wish to monitor your cluster, omit the `--set` commands.

```console
```bash
helm repo add cnpg https://cloudnative-pg.github.io/charts
helm upgrade --install cnpg \
--namespace cnpg-system \
helm upgrade --atomic --install cnpg \
--create-namespace \
--namespace cnpg-system \
--set monitoring.podMonitorEnabled=true \
--set monitoring.grafanaDashboard.create=true \
cnpg/cloudnative-pg
```

Expand All @@ -57,46 +72,56 @@ type: paradedb
mode: standalone

cluster:
instances: 2
instances: 3
storage:
size: 256Mi
```
Then, launch the ParadeDB cluster.
Then, launch the ParadeDB cluster. If you do not wish to monitor your cluster, omit the `--set` command.

```bash
helm repo add paradedb https://paradedb.github.io/charts
helm upgrade --install paradedb \
--namespace paradedb-database \
helm upgrade --atomic --install paradedb \
--namespace paradedb \
--create-namespace \
--values values.yaml \
--set cluster.monitoring.enabled=true \
paradedb/paradedb
```

If `--values values.yaml` is omitted, the default values will be used. For additional configuration options for the `values.yaml` file, please refer to the [ParadeDB Helm Chart documentation](https://artifacthub.io/packages/helm/paradedb/paradedb#values). For advanced cluster configuration options, please refer to the [CloudNativePG Cluster Chart documentation](charts/paradedb/README.md).

A more detailed guide on launching the cluster can be found in the [Getting Started docs](<./charts/paradedb/docs/Getting Started.md>). To get started with ParadeDB, we suggest you follow the [quickstart guide](/documentation/getting-started/quickstart).
If `--values values.yaml` is omitted, the default values will be used. For additional configuration options for the `values.yaml` file, including configuring backups and PgBouncer, please refer to the [ParadeDB Helm Chart documentation](https://artifacthub.io/packages/helm/paradedb/paradedb#values). For advanced cluster configuration options, please refer to the [CloudNativePG Cluster Chart documentation](charts/paradedb/README.md).

### Connecting to a ParadeDB CNPG Cluster

The command to connect to the primary instance of the cluster will be printed in your terminal. If you do not modify any settings, it will be:

```bash
kubectl --namespace paradedb-database exec --stdin --tty services/paradedb-rw -- bash
kubectl --namespace paradedb exec --stdin --tty services/paradedb-rw -- bash
```

This will launch a shell inside the instance. You can connect via `psql` with:
This will launch a Bash shell inside the instance. You can connect to the ParadeDB database via `psql` with:

```bash
psql -d paradedb
```

### Connecting to the Grafana Dashboard

To connect to the Grafana dashboard for your cluster, we suggested port forwarding the Kubernetes service running Grafana to localhost:

```bash
kubectl --namespace prometheus-community port-forward svc/prometheus-community-grafana 3000:80
```

You can then access the Grafana dasbhoard at [http://localhost:3000/](http://localhost:3000/) using the credentials `admin` as username and `prom-operator` as password. These default credentials are
defined in the [`kube-stack-config.yaml`](https://raw.githubusercontent.com/cloudnative-pg/cloudnative-pg/main/docs/src/samples/monitoring/kube-stack-config.yaml) file used as the `values.yaml` file in [Installing the Prometheus CRDs](#installing-the-prometheus-stack) and can be modified by providing your own `values.yaml` file.

## Development

To test changes to the Chart on a local Minikube cluster, follow the instructions from [Getting Started](#getting-started), replacing the `helm upgrade` step by the path to the directory of the modified `Chart.yaml`.

```bash
helm upgrade --install paradedb --namespace paradedb-database --create-namespace ./charts/paradedb
helm upgrade --atomic --install paradedb --namespace paradedb --create-namespace ./charts/paradedb
```

## License
Expand Down
44 changes: 0 additions & 44 deletions charts/cloudnative-pg/Chart.yaml

This file was deleted.

77 changes: 0 additions & 77 deletions charts/cloudnative-pg/README.md

This file was deleted.

Loading

0 comments on commit d103e8b

Please sign in to comment.