Skip to content

Go GraphQL & GRPC example microservice with K8s support

Notifications You must be signed in to change notification settings

majoferenc/goland_expedition

Repository files navigation

Goland Expedition

Experimental microservice with Go. API fetching Elastichsearch index for data.

Features

  • GraphQL API with GraphiQL playground for public API
  • GRPC API for fast communication between microservices
  • Skaffold CI/CD
  • Draft CI/CD
  • Docker image
  • Docker-compose ready
  • K8s Helm chart

GRPC interface development

Prerequisites:

go get -u google.golang.org/grpc 
go get -u github.com/golang/protobuf/protoc-gen-go 

When you change something at *.proto files, they need to be recompiled to *.pb.go with command:

protoc --go_out=plugins=grpc:. *.prot

Test GRPC using GRPCUI

Prerequisites:

go get github.com/fullstorydev/grpcui 
go install github.com/fullstorydev/grpcui/cmd/grpcui

You can connect to your GRPC API via command:

 grpcui -plaintext localhost:4040

Deployment

You can run Goland API automatic Docker image build and K8s Helm chart push after every source change with:

skaffold dev

If you want also publish Docker image to your container registry you can use:

draft up

Tekton deployment

Tekton pipelines and Tekton dashboard can be installed into your K8s cluster with command:

kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
kubectl create -f tekton/dashboard/config/release/grc-tekton-dashboard.yaml

Connect to Tekton dashboard

kubectl port-forward svc/tekton-dashboard 9097:9097 --namespace=tekton-pipelines
kubectl create -f tekton/dashboard/config/release/grc-tekton-dashboard.yaml

App deployment

sh tekton/create.sh

About

Go GraphQL & GRPC example microservice with K8s support

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published