0
votes

I have two Kubernetes developpements: one with a Grafana pod, and the other with an InfluxDB pod.

I want:

1) to expose my Grafana:3000 to the outside word

2) Grafana to be able to connect to InfluxDB:8086

I've seen it done with two separate "services": one Grafana Service (type = NodePort, target port = 3000) and one InfluxDB service (type = ClusterIP, target port = 8086).

It works ok. Yet can/should it be done with just one "service" ?

2

2 Answers

3
votes

For north south traffic i.e exposing a service outside the cluster LoadBalancer or preferably ingress is better than NodePort because when NodePort is used if the Node IP or Port changes then the clients need to make changes in the endpoint that they are using to access the service.

For east-west traffic between services within the cluster clusterIP service is good enough.

0
votes

Use ingress. You can use Nginx, Caddy, or other tool provide ingress service and define the routing of the ingress there.