-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[kube-prometheus-stack] Use namespaceOverrides when set #1343
[kube-prometheus-stack] Use namespaceOverrides when set #1343
Conversation
charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/etcd.yaml
Outdated
Show resolved
Hide resolved
fc0c761
to
1b20583
Compare
charts/kube-prometheus-stack/templates/grafana/dashboards-1.14/alertmanager-overview.yaml
Outdated
Show resolved
Hide resolved
74ab1f0
to
c486c90
Compare
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.
Sorry, noticed another potential issue with namespace selectors in serivcemonitors:
Could you try testing this end-to-end with all possible namespace overrides set to different values and see if everything remains fully operational?
@vsliouniaev Actually, I have a problem when doing Helm template (from ArgoCD):
The CI has the same message. Also, your link is not pointing to a specific file. Could you update it? |
c486c90
to
3a95578
Compare
@vsliouniaev I found the cause: from the doc:
... and defining a template twice leads to mixed scope. To fix this, I removed the templates from |
3a95578
to
c41c7d4
Compare
In can confirm that it works: $ helm template --set grafana.namespaceOverride=grafana --set kube-state-metrics.namespaceOverride=kube-state-metrics --set prometheus-node-exporter.namespaceOverride=prometheus-node-exporter . | grep -A 5 'kind: ServiceMonitor'
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-alertmanager
namespace: default
labels:
app: kube-prometheus-stack-alertmanager
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-coredns
namespace: default
labels:
app: kube-prometheus-stack-coredns
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-apiserver
namespace: default
labels:
app: kube-prometheus-stack-apiserver
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-kube-controller-manager
namespace: default
labels:
app: kube-prometheus-stack-kube-controller-manager
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-kube-etcd
namespace: default
labels:
app: kube-prometheus-stack-kube-etcd
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-kube-proxy
namespace: default
labels:
app: kube-prometheus-stack-kube-proxy
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-kube-scheduler
namespace: default
labels:
app: kube-prometheus-stack-kube-scheduler
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-kube-state-metrics
namespace: kube-state-metrics
labels:
app: kube-prometheus-stack-kube-state-metrics
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-kubelet
namespace: default
labels:
app: kube-prometheus-stack-kubelet
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-node-exporter
namespace: prometheus-node-exporter
labels:
app: kube-prometheus-stack-node-exporter
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-grafana
namespace: grafana
labels:
app: kube-prometheus-stack-grafana
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-operator
namespace: default
labels:
app: kube-prometheus-stack-operator
--
kind: ServiceMonitor
metadata:
name: RELEASE-NAME-kube-promethe-prometheus
namespace: default
labels:
app: kube-prometheus-stack-prometheus |
There are namespace selectors in a few servicemonitors that I think will cause issues: https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-prometheus-stack/templates/exporters/kube-state-metrics/serviceMonitor.yaml#L50-L54 |
thanks @vsliouniaev I've removed I've also fixed the prometheus Datasource. Currently testing ... |
At 4f92516, with
|
4f92516
to
6077313
Compare
@vsliouniaev Please review again. NB: I've rebased to resolve a merge conflict. |
From the code, I can see there is an inconsistency in the namespaces in charts/kube-prometheus-stack/templates/exporters/node-exporter/servicemonitor.yaml. |
6077313
to
767b6a5
Compare
@vsliouniaev Thanks. Fixed. back to you 🏓 ! |
This generally looks like it's working. Not sure what the use-case is for such an added complication to the chart. |
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
… set Signed-off-by: Mathieu Parent <math.parent@gmail.com>
…e when set Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Signed-off-by: Mathieu Parent <math.parent@gmail.com>
…aceOverride Signed-off-by: Mathieu Parent <math.parent@gmail.com>
767b6a5
to
be48f7f
Compare
@vsliouniaev I think it's a good idea to separate the components in different namespaces. Namespaces are security boundaries in k8s, and usage of network policies or roles is easier. Monitoring is also easier. Also, I'm not the only one using namespace overrides (See older bugs #984, #820), this PR fixes all remaining problems about nsOverrides. Note: I've resolved conflict and force-pushed. |
Thanks @vsliouniaev ! |
This breaks namespace independence. Created #1382 |
…ommunity#1343) * [kube-prometheus-stack] Use grafana.namespaceOverride when set Signed-off-by: Mathieu Parent <math.parent@gmail.com> * [kube-prometheus-stack] Use kube-state-metrics.namespaceOverride when set Signed-off-by: Mathieu Parent <math.parent@gmail.com> * [kube-prometheus-stack] Use prometheus-node-exporter.namespaceOverride when set Signed-off-by: Mathieu Parent <math.parent@gmail.com> * [kube-prometheus-stack] Specify namespace for Prometheus datasource Signed-off-by: Mathieu Parent <math.parent@gmail.com> * [kube-prometheus-stack] Remove kubeStateMetrics.serviceMonitor.namespaceOverride Signed-off-by: Mathieu Parent <math.parent@gmail.com> Signed-off-by: QuentinBisson <quentin@giantswarm.io>
…ommunity#1343) * [kube-prometheus-stack] Use grafana.namespaceOverride when set Signed-off-by: Mathieu Parent <math.parent@gmail.com> * [kube-prometheus-stack] Use kube-state-metrics.namespaceOverride when set Signed-off-by: Mathieu Parent <math.parent@gmail.com> * [kube-prometheus-stack] Use prometheus-node-exporter.namespaceOverride when set Signed-off-by: Mathieu Parent <math.parent@gmail.com> * [kube-prometheus-stack] Specify namespace for Prometheus datasource Signed-off-by: Mathieu Parent <math.parent@gmail.com> * [kube-prometheus-stack] Remove kubeStateMetrics.serviceMonitor.namespaceOverride Signed-off-by: Mathieu Parent <math.parent@gmail.com>
What this PR does / why we need it:
Uses
grafana.namespaceOverride
,kube-state-metrics.namespaceOverride
andprometheus-node-exporter.namespaceOverride
when set, for created resource.(includes #1342).
Checklist
[prometheus-couchdb-exporter]
)