<p>I have created a pod in Kubernetes(Google Cloud) and its streaming data via imagezmq.</p>
<p>Python code which is streaming the data(Inside Kubernetes Pod)-</p>
<pre><code>import imagezmq

sender = imagezmq.ImageSender(connect_to='tcp://127.0.0.1:5555', REQ_REP=False)
sender.send_image('rpi_name',data)
</code></pre>
<p>I want to access the data from outside the pod, from my system like this.</p>
<pre><code>image_hub = imagezmq.ImageHub('tcp://34.86.110.52:80', REQ_REP=False)
while True:
    rpi_name, image = image_hub.recv_image()
    yield (b'--frame\r\n'
           b'Content-Type: image/jpeg\r\n\r\n' + image.tobytes() + b'\r\n')
</code></pre>
<p>I tried creating a external loadbalance but it did'nt worked. I am not sure what to do</p>
<p>Loadbalance YAML-</p>
<pre><code>apiVersion: v1
kind: Service
spec:
  clusterIP: 10.72.131.76
  externalTrafficPolicy: Cluster
  ports:
  - nodePort: 31145
    port: 80
    protocol: TCP
    targetPort: 5555
  selector:
    app: camera-65
  sessionAffinity: None
  type: LoadBalancer
status:
  loadBalancer:
    ingress:
    - ip: 34.86.110.52
</code></pre>
<p>Please Help me.</p>

<p>I found the solution.</p>
<p>Changing the ip from 127.0.0.1 to 0.0.0. solved the issue for me.</p>
<pre><code>import imagezmq

sender = imagezmq.ImageSender(connect_to='tcp://0.0.0.0:5555', REQ_REP=False)
sender.send_image('rpi_name',data)
</code></pre>
<p>Then exposing the pod with LoadBalancer type did the work.</p>
