<p>I have my application <a href="https://myapp.com" rel="nofollow noreferrer">https://myapp.com</a> deployed on K8S, with an nginx ingress controller. HTTPS is resolved at nginx.</p>
<p>Now there is a need to expose one service on a specific port for example <a href="https://myapp.com:8888" rel="nofollow noreferrer">https://myapp.com:8888</a>. Idea is to keep <a href="https://myapp.com" rel="nofollow noreferrer">https://myapp.com</a> secured inside the private network and expose only port number 8888 to the internet for integration.</p>
<p>Is there a way all traffic can be handled by the ingress controller, including tls termination, and it can also expose 8888 port and map it to a service?</p>
<p>Or
I need another nginx terminating tls and exposed on nodeport? I am not sure if I can access services like <a href="https://myapp.com" rel="nofollow noreferrer">https://myapp.com</a>:&lt;node_port&gt; with https.</p>
<p>Is using multiple ingress controllers an option?</p>
<p>What is the best practice to do this in Kubernetes?</p>

Vishal
<p>It is not a best practices to expose custom port over internet.</p>
<p>Instead, create a sub-domain (i.e <a href="https://custom.myapp.com" rel="nofollow noreferrer">https://custom.myapp.com</a>) which point to internal service in port 8888.</p>
<p>Then to create separate nginx ingress (not ingress controller) which point to that &quot;https://custom.myapp.com&quot; sub domain</p>
<p>Example manifest file as follow:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-myapp-service
  namespace: abc
  rules:
    - host: custom.myapp.com
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: myapp-service
                port:
                  number: 8888
</code></pre>
<p>Hope this helps.</p>
