Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Kubernetes service discovery for ES_SEEDS #243

Open
mhmtszr opened this issue Sep 18, 2024 · 5 comments
Open

Using Kubernetes service discovery for ES_SEEDS #243

mhmtszr opened this issue Sep 18, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@mhmtszr
Copy link

mhmtszr commented Sep 18, 2024

What are you really trying to do?

Deploying highly available Temporal cluster.

Describe the bug

We are using Kubernetes for our Temporal clusters. We don't want to give only one ip for ES_SEEDS because it can be changed thus we want to give our Kubernetes service definition. But our services contain port as well. I can give empty ES_PORT but still there is ":" character between seeds and port.

We also tried to give all IPs of the cluster seperated by comma(which is we didn't want to), but in this case Temporal server got some errors from Elasticsearch, It tried to send a request like this POST 10.10.10.1,10.10.10.2,10.10.10.3/mapping.

We can make ES_PORT totally optional in both auto-setup and Temporal server. What do you think about this? Do you have any different suggestions to us?

Or we can set ES_SERVER directly that it can overwrite.

@mhmtszr mhmtszr added the bug Something isn't working label Sep 18, 2024
@mhmtszr mhmtszr changed the title Making ES_PORT optional for Kubernetes service discovery Using Kubernetes service discovery for ES_SEEDS Sep 18, 2024
@robholland
Copy link
Collaborator

I'm not sure I see the issue. Service names in Kubernetes will resolve to all IP addresses which have an endpoint is up. Can you not just set ES_SEEDS=myesservice.namespace?

@robholland
Copy link
Collaborator

(And ES_PORT to whatever port your service defines).

@mhmtszr
Copy link
Author

mhmtszr commented Sep 25, 2024

It also resolves the port as well, It duplicates the port that I could not disable in k8s.

We solved the problem by defining internal dns but It's not a long term solution(because of caching problems and updating IPs).

@robholland
Copy link
Collaborator

I'm not sure what you mean that the k8s DNS resolves to the port as well. Can you show me an error to make it clearer at which layer it breaks?

@mhmtszr
Copy link
Author

mhmtszr commented Sep 26, 2024

We are using ClusterIP for our service definitions, It contains IP addresses and port as well.

Such as:

test-service:
IPs: 10.10.10.10, 10.10.10.11
Port: 8080

If I use "test-service.namespace" in my code I can directly access the application in that port, no need to define extra port definition.

In our case Temporal servers are pods, and there is a service definition for them.

Such as:
IPs: 10.10.10.1, 10.10.10.2
Port: 7233

When I tried to establish a connection by using "temporal-service.namespace" I'm getting error because Temporal server automatically add ES_PORT to the end of the url.

If we look at https://github.com/temporalio/docker-builds/blob/main/docker/auto-setup.sh#L330 ES_SEEDS is our service definition which has port as well, I don't need to define extra port here, If I set ES_PORT empty still there is a ":" character in url which causes error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants