This example shows how to configure alert rules in Kyma and how to define a new alert rule for AlertManager.
- Kyma as the target deployment environment.
You need access to the kyma-system
Namespace to execute the described steps.
-
Create a ConfigMap for the alert-rule.
kubectl apply -f deployment/alert-rule-configmap.yaml -n kyma-system
-
Run the
port-forward
command on thecore-prometheus
service to access the Prometheus dashboard.kubectl port-forward pod/prometheus-monitoring-0 -n kyma-system 9090:9090
Find the http-db-service-is-not-running rule here.
As the
http-db-service
Deployment does not the exist, the alert is fired here.
-
Export your Namespace as a variable. Replace the
{namespace}
placeholder in the following command and run it:export KYMA_EXAMPLE_NS="{namespace}"
-
To stop the alert from getting fired, create a Deployment as follows:
kubectl apply -f ../http-db-service/deployment/deployment.yaml -n $KYMA_EXAMPLE_NS
Run the following commands to completely remove the example and all its resources from the cluster:
- Remove the
http-db-service-is-not-running
alert rule from the cluster.
kubectl delete cm -n kyma-system -l example=monitoring-alert-rules
- Run the following command to completely remove
http-db-service
and all its resources from the cluster:
kubectl delete all -l example=http-db-service -n $KYMA_EXAMPLE_NS