A
A
Anton2018-10-21 15:13:30
PostgreSQL
Anton, 2018-10-21 15:13:30

Why can't I connect on port 5432 when using NodePort in a Stolon cluster?

I start the installation of the stolon cluster specifying proxy.service.type=NodePort

helm install --name stable-stolon stable/stolon --set persistence.storageClassName=local-storage,proxy.service.type=NodePort,superuserPassword=password,replicationPassword=password
NAME:   stable-stolon
LAST DEPLOYED: Sun Oct 21 14:15:40 2018
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1/Pod(related)
NAME                                     READY  STATUS             RESTARTS  AGE
stable-stolon-proxy-9b8c655c6-5547h      0/1    Pending            0         1s
stable-stolon-proxy-9b8c655c6-59w8v      0/1    ContainerCreating  0         1s
stable-stolon-sentinel-7547f856cb-dw9sl  0/1    ContainerCreating  0         1s
stable-stolon-sentinel-7547f856cb-q6zqd  0/1    ContainerCreating  0         1s
stable-stolon-keeper-0                   0/1    Pending            0         1s
stable-stolon-create-cluster-rrrrj       0/1    ContainerCreating  0         1s

==> v1beta1/Role
NAME           AGE
stable-stolon  2s

==> v1beta2/Deployment
NAME                    DESIRED  CURRENT  UP-TO-DATE  AVAILABLE  AGE
stable-stolon-proxy     2        2        2           0          2s
stable-stolon-sentinel  2        2        2           0          1s

==> v1beta2/StatefulSet
NAME                  DESIRED  CURRENT  AGE
stable-stolon-keeper  2        1        1s

==> v1/Job
NAME                          DESIRED  SUCCESSFUL  AGE
stable-stolon-create-cluster  1        0           1s

==> v1/Secret
NAME           TYPE    DATA  AGE
stable-stolon  Opaque  2     2s

==> v1/ServiceAccount
NAME           SECRETS  AGE
stable-stolon  1        2s

==> v1beta1/RoleBinding
NAME           AGE
stable-stolon  2s

==> v1/Service
NAME                           TYPE       CLUSTER-IP     EXTERNAL-IP  PORT(S)         AGE
stable-stolon-keeper-headless  ClusterIP  None           <none>       5432/TCP        2s
stable-stolon-proxy            NodePort   10.233.17.220  <none>       5432:31082/TCP  2s


NOTES:
Stolon cluster installed and initialized.

To get superuser password run
    PGPASSWORD=$(kubectl get secret --namespace default stable-stolon -o jsonpath="{.data.pg_su_password}" | base64 --decode; echo)

I see that the stable-stolon-proxy service has a NodePort type
kubectl get svc -o wide
NAME                            TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE     SELECTOR
kubernetes                      ClusterIP   10.233.0.1      <none>        443/TCP          60m     <none>
stable-stolon-keeper-headless   ClusterIP   None            <none>        5432/TCP         8m16s   app=stolon,component=stolon-keeper,release=stable-stolon
stable-stolon-proxy             NodePort    10.233.17.220   <none>        5432:31082/TCP   8m16s   app=stolon,component=stolon-proxy,release=stable-stolon

I look at the IP of the network card
ip a | grep eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    inet 10.233.60.149/24 brd 10.233.60.255 scope global dynamic eth0

I can't connect on port 5432 to the IP of the network card
telnet 10.233.60.149 5432
Trying 10.233.60.149...
telnet: connect to address 10.233.60.149: Connection refused

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2018-10-21
Patsev @chemtech

nodePort doesn't give ports below 30000

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question