|
| 1 | +# TimescaleDB (Apache 2.0 Edition) with CloudNativePG |
| 2 | + |
| 3 | +[TimescaleDB](https://github.com/timescale/timescaledb) is the leading open-source time-series database, built on PostgreSQL. It enables fast analytics, efficient storage, and powerful querying for time-series workloads. |
| 4 | + |
| 5 | +**Note**: This image contains only the Apache 2.0 licensed components of TimescaleDB to ensure CNCF licensing compliance. Advanced features requiring the Timescale License (TSL) are not included. |
| 6 | + |
| 7 | +This image provides a convenient way to deploy and manage the open-source core of `TimescaleDB` with |
| 8 | +[CloudNativePG](https://cloudnative-pg.io/). |
| 9 | + |
| 10 | +## Usage |
| 11 | + |
| 12 | +### 1. Add the timescaledb extension image to your Cluster |
| 13 | + |
| 14 | +Define the `timescaledb` extension under the `postgresql.extensions` section of |
| 15 | +your `Cluster` resource. For example: |
| 16 | + |
| 17 | +```yaml |
| 18 | +apiVersion: postgresql.cnpg.io/v1 |
| 19 | +kind: Cluster |
| 20 | +metadata: |
| 21 | + name: cluster-timescaledb |
| 22 | +spec: |
| 23 | + imageName: ghcr.io/cloudnative-pg/postgresql:18-minimal-trixie |
| 24 | + instances: 1 |
| 25 | + |
| 26 | + storage: |
| 27 | + size: 1Gi |
| 28 | + |
| 29 | + postgresql: |
| 30 | + shared_preload_libraries: |
| 31 | + - "timescaledb" |
| 32 | + parameters: |
| 33 | + timescaledb.telemetry_level: 'off' |
| 34 | + max_locks_per_transaction: '128' |
| 35 | + |
| 36 | + extensions: |
| 37 | + - name: timescaledb |
| 38 | + image: |
| 39 | + reference: ghcr.io/cloudnative-pg/timescaledb:2.23.1-18-trixie |
| 40 | +``` |
| 41 | +
|
| 42 | +### 2. Enable the extension in a database |
| 43 | +
|
| 44 | +You can install `timescaledb` in a specific database by creating or updating a |
| 45 | +`Database` resource. For example, to enable it in the `app` database: |
| 46 | + |
| 47 | +```yaml |
| 48 | +apiVersion: postgresql.cnpg.io/v1 |
| 49 | +kind: Database |
| 50 | +metadata: |
| 51 | + name: cluster-timescaledb-app |
| 52 | +spec: |
| 53 | + name: app |
| 54 | + owner: app |
| 55 | + cluster: |
| 56 | + name: cluster-timescaledb |
| 57 | + extensions: |
| 58 | + - name: timescaledb |
| 59 | +``` |
| 60 | + |
| 61 | +### 3. Verify installation |
| 62 | + |
| 63 | +Once the database is ready, connect to it with `psql` and run: |
| 64 | + |
| 65 | +```sql |
| 66 | +\dx |
| 67 | +``` |
| 68 | + |
| 69 | +You should see `timescaledb` listed among the installed extensions. |
0 commit comments