Open luisvieirajs opened 1 month ago
I manage to use below as workaround
kubectl -n k8sgpt-operator-system patch serviceMonitor release-k8sgpt-operator-controller-manager-metrics-monitor -p '{"metadata":{"labels":{"release":"prometheus"}}}' --type=merge
This is an known workaround. Please don't respond This Bug Report with such solution. I am not looking for workarounds. I won't propose to a Enterprise client to automate their processes running command line stuff.
@luisvieirajs you could use additionalLabels
for that: https://github.com/k8sgpt-ai/k8sgpt-operator/blob/main/chart/operator/values.yaml#L8
serviceMonitor:
enabled: true
additionalLabels:
release: prometheus
Checklist
Affected Components
K8sGPT Version
0.2.0
Kubernetes Version
0.0.26
Host OS and its Version
No response
Steps to reproduce
helm upgrade --install k8sgpt \ k8sgpt/k8sgpt-operator -n k8sgpt-operator-system \ --create-namespace \ --set serviceMonitor.enabled=true \ --set grafanaDashboard.enabled=true \ --wait
Expected behaviour
Deploy k8sgtp service monitor without prometheus label "release: prometheus" required by the prometheus service discovery
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
annotations:
meta.helm.sh/release-name: k8sgpt
meta.helm.sh/release-namespace: k8sgpt-operator-system
creationTimestamp: "2024-10-01T21:46:19Z"
generation: 1
labels:
app.kubernetes.io/component: metrics
app.kubernetes.io/created-by: k8sgpt-operator
app.kubernetes.io/instance: k8sgpt
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: k8sgpt-operator
app.kubernetes.io/part-of: k8sgpt-operator
app.kubernetes.io/version: 0.0.26
control-plane: controller-manager
helm.sh/chart: k8sgpt-operator-0.2.0