timescale / helm-charts

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

In a single/dualstack cluster connections to Timescale over ipv6 do not work. #499

Closed nhudson closed 2 years ago

nhudson commented 2 years ago

What happened?

Reported here: https://timescaledb.slack.com/archives/C63MYDZ35/p1668653385466799

When trying to connect to the timescaledb pod from outside the pod, the connection is refused

sql: error: connection to server at "tobs.tobs.svc.cluster.local" (fdb5:11ff:e40d::5858), port 5432 failed: Connection refused
    Is the server running on that host and accepting TCP/IP connections?

Yet from inside the pod or using kubectl port-forward it connects fine

kubectl port-forward -n tobs svc/tobs 5432:5432
psql -U postgres -h localhost postgres
Password for user postgres: 
psql (14.6 (Homebrew))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
Type "help" for help.

postgres=# 
\q

Did you expect to see something different?

The connection to succeed over IPv6

How to reproduce it (as minimally and precisely as possible):

Using the timescaledb-single Helm chart or tobs install a minimal stack to a Kubernetes cluster that has been created to support Dualstack IP connections (ipv4/ipv6).

Environment

AWS EKS

tobs: 17.21.0

default values from the tobs Helm chart

kubectl version --short
Client Version: v1.24.0
Kustomize Version: v4.5.4
Server Version: v1.24.7-eks-fb459a0

Cluster was created with eksctl

---
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: test-ipv6-test
  region: us-west-2
  version: "1.24"

kubernetesNetworkConfig:
  ipFamily: IPv6

addons:
  - name: vpc-cni
    version: latest
  - name: coredns
    version: latest
  - name: kube-proxy
    version: latest

iam:
  withOIDC: true
nhudson commented 2 years ago

Looks like the Helm chart schema validation wont allow for the correct configuration options needed to allow postgres to listen on an IPv6 address.

replicaCount: 1
patroni:
  postgresql:
    listen: ":::5432"
  restapi:
    listen: ":::8008"
"Error: INSTALLATION FAILED: values don't meet the specifications of the schema(s) in the following chart(s):\ntimescaledb-single:\n- patroni.postgresql.listen: patroni.postgresql.listen must be one of the following: \"0.0.0.0:5432\"