<p>Requirement: Want to deploy Minio and another backend service using an ingress with HTTPS (Not for production purposes)</p>
<p>I have been trying to create an ingress to access two services externally from the Kubernetes cluster in GKE. These are the attempts I tried.</p>
<p>Attempt One</p>
<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: lightning-ingress
  namespace: default
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;
spec:
  rules:
  - http:
      paths:
        - path: /storage
          backend:
            serviceName: minio
            servicePort: 9000
        - path: /portal
          backend:
            serviceName: oscar
            servicePort: 8080
</code></pre>
<p>Attempt Two</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: oscar
  annotations:
    # nginx.ingress.kubernetes.io/rewrite-target: /
    kubernetes.io/ingress.class: nginx
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: oscar
          servicePort: 8080
  - host: storage.lightningfaas.tech
    http:
      paths:
      - backend:
          serviceName: minio
          servicePort: 9000
</code></pre>
<p>Attempt Three</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: lightning-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
    kubernetes.io/ingress.class: &quot;nginx&quot;
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: minio
          servicePort: 9000
        path: /minio(/|$)(.*)
      - backend:
          serviceName: oscar
          servicePort: 8080
        path: /portal(/|$)(.*)
</code></pre>
<p>Attempt Four</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: minio-ingress
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
spec:
  rules:
  - host: minio.lightningfaas.tech
    http:
      paths:
      - backend:
          serviceName: minio
          servicePort: 9000
  - host: portal.lightningfaas.tech
    http:
      paths:
      - backend:
          serviceName: oscar
          servicePort: 8080
</code></pre>
<p>However, none of the above attempts suites for my requirement. Either it gives a 404 0r a 503. But I can confirm that creating an individual ingress for each service works fine as below.</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: oscar
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: oscar
          servicePort: 8080
</code></pre>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: minio-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  rules:
  - http:
      paths:
      - backend:
          serviceName: minio
          servicePort: 9000
</code></pre>
<p>Changing domain servers takes a huge time to test as well, therefore creating hosts are very annoying since I have to wait a massive time to test my code. Is there anything more that I can try?</p>
<p>Something like below would be ideal:</p>
<p><a href="https://34.452.234.45:9000" rel="nofollow noreferrer">https://34.452.234.45:9000</a> &gt; will access minio</p>
<p><a href="https://34.452.234.45:8080" rel="nofollow noreferrer">https://34.452.234.45:8080</a> &gt; will access oscar</p>
<p>Your suggestions and opinions will be really helpful for me.</p>
<p>Minio helm chart: <a href="https://github.com/minio/charts" rel="nofollow noreferrer">https://github.com/minio/charts</a></p>
<p>Minio deployment</p>
<pre><code>helm install --namespace oscar minio minio/minio --set accessKey=minio --set secretKey=password --set persistence.existingClaim=lightnig --set resources.requests.memory=256Mi 
</code></pre>
<p>Oscar helm chart: <a href="https://github.com/grycap/helm-charts/tree/master/oscar" rel="nofollow noreferrer">https://github.com/grycap/helm-charts/tree/master/oscar</a></p>
<p>Oscar deployment</p>
<pre><code>helm install --namespace=oscar oscar oscar --set authPass=password --set service.type=ClusterIP --set createIngress=false --set volume.storageClassName=nfs --set minIO.endpoint=http://104.197.173.174 --set minIO.TLSVerify=false --set minIO.accessKey=minio --set minIO.secretKey=password --set serverlessBackend=openfaas

</code></pre>

<p>According to kubernetes doc, simple fan-out example should solve your problem.
A simple fan-out example is given below where same host has two different paths for two different services.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: simple-fanout-example
spec:
  rules:
  - host: foo.bar.com
    http:
      paths:
      - path: /foo
        pathType: Prefix
        backend:
          service:
            name: service1
            port:
              number: 4200
      - path: /bar
        pathType: Prefix
        backend:
          service:
            name: service2
            port:
              number: 8080
</code></pre>
<p>So your manifest file might look like this:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
    name: lightning-ingress
    namespace: default
spec:
  rules:
  - host: [your host name here]
    http:
      paths:
      - path: /storage
        pathType: Prefix
        backend:
          service:
            name: minio
            port:
              number: 9000
      - path: /portal
        pathType: Prefix
        backend:
          service:
            name: oscar
            port:
              number: 8080
</code></pre>
<p>Ref: <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/" rel="nofollow noreferrer">Kubernetes doc</a></p>
