Closed dabo-devconsole closed 1 day ago
Do you have the Prometheus operator running in your cluster?
Yes, the kube-prometheus-stack-operator is running in version v0.71.2 in the cluster.
This is unusual, I'm unable to reproduce the problem. It seems to be working fine without any issues. Perhaps we should consider adding the endpoint here just to be cautious.
Hi,
I am experiencing the same issue but while using Prometheus community Helm chart:
│ Error: failed to create resource: ServiceMonitor.monitoring.coreos.com "prometheus-exporter" is invalid: spec.endpoints: Required value
The result is that the pod is in a CrashLoopBackOff:
prometheus-exporter-f4dc7988f-dmf2d 0/1 CrashLoopBackOff 4 (25s ago) 117s
Here is the configuration of the Helm chart:
kubescape:
# Enable prometheus pod annotations,to allow your opensource prometheus (not operator) to scrape metrics
prometheusAnnotation:
enabled: true
capabilities:
# Kubescape integration with Prometheus Community Hlem chart
prometheusExporter: enable
Yes it pretty much looks the same. I'm also using the Prometheus community helm chart, especially the prometheus-community/kube-prometheus-stack.
I have also encountered this issue:
Error: failed to create resource: ServiceMonitor.monitoring.coreos.com "prometheus-exporter" is invalid: spec.endpoints: Required value
I agree with @dwertent suggestion that the spec.endpoints might need to be added here.
What's the workaround?
I will look into this today :)
We are experiencing the same problem, we deployed a separate servicemonitor outside of the helm deployment as a workaround. The following ressource definition works for us, depending on how the prometheus instance is configured one might also need to add a label for the prometheus selector (we disabled it completely).
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
app: prometheus-exporter
name: kubescape
namespace: kubescape
spec:
endpoints:
- interval: 30s
targetPort: 8080
path: /metrics
namespaceSelector:
matchNames:
- kubescape
selector:
matchLabels:
app: prometheus-exporter
@dabo-devconsole @l-spork-cc can you check with the latest chart please?
Hi @matthyx, same error in Chart version 1.21.2. Do I missed something?
should be fixed in the next release (probably next week)
Description
Helm installation fails to deploy the prometheus-exporter ServiceMonitor.
Environment
OS: Ubuntu 22.04 LTS Version: 3.0.3
Steps To Reproduce
Expected behavior
ServiceMonitor is created
Actual Behavior
ServiceMonitor is not created
Additional context
The template is missing the required "endpoints" specification.