fix: prometheus deploys as namespaced resource without prometheus-server clusterrole and clusterrolebinding

This commit is contained in:
Willem 2025-07-07 14:33:09 -04:00
parent 2c208df143
commit 31661aaaf1

View File

@ -12,24 +12,41 @@ pub fn prometheus_helm_chart_score(config: Arc<Mutex<PrometheusConfig>>) -> Helm
let ns = config.namespace.clone().unwrap();
let values = format!(
r#"
releaseNamespace: true
rbac:
create: true
namespaced: true
create: false
kube-state-metrics:
enabled: false
prometheus-node-exporter:
enabled: false
prometheus-pushgateway:
enabled: false
server:
releaseNamespace: true
clusterRole: false
clusterRoleBinding: false
rbac:
create: true
namespaced: true
serverFiles:
prometheus.yml:
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
serviceMonitorNamespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {ns}
podMonitorNamespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {ns}
alertmanager:
enabled: true
pushgateway:
enabled: false
server:
serviceAccount:
create: true
rbac:
create: false
fullnameOverride: prometheus-{ns}
create: true
namespaced: true
"#
);
HelmChartScore {