Skip to content

Commit d34d327

Browse files
authored
Update the Prometheus example to work directly (#574)
1 parent ea6ff2f commit d34d327

File tree

5 files changed

+49
-13
lines changed

5 files changed

+49
-13
lines changed

config/manager/manager.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,32 @@ spec:
2222
image: controller:latest
2323
imagePullPolicy: IfNotPresent
2424
name: manager
25+
ports:
26+
- name: metrics
27+
containerPort: 8080
2528
resources:
2629
limits:
2730
cpu: 500m
2831
memory: 128Mi
2932
requests:
3033
cpu: 500m
3134
memory: 128Mi
32-
terminationGracePeriodSeconds: 10
35+
securityContext:
36+
readOnlyRootFilesystem: true
37+
allowPrivilegeEscalation: false
38+
privileged: false
39+
volumeMounts:
40+
- name: tmp
41+
mountPath: /tmp
42+
- name: logs
43+
mountPath: /var/log/fdb
44+
terminationGracePeriodSeconds: 10
45+
securityContext:
46+
runAsUser: 4059
47+
runAsGroup: 4059
48+
fsGroup: 4059
49+
volumes:
50+
- name: tmp
51+
emptyDir: {}
52+
- name: logs
53+
emptyDir: {}

config/prometheus/monitor.yaml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
2-
# Prometheus Monitor Service (Metrics)
31
apiVersion: monitoring.coreos.com/v1
4-
kind: ServiceMonitor
2+
kind: PodMonitor
53
metadata:
6-
labels:
7-
control-plane: controller-manager
8-
name: controller-manager-metrics-monitor
9-
namespace: system
4+
name: fdb-kubernetes-operator
105
spec:
11-
endpoints:
12-
- path: /metrics
13-
port: https
146
selector:
15-
control-plane: controller-manager
7+
matchLabels:
8+
app: fdb-kubernetes-operator-controller-manager
9+
podMetricsEndpoints:
10+
- port: metrics
11+
namespaceSelector:
12+
any: true

config/samples/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ spec:
129129
fieldPath: metadata.namespace
130130
image: foundationdb/fdb-kubernetes-operator:v0.30.0
131131
name: manager
132+
ports:
133+
- containerPort: 8080
134+
name: metrics
132135
resources:
133136
limits:
134137
cpu: 500m

config/samples/deployment/manager.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ spec:
3636
valueFrom:
3737
fieldRef:
3838
fieldPath: metadata.namespace
39+
ports:
40+
- name: metrics
41+
containerPort: 8080
3942
resources:
4043
limits:
4144
cpu: 500m
@@ -57,4 +60,4 @@ spec:
5760
apiVersion: v1
5861
kind: ServiceAccount
5962
metadata:
60-
name: controller-manager
63+
name: controller-manager

helm/fdb-operator/templates/rbac/rbac_role.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,15 @@ rules:
9797
- update
9898
- patch
9999
- delete
100+
- apiGroups:
101+
- coordination.k8s.io
102+
resources:
103+
- leases
104+
verbs:
105+
- get
106+
- list
107+
- watch
108+
- create
109+
- update
110+
- patch
111+
- delete

0 commit comments

Comments
 (0)