0
votes

I have uploaded some code on github: https://github.com/darkcloudi/helm-camunda-postgres

Running the following commands deploys the two charts (Note the set is required to allow the postgres db to be deployed, i've disabled it by default, as camunda comes with its own DB, i'm trying to configure it to use postgres):

helm install dev ./camunda-install --set tags.postgres=true

You will see that its all looking good:

NAME                              READY   STATUS      RESTARTS   AGE
pod/dev-camunda-67f487dcd-wjdfr   1/1     Running     0          36m
pod/dev-camunda-test-connection   0/1     Completed   0          45h
pod/postgres-86c565898d-h5tf2     1/1     Running     0          36m

NAME                   TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
service/dev-camunda    NodePort    10.106.239.96    <none>        8080:30000/TCP   36m
service/dev-postgres   NodePort    10.108.235.106   <none>        5432:30001/TCP   36m
service/kubernetes     ClusterIP   10.96.0.1        <none>        443/TCP          4d19h

If I either use the 10.108.x.x ip or the minikube ip 192.168.64.2 I get the same error below, I can connect to tomcat using http://camunda.minikube.local/ or http://192.168.64.2:30000/ so was wondering where I might be going wrong when attempting to connect to postgres.

kubectl exec -it postgres-86c565898d-h5tf2 --  psql -h 10.108.235.106 -U admin --password -p 30001 camunda
Password:

psql: error: could not connect to server: could not connect to server: Connection timed out Is the server running on host "10.108.235.106" and accepting TCP/IP connections on port 30

kubectl describe svc dev-postgres
Name: dev-postgres
Namespace: default
Labels: app.kubernetes.io/managed-by=Helm
name=dev-postgres
Annotations:  meta.helm.sh/release-name: dev
meta.helm.sh/release-namespace: default
Selector:   app=dev-postgres,name=dev-postgres
Type: NodePort
IP:  10.108.235.106
Port:      postgres-http  5432/TCP
TargetPort:   5432/TCP
NodePort: postgres-http  30001/TCP
Endpoints:   <none>
Session Affinity:  None
External Traffic Policy:  Cluster
Events: <none>

https://github.com/darkcloudi/helm-camunda-postgres/blob/master/camunda-install/charts/postgres/templates/postgres.yaml

1

1 Answers

1
votes

Since you are accessing it from within the cluster you should use the ClusterIP 10.108.235.106 and port 5432.

If you wan to access it from outside the cluster then you can use Node IP 192.168.64.2 and NodePort 30001

Port 30001 is listening on the node VM and container is listening on port 5432.So you can not access it via port 30001 from within the cluster.

Edit:

The Endpoints is empty on the service. This is because the label selector on the service is selecting pods with labels app=dev-postgres,name=dev-postgres but the pods don't have that label.