<p>I have created an pub/sub topic to which I will publish a message every time an new object is uploaded to the bucket. Now I want to create a subscription to push a notification to an endpoint every time a new object is uploaded to that bucket. Following the documentation, I wanted something like that:</p>

<p><code>
gcloud alpha pubsub subscriptions create orderComplete \
        --topic projects/PROJECT-ID/topics/TOPIC \
        --push-endpoint http://localhost:5000/ENDPOINT/
        --ack-deadline=60
</code>
However my app is running on kubernetes and it seems that pub/sub cannot reach my endpoint. Any suggestions?</p>

gr7
<p>As standing in <a href="https://cloud.google.com/pubsub/docs/push" rel="nofollow noreferrer">documentation</a></p>

<blockquote>
  <p>In general, the push endpoint must be a publicly accessible HTTPS
  server, presenting a valid SSL certificate signed by a certificate
  authority and routable by DNS.</p>
</blockquote>

<p>So you must expose your service via HTTPS using Ingress as described there:
<a href="https://cloud.google.com/kubernetes-engine/docs/concepts/ingress" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/concepts/ingress</a></p>
