Skip to content

naingoted/grpc-nodejs-healthcheck

Repository files navigation

gRPC Server Demo

This is a simple gRPC server built with Node.js. It demonstrates unary, client streaming, and server streaming service methods. It makes use of the Open Notify API to retrieve real-time information about the International Space Station.

Usage

~/$ cd grpc-iss-demo
~/grpc-iss-demo$ npm install
~/grpc-iss-demo$ node server.js

This project assumes the use of a gRPC client like Insomnia. Load the space_station.proto file, which yields the following 3 service methods:

  • getAstronautCount: unary; returns the number of astronauts currently aboard the International Space Station.
  • getAstronautNames: client streaming; after receiving a stream of client messages with astronaut index in each one, returns a single string with the names of all the astronauts corresponding to the indices given.
  • getLocation: server streaming; the client sends seconds, indicating how frequent it wants the server to stream response message; at that frequency, the server sends back a timestamp along with the current latitude/longitude geo-coordinates of the International Space Station.

And Load the health.proto file for

  • check: unary; returns grpc server status

Building Docker Image

  • docker build --no-cache -t naingoted/grpc-healthcheck-demo:1.0 .

Testing Health Check with Kubernetes

  • apply grpcdemoservice.yamlto see readinessProbe and livenessProbe in action.

Random Links

Signing GPG keys

Signing GPG keys with VS code

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published