-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delete generated PrometheusRule and rule files #39
Comments
It seems there is semi-standard label
Something like
should work for managing k8s objects? This, however, doesn't cover case when pyrra is deployed multiple times into different namespaces (is that even supported?) |
chlunde
added a commit
to chlunde/pyrra
that referenced
this issue
Nov 11, 2021
By setting owner references on the object we create, kubernetes will handle deletion of the generated PrometheusRule when the corresponding ServiceLevelObjective is deleted. Example: k apply -f examples/pyrra-http-errors.yaml servicelevelobjective.pyrra.dev/pyrra-api-errors created we see that the controller generates a prometheusrule object: k get prometheusrule,servicelevelobjective -n monitoring NAME AGE prometheusrule.monitoring.coreos.com/pyrra-api-errors 1s servicelevelobjective.pyrra.dev/pyrra-api-errors 1s when we delete the SLO, the matching rule is deleted: k delete servicelevelobjective.pyrra.dev/pyrra-api-errors -n monitoring k get prometheusrule,servicelevelobjective -n monitoring No resources found in monitoring namespace. Updates pyrra-dev#39
chlunde
added a commit
to chlunde/pyrra
that referenced
this issue
Nov 23, 2021
By setting owner references on the object we create, kubernetes will handle deletion of the generated PrometheusRule when the corresponding ServiceLevelObjective is deleted. Example: k apply -f examples/pyrra-http-errors.yaml servicelevelobjective.pyrra.dev/pyrra-api-errors created we see that the controller generates a prometheusrule object: k get prometheusrule,servicelevelobjective -n monitoring NAME AGE prometheusrule.monitoring.coreos.com/pyrra-api-errors 1s servicelevelobjective.pyrra.dev/pyrra-api-errors 1s when we delete the SLO, the matching rule is deleted: k delete servicelevelobjective.pyrra.dev/pyrra-api-errors -n monitoring k get prometheusrule,servicelevelobjective -n monitoring No resources found in monitoring namespace. Updates pyrra-dev#39
This should be closed. Setting OwnerReferences is indeed the right fix here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Both for filesystem and Kubernetes we need to reconcile the generated files so that not only new ones are created or existing ones are updated, but no longer existing ones are deleted.
The tricky part is figuring out the difference of what's gone, but it should be doable nonetheless.
The text was updated successfully, but these errors were encountered: