<p>I have a kubernetes pod, which consists of a container. Within the container, there is a script that I want to run if the container receives a RPC.</p>

<p>I am not familiar with RPC, so this is what I think about the workflow:
 <br>1. create a gRPC client (I am thinking of <code>gin</code>, but any to recommend?)
 <br>2. set up the container as server with port <code>xxxx</code> exposed (how?)
 <br>3. gRPC client sends a request to the container at port <code>xxxx</code> to trigger the script</p>

<p>Is my understanding about the workflow correct?</p>

<p>If my understanding is correct, a brief code snippet or pseudocode in achieving the workflow the will be great!</p>

jtee
<p><a href="https://grpc.io" rel="nofollow noreferrer">gRPC</a> is a high performance, open-source universal RPC framework, based on the TCP communication.
It is possible to send RPC requests to Docker containers running under control of Kubernetes. It is strongly not
recommended to do it this way, because the containers have no static IP address assigned and application probably will
do not know the actual state of the container. Please consider thinking of <a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/" rel="nofollow noreferrer">Kubernetes services</a> as the endpoints of your
RPC requests. Kubernetes services expose static IP mapping and High Availability to make sure that established
connections execute a remote calls.</p>

<p><a href="https://github.com/kelseyhightower/grpc-hello-service/tree/master/Tutorials/kubernetes" rel="nofollow noreferrer">This article</a> may help understand how to deploy RPC application with Kubernetes.</p>
