Replies: 1 comment 1 reply
-
Hi @ericis , thanks for starting this discussion! Have you checked out https://k3d.io/usage/guides/exposing_services/#1-via-ingress-recommended already? The ingress way described in the docs has the following flow (roughly, including abstractions affecting the flow): Client (e.g. curl or your browser) -> k3d loadbalancer (nginx, external to the cluster) -> k3d node (k3s container) -> klipper servicelb (uses hostPort to expose Going over your steps:
How you'd access them now:
After all, you could set both up with the same ports and just different names/labels and then use different paths (https://github.com/ericis/k3d-networking/blob/main/k8s-ingress-2.yaml#L12) in the ingress. I didn't test your manifests, so I may have missed something, but that's the theoretical part so far 👍 |
Beta Was this translation helpful? Give feedback.
-
This question has been cross-posted to StackOverflow here: https://stackoverflow.com/questions/68547804/how-to-expose-two-apps-services-over-unique-ports-with-k3d
I am attempting to expose two services over two ports. As an alternative, I'd also love to know how to expose them over the same port and use different routes. I've attempted a few articles and a lot of configurations. Let me know where I'm going wrong with the networking of k3d + k3s / kubernetes + traefik (+ klipper?)...
I posted an example:
https://github.com/ericis/k3d-networking
The goal:
Steps
See: files in repo
Configure
k3d
cluster and expose app ports to load balancerDeploy apps with "deployment.yaml" in Kubernetes and expose container ports
Expose services within kubernetes. Here, I've tried two methods.
Using CLI
Using "service.yaml"
Expose the services outside of kubernetes using "ingress.yaml"
Beta Was this translation helpful? Give feedback.
All reactions