<p>I have a link to a public URL in the format of <code>https://storage.googleapis.com/companyname/foldername/.another-folder/file.txt</code></p>
<p>I want to create an ingress rule to create a path to this public file, so that whoever open a specific URL, e.g., <a href="https://myapp.mydomain.com/.another-folder/myfile.txt" rel="nofollow noreferrer">https://myapp.mydomain.com/.another-folder/myfile.txt</a> -&gt; it open up above file.</p>
<p>I tried a few different ingress rules such as:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: googlestoragebucket
spec:
  externalName: storage.googleapis.com
  ports:
  - name: https
    port: 443
    protocol: TCP
    targetPort: 443
  type: ExternalName
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: staging-ingress
  annotations:
    kubernetes.io/ingress.global-static-ip-name: staging-static-ip
    kubernetes.io/ingress.class: gce
spec:
  defaultBackend:
    service:
      name: website-frontend
      port:
        number: 80
  rules:
  - host: myapp.mydomain.com
    http:
      paths:
      - path: /.another-folder/
        pathType: Prefix
        backend:
          service:
            name: googlestoragebucket
            port:
              number: 443
       - pathType: ImplementationSpecific
         backend:
          service:
            name: myactual-app
            port:
              number: 80
</code></pre>
<p>But I couldn't make it wrok. In this case I've got an error: <code>Translation failed: invalid ingress spec: service &quot;staging/googlestoragebucket&quot; is type &quot;ExternalName&quot;, expected &quot;NodePort&quot; or &quot;LoadBalancer</code></p>
<p>I don’t mind any other solutions to achieve the same result in the context of GCP and Kubernetes.</p>
<p>Do you have any ideas?</p>
<p>Looking forward for you suggestions.</p>

Michel Gokan Khan
<p>Think that you should be able to do it via Cloud External Load Balancer:</p>
<p>Here is some information about that:</p>
<p><a href="https://cloud.google.com/load-balancing/docs/https/ext-load-balancer-backend-buckets" rel="nofollow noreferrer">https://cloud.google.com/load-balancing/docs/https/ext-load-balancer-backend-buckets</a></p>
<p>Then you can point the ingress to that load balancer:
<a href="https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features</a></p>
<p>Another option is use some proxy, la Nginx, there is a post on GitHub about this: <a href="https://github.com/kubernetes/ingress-nginx/issues/1809" rel="nofollow noreferrer">https://github.com/kubernetes/ingress-nginx/issues/1809</a></p>
