Scenario:
Tableau application;
Postgres on a cloud;
Kubernetes on another cloud, running an application based on Alpine image (different cloud than Postgres).
What a I need:
- Access Postgres from Tableau using Kubernetes as a kind of router; So I need to send a request to my Kubernetes cluster, from tableau, and my Kubernetes cluster need to redirect the requisition to my Postgres host, and Postgres must to answer back to my kubernetes cluster after that my Kubernetes cluster must send de answer from Postgres to Tableau.
Important restrictions:
Tableau can access my kubernetes cluster but cannot access my Postgres host directly;
My kubernetes cluster can access my Postgres host.
Next steps Now I was able to make it work by using Thomas answer, using the following code:
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: NodePort
ports:
- port: 5432
targetPort: 5432
nodePort: 30004
---
apiVersion: v1
kind: Endpoints
metadata:
name: my-service
subsets:
- addresses:
- ip: **111.111.111.111** ** < need change this to hostname
ports:
- port: 5432
Everything works fine with numerical IP, but I need to put my Postgres DNS instead, something like:
subsets:
- addresses:
- ip: mypostgres.com
ports:
- port: 5432