Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimescaleDB Toolkit? #16

Open
Sh1ken opened this issue Sep 24, 2024 · 7 comments
Open

TimescaleDB Toolkit? #16

Sh1ken opened this issue Sep 24, 2024 · 7 comments

Comments

@Sh1ken
Copy link

Sh1ken commented Sep 24, 2024

First of all, thanks for this repo! I got Timescale working on my Kubernetes cluster real quick. :)

Have you considered including the TimescaleDB Toolkit also?

I'll have to implemented it either way so let me know if you're open to PRs.

Cheers.

@Felk
Copy link

Felk commented Oct 7, 2024

I'm also interested in this. I've read in Timescale's documentation that the toolkit is included in the official timescale/timescaledb-ha docker image, but I failed trying to get that one to work directly (cloudnative-pg/charts#414).

@gabe565
Copy link
Member

gabe565 commented Oct 21, 2024

@Sh1ken @Felk Thanks for opening this, I wasn't aware of the Toolkit! I could investigate installing it, but it seems the latest CNPG version has added official support for TimescaleDB via the image catalog. I haven't tried it yet, but it looks like it will use the official timescale/timescaledb-ha image. Take a look at cloudnative-pg/charts#306 and let me know what you think

@Sh1ken
Copy link
Author

Sh1ken commented Oct 22, 2024

Thank you for pointing us in this direction. In the end I tried to use StackGres given that it included the timescaledb_toolkit by default... until I had to use a specific function that wasn't covered by the apache license.

Tried to switch to the Community license by modifing the timescaledb.license value on my config file but the timescaledb_toolkit extension (at least the one provided by the official documentation) didn't included it. It just had the apache one and TSL.

Will try to implement CNPG with this new chart now. Looks very promising and already found a blog post that uses CNPG with Timescale + Toolkit with the Community license. Apparently the author (@tqwewe) ended up in the same rabbit hole as me, lol. Hopefully this helps @Felk as well.

Cheers and thank you so much for your support!

@Sh1ken
Copy link
Author

Sh1ken commented Oct 22, 2024

Also @gabe565, I tried to add the timescaledb_toolkit following the same kind of config that you did for this chart: Sh1ken@4da8a12.

Almost had success with it but had an issue retriving the correct package from packagecloud and that issue is still open: timescale/timescaledb-toolkit#799 (comment).

So, if you end up adding support for timescaledb_toolkit on your own, I wouldn't advice to follow this path.

@Felk
Copy link

Felk commented Oct 22, 2024

Hey @gabe565 @Sh1ken, I indeed got CNPG working with the official TimescaleDB-HA-image by using the image catalog. I originally ran into some issues, which I described in more details here: cloudnative-pg/charts#414

The short answer is: either use the cnpg helm chart (as described in the linked issue), or use an image catalog with the following additional tweaks:

  • Set the UID and GID to 1000 as the timescaledb-ha image doesn't use the default user and group
  • add CREATE EXTENSION IF NOT EXISTS timescaledb_toolkot to the init application SQL

So a minimal complete Cluster definition may look like this:

apiVersion: postgresql.cnpg.io/v1
kind: ClusterImageCatalog
metadata:
  name: timescale
  namespace: cnpg
spec:
  images:
    - major: 16
      image: timescale/timescaledb-ha:pg16
---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
  name: example
spec:
  imageCatalogRef:
    apiGroup: postgresql.cnpg.io
    kind: ClusterImageCatalog
    name: timescale
    major: 16
  instances: 1
  postgresql:
    shared_preload_libraries:
      - timescaledb
  bootstrap:
    initdb:
      postInitTemplateSQL:
        - CREATE EXTENSION IF NOT EXISTS timescaledb;
        - CREATE EXTENSION IF NOT EXISTS timescaledb_toolkit;
  postgresGID: 1000
  postgresUID: 1000

@Sh1ken
Copy link
Author

Sh1ken commented Oct 22, 2024

Thanks for your input, @Felk. I already got my instance going thanks to the instructions provided by @tqwewe linked above without any issues. Yay!

Having said that, I'd rather use your sample config though -- seems like I'd have more control with this definition just relying on the official helm chart rather an intermediate package, specially now that timescaledb_toolkit is officially supported.

@gabe565
Copy link
Member

gabe565 commented Oct 23, 2024

@Sh1ken @Felk Thanks for all the info! I'll have to try out out the image catalog. Frustrating that it has to run as a different UID, but at least it works.

Also @gabe565, I tried to add the timescaledb_toolkit following the same kind of config that you did for this chart: Sh1ken@4da8a12.

Almost had success with it but had an issue retriving the correct package from packagecloud and that issue is still open: timescale/timescaledb-toolkit#799 (comment).

So, if you end up adding support for timescaledb_toolkit on your own, I wouldn't advice to follow this path.

@Sh1ken That's messy. It looks to me like the issue is that they don't have arm64 versions of the toolkit for v16+. I tested with postgis/postgis:16-3.5 which is what ghcr.io/imusmanmalik/timescaledb-postgis uses, and I see the newer toolkits, but Docker also logs

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

so I'm essentially running as an amd64 machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants