open-nomad/demo/grpc-checks
Seth Hoenig f2ef576510 demo: create a demo service for grpc healthchecks
Examples for HTTP based task-group service healthchecks are
covered by the `countdash` demo, but gRPC checks currently
have no runnable examples.

This PR adds a trivial gRPC enabled application that provides
a Service implementing the standard gRPC healthcheck interface.
2020-04-24 10:59:50 -06:00
..
example demo: create a demo service for grpc healthchecks 2020-04-24 10:59:50 -06:00
.gitignore demo: create a demo service for grpc healthchecks 2020-04-24 10:59:50 -06:00
Dockerfile demo: create a demo service for grpc healthchecks 2020-04-24 10:59:50 -06:00
README.md demo: create a demo service for grpc healthchecks 2020-04-24 10:59:50 -06:00
go.mod demo: create a demo service for grpc healthchecks 2020-04-24 10:59:50 -06:00
go.sum demo: create a demo service for grpc healthchecks 2020-04-24 10:59:50 -06:00
main.go demo: create a demo service for grpc healthchecks 2020-04-24 10:59:50 -06:00

README.md

grpc-checks

An example service that exposes a gRPC healthcheck endpoint

generate protobuf

Note that main.go also includes this as a go:generate directive so that running this by hand is not necessary

$ protoc -I ./health ./health/health.proto --go_out=plugins=grpc:health

build & run example

Generate, compile, and run the example server.

go generate
go build
go run main.go

publish

Testing locally

$ docker build -t hashicorpnomad/grpc-checks:test .
$ docker run --rm hashicorpnomad/grpc-checks:test

Upload to Docker Hub

# replace <version> with the next version number
docker login
$ docker build -t hashicorpnomad/grpc-checks:<version> .
$ docker push hashicorpnomad/grpc-checks:<version>