In order to access my remote ES instance (outside of my swarm cluster), I have set up a small port forwarding container with the following configuration:
search: image: arvindr226/alpine-ssh ports: - "9200:9200" stdin_open: true command: > sh -c "mkdir -p ~/.ssh && cp /run/secrets/secret_key_rsa ~/.ssh/id_rsa && touch ~/.ssh/known_hosts && ssh-keyscan <REMOTE_ADDR> >> ~/.ssh/known_hosts && ssh -4 -L *:9200:127.0.0.1:9200 <USER>@<REMOTE_ADDR>"
As you can see, it also exposes port 9200, so I can map this to my local environment and/or connect to ES via any of the other containers on the network. Even though the ES instance is accessible from within the container, accessing it fromt outside results in:
curl: (52) Empty reply from server
NOTE: Much of the advice I have already read goes in the line of opening ES to accept outside connections. This is precisely not what I want to do, which is the reason I want to tunnel to it via a container. Otherwise, I could have just connected to it directly.
What can I still try?