baio
baio

Reputation: 1172

Kubernetes and ports

I have following scenario:

  1. VM with elastichserach
  2. Kubernetes cluster

They are all in the same project, in the same zone.

I need to have access from inside containers, which are in the cluster to elasticsearch (es). VM with es has, external and internal IP, basically from inside cluster node gcloud ssh ..., I could curl es by internal IP, but from inside container I can't use internal IP (?), I must use external. Problem is I can't setup external IP, I've tried create pool, then add forwarding rule, then add firewall rule, to port 9200 but this not work neither from my local machine, neither from kubernete pod's container (Thinking the network rules on GCE overcomplicated).

Could somebody suggest where could be problem? Ideally I want to use internal IP for kubenetes containers, and somehow simple managment interface to rapidly switch on/off external IP in order to maintain elastic search server.

Thanks.

Upvotes: 0

Views: 522

Answers (1)

brendan
brendan

Reputation: 4136

Let me restate the question, so I'm sure I got it right:

You have Elastic Search (es) on a VM, not in a container.

You have a bunch of containers you want to connect to es.

If that's the case, you should be able to see the internal IP from inside the containers. What happens if you just create a simple container and try to curl the es IP address? Can you print the output?

Also, if you have a single VM, you shouldn't need to mess around with load balancers, you can just use the external IP of the VM, assuming that you have the correct firewall rules in place.

What are the firewall rules that you have setup?

Are you using the default network? Or did you create a different network.

Hope that helps.

--brendan

Upvotes: 1

Related Questions