Creating a Remote Jina Pod from Flow APIs with jinad

A common case of using Jina remotely is to have a Flow running locally with some pods on the remote.


Before the start, make sure you have read the prerequisites for using jinad


In the following codes, we create a Flow on the locale with two Pods. One of the Pods is set to be running on the remote. After building the Flow, we send one index request with two Documents to it.

from jina import Flow
f = (Flow()
     .add(uses='_logforward', host='', port_expose=8000))
with f:
    f.index_lines(lines=['hello', 'jina'])

As shown in the logs below, pod1 is running on the remote while gateway and pod0 are running locally. jinad manages the creating and deleting of the pod1 on the remote.

pod0/[email protected][I]:input tcp:// (PULL_BIND) output tcp:// (PUSH_CONNECT) control over tcp:// (PAIR_BIND)
           [email protected][S]:ready and listening
         🌏 [email protected][I]:ready and listening
           [email protected][S]:🎉 Flow is ready to use, accepting gRPC request
           [email protected][I]:
	🖥️ Local access:	tcp://
	🔒 Private network:	tcp://
	🌐 Public address:	tcp://
         [email protected][S]:connected to the gateway at!
        [email protected][I]:send: 1 recv: 0 pending: 1
pod0/[email protected][I]:recv IndexRequest  from gateway▸pod0/ZEDRuntime▸⚐
pod0/[email protected][I]:#sent: 0 #recv: 1 sent_size: 0 Bytes recv_size: 423 Bytes
🌏 pod1/[email protected][I]:recv IndexRequest  from gateway▸pod0/ZEDRuntime▸pod1/ZEDRuntime▸⚐
🌏 pod1/[email protected][I]:#sent: 0 #recv: 1 sent_size: 0 Bytes recv_size: 508 Bytes
	✅ done in ⏱ 2 seconds 🐎 47.9/s
        [email protected][S]:terminated
           [email protected][S]:terminated
           [email protected][S]:terminated

What’s next?

You many also want to check out the following articles. Creating a Remote Pod from Console Creating a Remote Flow