<p>I run Kubernetes single-node dev cluster with several independent services — Nginx proxy with port 80 and elasticsearch with ports 9200. Is there any way to expose these services with ingress, to have entry point with one LoadBalancer IP? (x.x.x.x:80 and x.x.x.x:9200)</p>
<p>I read about ingress limitation, which can be accessed only with 80 and 443 port. But, maybe, exists some workarounds?</p>
<p>Thx for any advice</p>
<p>UPDATE</p>
<p>I solved my problem with creating several ingresses and utilize the same load balancer. But faced some issue with Nginx ingress, which cost me a lot of time.
The simplest way to use my approach, is install ingress controller with helm and parametrize it with exposed services and ports</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>helm install ingress stable/nginx-ingress --set tcp.4445="default/nginx-proxy:4445" --set tcp.8888="default/demo:8888" --set tcp.19200="default/elasticsearch:19200"</code></pre>
</div>
</div>
</p>
<p>During this process, will be created necessary resources, including configmaps with ports/services. Then we need only create ingress for each service. Take a note, that service must be ClusterIP.</p>
<p>But if later you want to expose some extra services and add everything manualy (create configmap, update ingress service, create ingress, even recreate nginx pod), I can't connect to service :(</p>
<p>So any changes (for me) leads to reinstalling all controller</p>

<p>Understand you have a dev server with not a lot of cool features that a cloud cluster would have. But there are workaround to make it look like one.</p>

<p>** ngress limitation, which can be accessed only with 80 and 443 port?</p>

<blockquote>
  <p>Yes but you can overwrite it, I wouldnt suggest as its a lot of manual work everytime you need to add / remove port </p>
</blockquote>

<p>** Is there any way to expose these services with ingress</p>

<blockquote>
  <p>There is a much better solution instead.. why dont you use your own domain name say elasticsearch.Dehimb.host  /  grafana.Dehimb.host etc... ?</p>
</blockquote>

<ol>
<li><p>Use nginx ingress controller (could use other but the config below is for nginx as example)</p></li>
<li><p>Deploy it using help as daemon set instead of a deployment and use the values file changes below
<a href="https://github.com/helm/charts/blob/master/stable/nginx-ingress/values.yaml#L52" rel="nofollow noreferrer">https://github.com/helm/charts/blob/master/stable/nginx-ingress/values.yaml#L52</a></p></li>
</ol>

<p>reportNodeInternalIp: true</p>

<p>useHostPort: true</p>

<ol start="3">
<li>Now setup your dns using dnsmasq, may be a small node somewhere or even container on your host using this image :
<a href="https://github.com/jpillora/docker-dnsmasq" rel="nofollow noreferrer">https://github.com/jpillora/docker-dnsmasq</a></li>
</ol>

<p>Here is where you can set *.Dehimb.com to k8s Node IP. (kubectl get nodes -owide)</p>

<ol start="4">
<li><p>Use your laptop to use dns masq IP as the first name server above its default ISP name server</p></li>
<li><p>Now simply create ingress with as many domains as you like, and when you browse from your laptop:</p></li>
</ol>

<p>--> it first uses dnsmasq to resolve it to k8s node IPs, </p>

<p>--> there port 80 is open on every node because of the daemon set</p>

<p>--> Those ports are passing traffic to the nginx that has ingress configuration</p>

<p>--> nginx knows which service to pass the traffic to</p>

<p>It could sound slightly complicated but its fun when it all works and its one time setup.</p>

<p>Alternatively you can use metallb (but not as easy to figure out if it breaks)</p>
