Answers: <p>Actually, I should have searched more: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport" rel="nofollow noreferrer">NodePort</a> is what I want, letting me expose ports on my local machine.</p>
  
Answers: CC BY-SA 4.0
Answers: 2022-01-14T22:35:55.757Z
Answers: 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.
Answers: taleodor
Answers: CC BY-SA 4.0
Answers: 2022-01-14T16:00:40.850Z
Answers: 2022-01-14T16:00:40.850Z
Answers: GlinesMome
Body: <p>I have a single node k3s &quot;cluster&quot; with few <code>Service</code>s on it.</p>
  <p>Whenever I want to access to one of them, I'm forced to either do a <code>port-forward</code> or a <code>describe</code> (and get the endpoint, but it changes each time).
  From what I have read, <code>ingress</code> (with a local <code>nginx</code> <code>ingress controller</code>) suffers from the same issue.</p>
  <p>Isn't there a way to reliably (ie. resisting to reload/reboot), plug my host machine DNS resolution on k3s DNS?</p>
  
Comments: CC BY-SA 4.0
Comments: 2022-01-10T02:17:29.547Z
Comments: 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 - https://worklifenotes.com/2022/01/04/jenkins-builds-with-kaniko-and-reliza-tutorial/
Comments: taleodor
Comments: CC BY-SA 4.0
Comments: 2022-01-12T16:44:39.143Z
Comments: I'm using NixOS and these ports aren't exposed (even without firewalls)
Comments: GlinesMome
Comments: CC BY-SA 4.0
Comments: 2022-01-12T20:37:25.823Z
Comments: 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.
Comments: taleodor
Tags: <kubernetes><dns><minikube>
Title: Access to k3s DNS from host
UserDisplayName: GlinesMome
ThreadText: # Access to k3s DNS from host
  
  (Asked by: username_0 on 2022-01-10)
  
  I have a single node k3s "cluster" with few `Service`s 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?
  
  **Tags:** kubernetes, dns, minikube
  
  > **Comments:**
  > **username_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 - https://worklifenotes.com/2022/01/04/jenkins-builds-with-kaniko-and-reliza-tutorial/  
  > **username_0**: I'm using NixOS and these ports aren't exposed (even without firewalls)  
  > **username_1**: 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.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2022-01-14. Score: -1 | Accepted answer
  
  Actually, I should have searched more: [NodePort](https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport) is what I want, letting me expose ports on my local machine.
  
  > **Comments:**
  > **username_1**: 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.  
  
  ---
  
  