Skip to content

Commit 1ebb10b

Browse files
committed
fix miss metrics endpoint bind
Signed-off-by: googs1025 <[email protected]>
1 parent 568e6e4 commit 1ebb10b

File tree

6 files changed

+38
-0
lines changed

6 files changed

+38
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
283283
$(ENVTEST): $(LOCALBIN)
284284
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
285285

286+
.PHONY: prometheus
287+
prometheus:
288+
kubectl apply --server-side -k config/prometheus
289+
286290
##@Release
287291

288292
.PHONY: artifacts
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{- if .Values.prometheus.install -}}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: ServiceMonitor
4+
metadata:
5+
name: {{ include "chart.fullname" . }}-controller-manager-metrics-monitor
6+
labels:
7+
app.kubernetes.io/component: metrics
8+
app.kubernetes.io/created-by: llmaz
9+
app.kubernetes.io/part-of: llmaz
10+
control-plane: controller-manager
11+
{{- include "chart.labels" . | nindent 4 }}
12+
spec:
13+
endpoints:
14+
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
15+
path: /metrics
16+
port: https
17+
scheme: https
18+
tlsConfig:
19+
insecureSkipVerify: true
20+
selector:
21+
matchLabels:
22+
control-plane: controller-manager
23+
{{- end }}

chart/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ spec:
4242
- containerPort: 9443
4343
name: webhook-server
4444
protocol: TCP
45+
- containerPort: 8080
46+
name: metrics
47+
protocol: TCP
4548
readinessProbe:
4649
httpGet:
4750
path: /readyz

chart/values.global.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,6 @@ backendRuntime:
55

66
leaderWorkerSet:
77
install: true
8+
9+
prometheus:
10+
install: true

config/manager/manager.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ spec:
7777
capabilities:
7878
drop:
7979
- "ALL"
80+
ports:
81+
- containerPort: 8080
82+
name: metrics
83+
protocol: TCP
8084
livenessProbe:
8185
httpGet:
8286
path: /healthz
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
namespace: llmaz-system
12
resources:
23
- monitor.yaml

0 commit comments

Comments
 (0)