This contains very basic server program and it's endpoint monitoring with prometheus. Currently this setup only works on minikube.This repo is highly motivated from this repo. rbac-setup file added to run this setup on k8s cluster.
- cd to this folder
- run
minikube start
(minikube is required) - run script
sh server-script.sh
- check pods
kubectl get pods
- check svc
kubectl get svc
- check configmap
kubectl get configmap
- Once all working fine, run
minikube service goserver-service
(It will start server on a browser) - Now run
minikube service prometheus-service
(It will launch prometheus expression browser, where you can monitor your app)
- cd to this folder
- run
kubectl create -f rbac-setup.yaml
- repeat step 3 to 6 like in minikube
- once you get status of containers runnig run
ssh -NL 1234:localhost:32514 ubuntu@<ip_address of Node>
and open localhost:1234 in your browser to access ui of prometheus from outside k8s cluster setup. - run
ssh -NL 1235:localhost:32500 ubuntu@<ip_address of Node>
and open localhost:1235 in your browser to hit at the /latest/volumes from outside k8s cluster setup. - Now you will be able to see the targets in status (dropdown button) and custom metrics.