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

Exposing port 53 as localstack is also a DNS server #109

Closed
ezraroi opened this issue Jan 11, 2024 · 13 comments · Fixed by #107 or #120
Closed

Exposing port 53 as localstack is also a DNS server #109

ezraroi opened this issue Jan 11, 2024 · 13 comments · Fixed by #107 or #120
Assignees
Labels
type: question Please move questions to discuss.localstack.cloud

Comments

@ezraroi
Copy link

ezraroi commented Jan 11, 2024

When running in K8S, we need to be able to use LocalStack DNS server capability (Transparent Endpoint Injection).
The helm chart does not allow to bind that port which makes this immposible to use this feature in K8S

@alexrashed
Copy link
Member

Hi @ezraroi!
As discussed in #103, this is already in main and will be part of the next release (which will be created in the upcoming days after merging #107).

@alexrashed alexrashed self-assigned this Jan 11, 2024
@alexrashed alexrashed added the type: question Please move questions to discuss.localstack.cloud label Jan 11, 2024
@ezraroi
Copy link
Author

ezraroi commented Jan 11, 2024

Thanks!

@ezraroi ezraroi closed this as completed Jan 11, 2024
@ezraroi
Copy link
Author

ezraroi commented Jan 11, 2024

@alexrashed Don't we need also to expose this port as part of the service object? Otherwise, how can we configure all pods to you LocalStack as DNS server?

@ezraroi ezraroi reopened this Jan 11, 2024
@ezraroi
Copy link
Author

ezraroi commented Jan 11, 2024

Also how did you think to use this feature in K8S? Config CoreDNS to forward all AWS domains to localstack DNS server? If yes, we need to edit the CoreDNS config.

@cabeaulac
Copy link
Contributor

Hi @ezraroi . We're developing a repo that runs LocalStack in EKS with the DNS Servicer configured in CoreDNS. It's all running now and I'll make it public by COB tomorrow (is my plan).

@cabeaulac
Copy link
Contributor

@ezraroi Heads up. I'm also using a dev container in the K8S namespace to be the client to LS. This diag doesn't have the K8S Services or CoreDNS in it but it gives you the idea.
design-ls-on-aws-eks drawio

@ezraroi
Copy link
Author

ezraroi commented Jan 12, 2024

@cabeaulac Thanks for your answer and digram. Waiting for that repo.

@ezraroi
Copy link
Author

ezraroi commented Jan 15, 2024

@cabeaulac Any updates on the repo with working example?

@cabeaulac
Copy link
Contributor

@alexrashed
Copy link
Member

alexrashed commented Jan 19, 2024

Hey @ezraroi!
Please let me know if this sample repo from @cabeaulac helps.
If it does, I'd close the issue. If it doesn't please let us know what you are missing / what open questions you have. :)
Thanks!

@rattboi
Copy link
Contributor

rattboi commented May 13, 2024

I would say pointing at another repo that requires devxpod to work isn't a real solution. I agree with @ezraroi that you should be exposing the DNS ports via the k8s service, and then configuring Coredns to delegate the localstack domain to it.

I've done some hand-edits to the manifests generated by this chart and it all works great once I add dns exposed on port 53, both TCP and UDP, setup a clusterIP: w.x.y.z value for the service as well so it has a static clusterIP, and the following in Coredns's Configmap Corefile:

localhost.localstack.cloud:53 {
  errors
  cache 30
  forward . w.x.y.z # the service's clusterIP
}

@alexrashed
Copy link
Member

Yeah, I agree, I think it would make sense.
However, since this wouldn't be a default feature, and some nodes might not allow port 53 by default, I think this should be an opt-in feature (to enable the exposure of the DNS port 53).
What do you think, @rattboi? Would you be up to creating a PR? 😛

@rattboi
Copy link
Contributor

rattboi commented May 14, 2024

However, since this wouldn't be a default feature, and some nodes might not allow port 53 by default, I think this should be an opt-in feature (to enable the exposure of the DNS port 53).

Since it's exposed as a ClusterIP and not NodePort, I don't think the node has any limitations in this way

What do you think, @rattboi? Would you be up to creating a PR? 😛

I can definitely do this. I wanted to make sure that people were in alignment that this is an acceptable solution first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Please move questions to discuss.localstack.cloud
Projects
None yet
4 participants