Skip to content

Commit

Permalink
operator: fix production templates namespaces (grafana#3257)
Browse files Browse the repository at this point in the history
Co-authored-by: Craig Peterson <[email protected]>
  • Loading branch information
ndrpnt and captncraig authored Dec 7, 2023
1 parent 400c2be commit 6199043
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
6 changes: 3 additions & 3 deletions production/kubernetes/build/templates/operator/main.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ local ksm = import 'kube-state-metrics/kube-state-metrics.libsonnet';
name='kubelet-monitor',
namespace=this._config.namespace,
monitorLabels={ instance: 'primary' },
targetNamespace=this._config.namespace,
targetNamespace='default',
targetLabels={ 'app.kubernetes.io/name': 'kubelet' },
jobLabel=this._config.kubelet_job,
metricsPath='/metrics',
Expand All @@ -110,9 +110,9 @@ local ksm = import 'kube-state-metrics/kube-state-metrics.libsonnet';
),
mon_util.newKubernetesMonitor(
name='cadvisor-monitor',
namespace='default',
namespace=this._config.namespace,
monitorLabels={ instance: 'primary' },
targetNamespace=this._config.namespace,
targetNamespace='default',
targetLabels={ 'app.kubernetes.io/name': 'kubelet' },
jobLabel=this._config.cadvisor_job,
metricsPath='/metrics/cadvisor',
Expand Down
48 changes: 24 additions & 24 deletions production/operator/templates/agent-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -563,83 +563,83 @@ kind: ServiceMonitor
metadata:
labels:
instance: primary
name: ksm-monitor
name: cadvisor-monitor
namespace: ${NAMESPACE}
spec:
endpoints:
- honorLabels: true
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
honorLabels: true
interval: 60s
path: /metrics
port: http-metrics
path: /metrics/cadvisor
port: https-metrics
relabelings:
- sourceLabels:
- __metrics_path__
targetLabel: metrics_path
- action: replace
replacement: kube-state-metrics
replacement: cadvisor
targetLabel: job
scheme: https
tlsConfig:
insecureSkipVerify: true
namespaceSelector:
matchNames:
- ${NAMESPACE}
- default
selector:
matchLabels:
app.kubernetes.io/name: kube-state-metrics
app.kubernetes.io/name: kubelet
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
instance: primary
name: kubelet-monitor
name: ksm-monitor
namespace: ${NAMESPACE}
spec:
endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
honorLabels: true
- honorLabels: true
interval: 60s
path: /metrics
port: https-metrics
port: http-metrics
relabelings:
- sourceLabels:
- __metrics_path__
targetLabel: metrics_path
- action: replace
replacement: kubelet
replacement: kube-state-metrics
targetLabel: job
scheme: https
tlsConfig:
insecureSkipVerify: true
namespaceSelector:
matchNames:
- ${NAMESPACE}
selector:
matchLabels:
app.kubernetes.io/name: kubelet
app.kubernetes.io/name: kube-state-metrics
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
instance: primary
name: cadvisor-monitor
namespace: default
name: kubelet-monitor
namespace: ${NAMESPACE}
spec:
endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
honorLabels: true
interval: 60s
path: /metrics/cadvisor
path: /metrics
port: https-metrics
relabelings:
- sourceLabels:
- __metrics_path__
targetLabel: metrics_path
- action: replace
replacement: cadvisor
replacement: kubelet
targetLabel: job
scheme: https
tlsConfig:
insecureSkipVerify: true
namespaceSelector:
matchNames:
- ${NAMESPACE}
- default
selector:
matchLabels:
app.kubernetes.io/name: kubelet

0 comments on commit 6199043

Please sign in to comment.