-
Notifications
You must be signed in to change notification settings - Fork 18
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
Set prometheus in agent mode and upgrade kube-prometheus-stack to 30.0.0 #510
Conversation
This to get the latest prometheus-operator version so we can use prometheus-agent.
When upgrading the helm chart I got the following error: │ Error: cannot patch "prometheus-kube-state-metrics" with kind Deployment: Deployment.apps "prometheus-kube-state-metrics" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"prometheus", "app.kubernetes.io/name":"kube-state-metrics"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable
│
│ with module.aks1_core.module.prometheus["prometheus"].helm_release.prometheus,
│ on .terraform/modules/aks1_core/modules/kubernetes/prometheus/main.tf line 38, in resource "helm_release" "prometheus":
│ 38: resource "helm_release" "prometheus" { I solved it by deleting the deployment: k delete deployment prometheus-kube-state-metric -n prometheus Just as it says in the error: # OLD
selector:
matchLabels:
app.kubernetes.io/name: kube-state-metrics
# new
selector:
matchLabels:
app.kubernetes.io/instance: prometheus
app.kubernetes.io/name: kube-state-metrics |
It's possible to run in agent mode but it's currently not a first class citizen: prometheus-operator/prometheus-operator#3989 But I will try to apply the workaround described here: https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizations/prometheus-agent.md |
702a854
to
34897e5
Compare
Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
34897e5
to
236208f
Compare
Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
7064c51
to
ab3d012
Compare
As a part of upgrading to this version you will need to delete the old prometheus PVC. or you can also set the replicas to 0 Then delete the PVC kubectl delete pvc prometheus-xks-db-prometheus-xks-0 prometheus-xks-db-prometheus-xks-1 -n prometheus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Great Work 🌹
Upgrade kube-prometheus-stack to 30.0.0, this to get the latest prometheus-operator version so we can use
prometheus in agent mode.
Also run prometheus in agent mode, this to lower resource usage and a smarter way of handling WAL.