I have a single node k3s "cluster" with few Services on it.

Whenever I want to access to one of them, I'm forced to either do a port-forward or a describe (and get the endpoint, but it changes each time). From what I have read, ingress (with a local nginx ingress controller) suffers from the same issue.

Isn't there a way to reliably (ie. resisting to reload/reboot), plug my host machine DNS resolution on k3s DNS?

  • 1
    K3s comes with built-in traefik ingress listening on host's ports 80 and 443. A simple ingress resource should expose your service on this port with configuration of your choosing defined in ingress - see here my tutorial on unrelated matter, but it has a part for Jenkins installation with a sample how I'm exposing Jenkins via Ingress - worklifenotes.com/2022/01/04/…
    – taleodor
    Commented Jan 10, 2022 at 2:17
  • I'm using NixOS and these ports aren't exposed (even without firewalls)
    – GlinesMome
    Commented Jan 12, 2022 at 16:44
  • Then it's something specific for NixOS and not for K3s per se. I'm not an expert there, if they have any community support I would ask there.
    – taleodor
    Commented Jan 12, 2022 at 20:37

1 Answer 1


Actually, I should have searched more: NodePort is what I want, letting me expose ports on my local machine.

  • While this may be fine for a local dev environment, in general using NodePorts is very rarely warranted. What may be recommended instead is a proper ingress configuration. Also, core issue in this question seems to be compatibility problem between NixOS and K3s which is not addressed by this answer.
    – taleodor
    Commented Jan 14, 2022 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.