timescale / helm-charts

Configuration and Documentation to run TimescaleDB in your Kubernetes cluster
Apache License 2.0
261 stars 223 forks source link

Find read replica for timescaledb single helm chart #609

Closed yspassivelogic closed 11 months ago

yspassivelogic commented 1 year ago

We deployed timescaledb single helm chart with 2 timescaledb pods -

% kubectl get pods -n timescaledb
NAME                                 READY   STATUS      RESTARTS   AGE
timescaledb-0                        2/2     Running     0          15d
timescaledb-1                        2/2     Running     0          15d

Time to time we see our app - hitting an error that "cannot execute INSERT a read only transaction"

We have a internal load balancer with a selectors:

app: timescaledb role: master

Why is is trying to send db requests to timescaledb-1 ? is it because round robin of the load balancer and selectors?

yspassivelogic commented 1 year ago

any response on this?

may-cDev commented 1 year ago

So you're using your own, custom load balancer in order to route your requests? Probably this is the issue, since I assume your load balancer does not know which timescale pod is currently the master.

TimescaleDB uses patroni in the background to manage the timescale cluster and route your request to the correct host. You might want to route your traffic via the deployed timescale service (see template svc-timescaledb.yaml ) instead of your custom load balancer.

yspassivelogic commented 1 year ago

hi @may-cDev - the problem is my application which is another pod is having issues connecting to the svc-timescaledb.yaml

in order for my app to connect (which is another pod)- do you suggest I use a NodePort or clusterIP?

github-actions[bot] commented 1 year ago

This issue went stale because it was not updated in a month. Please consider updating it to improve the quality of the project.

github-actions[bot] commented 1 year ago

This issue went stale because it was not updated in a month. Please consider updating it to improve the quality of the project.

github-actions[bot] commented 11 months ago

This issue was closed because it has been stalled for 30 days with no activity.