Overview
Goal | Configure the Microgateway to publish metrics. Prometheus scrapes those metrics and Grafana will visualize them. |
Notes | Microgateway provides also metrics about authenticated sessions. Keep in mind that this is a premium feature and requires a valid license. Without a valid license, Airlock Microgateway runs as Community Edition. For more details see Features and support. |
Preparation
- Deploy the Kubernetes exercise
- 1.Run the following commands:
- The exercise has been deployed successfully.
The exercise does not contain any licenses. Therefore, Airlock Microgateway runs as Community Edition
For more details see Features and support.
To run the exercise as Premium Edition, copy a valid license to .templates/microgateway/secret/microgateway.lic and execute kubectl apply -k . to re-deploy the Microgateway.
Instruction
- Change the Microgateway configuration
- 1.Connect to the website:
- ●Open the URL in your browser: https://<MINIKUBE_IP>/
- Check the following:
- ●Are metrics shown for the pod echo-microgateway and grafana-microgateway?
- 2.Open Prometheus:
- ●Open the URL in your browser: https://<MINIKUBE_IP>/prometheus/
- 3.Go to: Status >> Targets
- The following should be noticed:
- ●An error is displayed for the endpoint http://<cluster ip of echo-microgateway pod>:9090/metrics
- 4.Check the status of the echo-microgateway pod.
- 5.Edit the echo-microgateway deployment definition.
- Configure the following settings in the echo-microgateway deployment definition:
- ●deployment.spec.template.metadata.annotations['prometheus.io/port']
- 6.Check the status of the echo-microgateway pod.
- 7.Connect to the website:
- ●Open the URL in your browser: https://<MINIKUBE_IP>/
- Check the following:
- ●Are metrics shown for the pod echo-microgateway and grafana-microgateway?
- Metrics are available for all desired services.
server returned HTTP status 404 Not Found
Cleanup
- Delete Kubernetes resources from previously exercises or solutions
- 1.Run the following commands:
- All relevant Kubernetes resources in the namespace have been deleted successfully.
copy
kubectl delete all,ing,cm,secrets,pv,pvc,sa,roles,rolebindings,clusterroles,clusterrolebindings -l purpose=microgateway-tutorial