Skip to content

Commit 7ced9d0

Browse files
author
Arvind Thirumurugan
committed
fix prometheus
Signed-off-by: Arvind Thirumurugan <arvindth@microsoft.com>
1 parent 426d475 commit 7ced9d0

File tree

7 files changed

+29
-12
lines changed

7 files changed

+29
-12
lines changed

approval-controller-metric-collector/approval-request-controller/examples/prometheus/configmap.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: ConfigMap
33
metadata:
44
name: prometheus-config
5-
namespace: test-ns
5+
namespace: prometheus
66
data:
77
prometheus.yml: |
88
global:
@@ -13,9 +13,7 @@ data:
1313
- job_name: 'kubernetes-pods'
1414
kubernetes_sd_configs:
1515
- role: pod
16-
namespaces:
17-
names:
18-
- test-ns
16+
# Scrape pods from all namespaces
1917
relabel_configs:
2018
# Only scrape pods with prometheus.io/scrape annotation
2119
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]

approval-controller-metric-collector/approval-request-controller/examples/prometheus/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: prometheus
5-
namespace: test-ns
5+
namespace: prometheus
66
labels:
77
app: prometheus
88
spec:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: placement.kubernetes-fleet.io/v1beta1
2+
kind: ClusterResourcePlacement
3+
metadata:
4+
name: sample-metric-app
5+
spec:
6+
resourceSelectors:
7+
- group: ""
8+
version: v1
9+
kind: Namespace
10+
name: prometheus
11+
- group: "rbac.authorization.k8s.io"
12+
version: v1
13+
kind: ClusterRole
14+
name: prometheus
15+
- group: "rbac.authorization.k8s.io"
16+
version: v1
17+
kind: ClusterRoleBinding
18+
name: prometheus
19+
policy:
20+
placementType: PickAll
21+
strategy:
22+
type: RollingUpdate

approval-controller-metric-collector/approval-request-controller/examples/prometheus/rbac.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: ServiceAccount
33
metadata:
44
name: prometheus
5-
namespace: test-ns
5+
namespace: prometheus
66
---
77
apiVersion: rbac.authorization.k8s.io/v1
88
kind: ClusterRole
@@ -36,4 +36,4 @@ roleRef:
3636
subjects:
3737
- kind: ServiceAccount
3838
name: prometheus
39-
namespace: test-ns
39+
namespace: prometheus

approval-controller-metric-collector/approval-request-controller/examples/prometheus/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
name: prometheus
5-
namespace: test-ns
5+
namespace: prometheus
66
labels:
77
app: prometheus
88
spec:

approval-controller-metric-collector/approval-request-controller/examples/stagedupdaterun/example-crp.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@ spec:
1010
version: v1
1111
policy:
1212
placementType: PickAll
13-
tolerations:
14-
- key: gpu-workload
15-
operator: Exists
1613
strategy:
1714
type: External

approval-controller-metric-collector/approval-request-controller/pkg/controller/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const (
4646
metricCollectorFinalizer = "kubernetes-fleet.io/metric-collector-cleanup"
4747

4848
// prometheusURL is the default Prometheus URL to use
49-
prometheusURL = "http://prometheus.test-ns.svc.cluster.local:9090"
49+
prometheusURL = "http://prometheus.prometheus.svc.cluster.local:9090"
5050
)
5151

5252
// Reconciler reconciles an ApprovalRequest object and creates MetricCollector resources

0 commit comments

Comments
 (0)