nodeport or hostpoat support?
nodeport or hostport is useful in debug or daliy maintenance from pc. I try to write a nodeport servcie ,but sometimes get error like
cannot execute CREATE TABLE in a read-only transaction
How to write a correct nodeport service?And can you add offical support for it.
I'm not sure if we want to support it directly in these Helm Charts, we'll take it into consideration before going to version 1.0.
How do you currently define the current NodePort service, what selector do you give it?
I just change the default service to nodeport like below.
apiVersion: v1
kind: Service
metadata:
name: timescaledb-single
namespace: timescaledb-single
spec:
externalTrafficPolicy: Cluster
ports:
- name: postgresql
nodePort: 31577
port: 5432
protocol: TCP
targetPort: postgresql
sessionAffinity: None
type: Nodeport
Since patroni use endpoint to manage the leader metadata,I didn't find a way to use selector to connect to master database.
This would be useful to avoid a port-forward for development use.
Hello, I'm failing to expose Timescale with a NodePort instead of a LoadBalancer.
Here's what I tried.
First approach: full Helm
Here are the values.yml that I tried:
replicaCount: 1
service:
primary:
type: NodePort
nodePort: 30001
replica:
type: ClusterIP
loadBalancer:
enabled: false
Here are the services that the Helm release creates when applied:
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
flux-system timescaledb LoadBalancer 10.42.142.161 51.159.9.15 5432:30905/TCP 9m44s
flux-system timescaledb-config ClusterIP None <none> 8008/TCP 20m
flux-system timescaledb-replica ClusterIP 10.33.227.237 <none> 5432/TCP 20m
Problems with this approach
- [ ] I can't find how to use a NodePort instead of a LoadBalancer solely by editing the Helm chart values.
Second approach: creating a NodePort service
I create the following service:
kind: Service
apiVersion: v1
metadata:
name: timescaledb-svc
namespace: flux-system
spec:
selector:
app: timescaledb
role: master
type: NodePort
externalIPs:
- "51.15.223.40"
ports:
- name: timescale-pg-port
port: 5432
nodePort: 30001
I deleted the previously created LoadBalancer:
kubectl delete service timescaledb -n flux-system
I get the following services:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
timescaledb-config ClusterIP None <none> 8008/TCP 40m
timescaledb-replica ClusterIP 10.33.227.237 <none> 5432/TCP 40m
timescaledb-svc NodePort 10.41.23.237 51.15.223.40 5432:30001/TCP 3m
Problems with this approach
I can connect using port-forwarding. The problems are related to exposing the port to the Internet.
- [ ] It looks like I can access the port at 51.15.223.40:30001, but it times out (see screenshot). Why does this happen?
- [ ] How can I expose the NodePort on all cluster nodes instead of one? Manually selecting an external IP seems wrong to me.
Timeout

Provider
My provider is Kapsule from Scaleway.