<p>I have a NGINX Ingress controller and multiple ingress resources attached to each pod in GKE. I want to know if I can attach more than one ingress resource to a single pod.</p>
<p>For example I have a Java application running on a pod and I have attached an ingress resource to it. The application can be accessed at <code>example.dev.com</code> and it already has a ssl cert attached to it which I don't want to touch. I want the same application to be accessed via <code>example.com</code> by attaching a new Ingress resource and applying a new SSL certificate and hostname <code>example.com</code> .
Is it possible ?
Any leads will be appreciated.</p>

<p>Yes you can do it.</p>
<blockquote>
<p>For example I have a Java application running on a pod and I have
attached an ingress resource to it. The application can be accessed at
example.dev.com and it already has a ssl cert attached to it which I
don't want to touch. I want the same application to be accessed via
example.com by attaching a new Ingress resource and applying a new SSL
certificate and hostname example.com . Is it possible ? Any leads will
be appreciated.</p>
</blockquote>
<p>Create another ingress with an <strong>SSL</strong> cert stored into the secret and attach that secret to the new ingress.</p>
<p>make sure you are providing different names in the new ingress so it won't overwrite the existing one.</p>
<p>You can keep both config inside single file or else make different ingress</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-wildcard-host
spec:
  tls:
  - hosts:
      - example.com
      - example.dev.com
    secretName: testsecret-tls
  rules:
  - host: &quot;example.dev.com&quot;
    http:
      paths:
      - pathType: Prefix
        path: &quot;/bar&quot;
        backend:
          service:
            name: service1
            port:
              number: 80
  - host: &quot;example.com&quot;
    http:
      paths:
      - pathType: Prefix
        path: &quot;/foo&quot;
        backend:
          service:
            name: service1
            port:
              number: 80
</code></pre>
<p>If you have a single wild card <strong>SSL</strong></p>
<pre><code>tls:
  - hosts:
      - example.dev.com
      - example.com
    secretName: testsecret-tls
</code></pre>
<p>If you don't want both together just create once ingress for <code>example.com</code> as you want</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example-ingress
spec:
  tls:
  - hosts:
      - example.com
    secretName: testsecret-tls
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: service1
            port:
              number: 80
</code></pre>
<p>Ref :<a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/ingress/</a></p>
