Search code examples
kubernetesgoogle-cloud-platformgrpcgoogle-kubernetes-enginegrpc-node

How do I deploy a GRPC server and client on Google Cloud Platform?


I'm kind of a newbie at using GCP/Kubernetes. I want to deploy both a GRPC service and a client to GCP.

I have read a lot about it and have tried several things. There's something on cloud endpoints where you compile your proto file and do an api.config.yaml. (https://cloud.google.com/endpoints/docs/grpc/get-started-grpc-kubernetes-engine)

That's not what I'm trying to do. I want to upload a GRPC service with it's .proto and expose its HTTP/2 public IP address and port. Then, deploy a GRPC client that interacts with that address and exposes REST endpoints.

How can I get this done?


Solution

  • To deploy a grpc application to GKE/Kubernetes:

    1. Learn about gRPC, follow one of the quickstarts at https://grpc.io/docs/quickstart/
    2. Learn about how to build Docker images for your application.
    3. Once you have a Docker image, follow https://cloud.google.com/kubernetes-engine/docs/tutorials/hello-app tutorial to learn how to:
      • push a container image to Google Container Registry
      • create a GKE cluster
      • deploy the container image
      • expose it on public internet on an IP address.

    These should be good to start with.

    Note that gRPC apps aren't much different than just HTTP web server apps. As far as Kubernetes is concerned, they're just a container image with a port number. :)