feat: deploy pod monitor to collect metrics
This commit is contained in:
parent
9a0fbaadce
commit
a485e241b8
3 changed files with 30 additions and 5 deletions
|
@ -14,9 +14,19 @@
|
|||
"root": "/usr/share/caddy",
|
||||
"index_names": [
|
||||
"index.html"
|
||||
],
|
||||
"pass_thru": true
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"metrics" : {
|
||||
"listen": [
|
||||
":9100"
|
||||
],
|
||||
"routes": [
|
||||
{
|
||||
"handle": [
|
||||
{
|
||||
"handler": "metrics"
|
||||
}
|
||||
|
|
|
@ -36,14 +36,17 @@ spec:
|
|||
- name: http
|
||||
containerPort: 3000
|
||||
protocol: TCP
|
||||
- name: metrics
|
||||
containerPort: 9100
|
||||
protocol: TCP
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
port: http
|
||||
port: metrics
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /metrics
|
||||
port: http
|
||||
port: metrics
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
|
|
12
deploy/helm/templates/pod_monitor.yaml
Normal file
12
deploy/helm/templates/pod_monitor.yaml
Normal file
|
@ -0,0 +1,12 @@
|
|||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PodMonitor
|
||||
metadata:
|
||||
name: {{ include "web.fullname" . }}
|
||||
labels:
|
||||
{{- include "web.labels" . | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "web.selectorLabels" . | nindent 6 }}
|
||||
podMetricsEndpoints:
|
||||
- port: metrics
|
Loading…
Reference in a new issue