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

Setup connection to external TimescaleDB #531

Merged
merged 1 commit into from
Aug 23, 2022

Conversation

nhudson
Copy link
Contributor

@nhudson nhudson commented Aug 9, 2022

Description

Create a way to connect to and setup Grafana to query an external TimescaleDB if it's not provisioned by tobs.

You can now easily install tobs to connect to an external (to tobs) TimescaleDB. This can be achieved by setting timescaledb-single.enabled=false, setting the password for the TimescaleDB postgres role in promscale.connection.password, and the host URI for timescale in promscale.connection.host.

This at minimum will setup Promscale and the Grafana datasource connections correctly to the external TimescaleDB.

Type of change

What type of changes does your code introduce to tobs? Put an x in the box that apply.

  • CHANGE (fix or feature that would cause existing functionality to not work as expected)
  • FEATURE (non-breaking change which adds functionality)
  • BUGFIX (non-breaking change which fixes an issue)
  • ENHANCEMENT (non-breaking change which improves existing functionality)
  • NONE (if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)

@nhudson
Copy link
Contributor Author

nhudson commented Aug 9, 2022

I wanted to be able to write a new ct test for this feature, but it would seem that there are artifacts left behind when helm deletes the installation. See #365 for more information. I don't think we could add more tests until we can work around this issue.

@nhudson nhudson marked this pull request as ready for review August 9, 2022 20:50
@nhudson nhudson requested a review from a team as a code owner August 9, 2022 20:50
@nhudson nhudson linked an issue Aug 9, 2022 that may be closed by this pull request
Copy link
Contributor

@paulfantom paulfantom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WDYT about using promscale.connection.uri in this test instead of dbName, user, password, host combo? This way we could tackle #331 at the same time.

@nhudson
Copy link
Contributor Author

nhudson commented Aug 11, 2022

WDYT about using promscale.connection.uri in this test instead of dbName, user, password, host combo? This way we could tackle #331 at the same time.

Yeah I was thinking of looking into seeing how we could use promscale.connection.uri after looking at #536

@nhudson nhudson force-pushed the external_db branch 2 times, most recently from c649c1d to 47d40b4 Compare August 15, 2022 17:32
@nhudson
Copy link
Contributor Author

nhudson commented Aug 15, 2022

e2e tests are failing, but seem to be timing out when trying to setup the 2nd ct test that was added to this PR.

Installing chart with values file 'chart/ci/externaldb-values.yaml'...

Creating namespace 'chart-fzd15xu19p'...
namespace/chart-fzd15xu19p created
Error: The operation was canceled.

@paulfantom
Copy link
Contributor

Seems like the issue is with insufficient amount of resources:

2022-08-16T17:48:13.4171151Z   Warning  FailedScheduling  4m36s (x5 over 15m)  default-scheduler  0/1 nodes are available: 1 Insufficient cpu. preemption: 0/1 nodes are available: 1 No preemption victims found for incoming pod.

Maybe for this particular test let's provision only one replica of prometheus and one replica of alertmanager by specifying it in chart/ci/externaldb-values.yaml

@nhudson
Copy link
Contributor Author

nhudson commented Aug 17, 2022

Only merge after #546

@nhudson
Copy link
Contributor Author

nhudson commented Aug 17, 2022

Seems like the issue is with insufficient amount of resources:

2022-08-16T17:48:13.4171151Z   Warning  FailedScheduling  4m36s (x5 over 15m)  default-scheduler  0/1 nodes are available: 1 Insufficient cpu. preemption: 0/1 nodes are available: 1 No preemption victims found for incoming pod.

Maybe for this particular test let's provision only one replica of prometheus and one replica of alertmanager by specifying it in chart/ci/externaldb-values.yaml

@paulfantom I am interested how you saw this error? Also looks like that doesn't work either, this time the job has been running for hours now.

@paulfantom
Copy link
Contributor

I opened raw logs from one of the CI runs and it was there. However right now it is no longer present.

@nhudson nhudson force-pushed the external_db branch 2 times, most recently from 1116c13 to 36ddee8 Compare August 18, 2022 21:12
@nhudson
Copy link
Contributor Author

nhudson commented Aug 18, 2022

DO NOT merge until after #555

@nhudson nhudson force-pushed the external_db branch 2 times, most recently from f207a9a to 4031e16 Compare August 22, 2022 20:26
Makefile Outdated Show resolved Hide resolved
chart/ci/externaldb-values.yaml Outdated Show resolved Hide resolved
  - update and add documentation about how to connect to external db
Copy link
Contributor

@onprem onprem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nhudson nhudson merged commit b6a9b30 into timescale:main Aug 23, 2022
@nhudson nhudson deleted the external_db branch August 23, 2022 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants