Normally, if you'd like to create a custom Prometheus alert rule in your Konvoy cluster, you can follow the "my-rule-file" example in our documentation here to edit your cluster.yaml file:
https://docs.d2iq.com/dkp/konvoy/1.7/monitoring/#configuring-alerts-using-alertmanager
However, if you're trying to create a rule that contains templating values, it will not work via cluster.yaml.
The reason for this is that Konvoy's deployment mechanism uses Ansible, which interprets varibles with the same syntax. There is no way to escape this syntax in a way that will make Ansible ignore it but will still work with Prometheus.
To create rules with templating values, you will need to create them manually after the cluster is deployed and operational.
To do this, you must edit the corresponding "prometheusrule" object. To list them in a Konvoy cluster, you can run:
Once you've identified the prometheusrule object that is most appropriate for the rule you're trying to create, you can run:
You can follow the Prometheus documentation for the proper rule syntax:
https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/
https://docs.d2iq.com/dkp/konvoy/1.7/monitoring/#configuring-alerts-using-alertmanager
However, if you're trying to create a rule that contains templating values, it will not work via cluster.yaml.
The reason for this is that Konvoy's deployment mechanism uses Ansible, which interprets varibles with the same syntax. There is no way to escape this syntax in a way that will make Ansible ignore it but will still work with Prometheus.
To create rules with templating values, you will need to create them manually after the cluster is deployed and operational.
To do this, you must edit the corresponding "prometheusrule" object. To list them in a Konvoy cluster, you can run:
kubectl get prometheusrules -n kubeaddons
Once you've identified the prometheusrule object that is most appropriate for the rule you're trying to create, you can run:
kubectl edit prometheusrule -n kubeaddons
You can follow the Prometheus documentation for the proper rule syntax:
https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/