This repo is setup to play about with running Golang base services within a kubernetes environment.
One of the main objects, is to be able to effectively track a request as it goes through different services within the k8s cluster.
Tracking is useful for keeping processing requests in a non blocking format, and allow to see the latency of the request at each step of its journey, and the overall request time.
- Terraform -> Kubernetes
- Helm -> Kubernets resources
- Vault -> Secrets
- Github CI
- Lambda style applications that enrich data as it flows through the system
- Each app records heart beat of request as it passes through
- Prometheus
- Grafana
- Jaeger
- Client request
- API gateway
- Validates request
- Failing requests return an error to the client
- Determine which service should handle query
- Message is placed sent to a given PubSub topic
- Validates request
- Secondary service
- Picks up message from PubSub subscription
- Processes request
- Publishes response back onto the PubSub, for the API gateway to consume
- API gateway
- Watches for responses
- Gets response
- Either directly from the PubSub message or Redis
- Response is sent back to the client
- Create tracking span, and add it to the client request
- Create datastore record
- Pass client request to the enrichment API
- Wait for record to be finalised
- Redirect loopg
- Return response to client
This project is setup with Docker (docker-compose), and Makefiles, for ease of use.
Simply make sure you have docker-compose installed locally.
This repo not only contains the Golang source, but also comes with helm chart for installing the application on kubernetes.
To run application locally within a kubernetes environment, you can install minikube.
To get the application running locally, simply run:
make docker.run
[Logrus](golang logrus vs zerolog) - Logging Open Telemetry - Metrics and tracing