- Install
Go 1.22.1
. - Install
make
. - Clone this repository into your Go workspace.
make run
Testing with health endpoint
curl -iX GET http://localhost:4200/api/v1/health
HTTP/1.1 200 OK
goapi-Version: 1.0
Date: Tue, 12 Apr 2016 17:33:34 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8
make docker_run
curl -iX GET localhost:4200/api/v1/health
HTTP/1.1 200 OK
Goapi-Version: 1.0
Date: Wed, 13 Apr 2016 14:31:51 GMT
Content-Length: 0
Content-Type: text/plain; charset=utf-8
- Ensure you have minikube installed
- Ensure you have Docker installed on your machine
- start minikube
minikube start
- set-up minikube's Docker Daemon
- macOS and Linux
- configure your shell to use Minikube's Docker daemon by running the following command:
eval $(minikube -p minikube docker-env)
- Windows
- In PowerShell, configure the environment by running:
& minikube -p minikube docker-env | Invoke-Expression
- macOS and Linux
- verify the docker environment
docker info
- Use
make all
command to start the deploymentmake all
- Forward the port using
kubectl
kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT
- Helm installed and initialized
- Kubernetes cluster running
goapi
application deployed
Run the following command to deploy Prometheus and set up monitoring in the monitoring
namespace:
helm upgrade --install prometheus prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespace
To make Prometheus start scraping metrics from your goapi application, you need to apply servicemonitor-goapi.yaml configuration.
kubectl apply -f deployment/monitoring/servicemonitor-goapi.yaml