1

I have elasticsearch running on my host machine on port 9200. Now I'm trying to access this from a pod running on a kind cluster. This is how I have defined my external elasticsearch service.

apiVersion: v1
kind: Service
metadata:
    name: elasticlocal
spec:
    ports:
        - protocol: TCP
          port: 9200
          targetPort: 9200
---
apiVersion: v1
kind: Endpoints
metadata:
    name: elasticlocal
subsets:
    - addresses:
        - ip: 172.17.0.5
      ports:
        - port: 9200
---

Now when I ssh into a pod and try curl elasticlocal:9200 I get an error saying

curl: (7) Failed to connect to 10.96.161.128 port 9200 after 0 ms: Connection refused.

I am not sure if 172.17.0.5 is correct however when I inspect the docker networks on my localhost I see the following enter image description here

When I inspect the kind bridge I see the following (I am using the chatt cluster)

enter image description here

I'm sure I'm doing something wrong but not sure what it is

tmp dev
  • 8,043
  • 16
  • 53
  • 108
  • What kind of cluster do you use? Minikube, kubeadm or managed by cloud GKE, AKS, EKS? Which version of Kubernetes do you use? [Here](https://stackoverflow.com/questions/65123401/how-to-access-hosts-localhost-from-inside-kubernetes-cluster) was a similar issue. – RadekW Feb 17 '22 at 15:37
  • I use `Kind` cluster on my local desktop. – tmp dev Feb 17 '22 at 20:34

0 Answers0