Skip to content

Commit 3a2139a

Browse files
committed
feat(tx-submit-api): add PodMonitor, metrics port, and extraPodLabels
- Add PodMonitor template with configurable podMetricsEndpoints and podTargetLabels support - Expose metrics container port (default 8081) alongside API port - Add extraPodLabels support for custom pod labels (alias, app, etc.) - Bump chart version to 0.1.20 Signed-off-by: wcatz <waynecataldo@gmail.com>
1 parent a849d88 commit 3a2139a

4 files changed

Lines changed: 47 additions & 2 deletions

File tree

charts/tx-submit-api/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v2
22
name: tx-submit-api
33
description: Creates a Cardano Tx Submit API deployment
4-
version: 0.1.19
4+
version: 0.1.20
55
appVersion: 0.20.9
66
maintainers:
77
- name: aurora

charts/tx-submit-api/templates/deployment.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ spec:
1616
template:
1717
metadata:
1818
labels: {{ include "tx-submit-api.selectorLabels" . | nindent 8 }}
19+
{{- with .Values.extraPodLabels }}
20+
{{- toYaml . | nindent 8 }}
21+
{{- end }}
1922
spec:
2023
{{- if .Values.affinity }}
2124
affinity: {{ .Values.affinity | toYaml | nindent 8 }}
@@ -35,7 +38,9 @@ spec:
3538
imagePullPolicy: IfNotPresent
3639
ports:
3740
- name: api
38-
containerPort: 8090
41+
containerPort: {{ .Values.service.apiPort | default 8090 }}
42+
- name: metrics
43+
containerPort: {{ .Values.service.metricsPort | default 8081 }}
3944
readinessProbe:
4045
httpGet:
4146
path: /healthcheck
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
{{- if .Values.podMonitor.enabled }}
3+
apiVersion: monitoring.coreos.com/v1
4+
kind: PodMonitor
5+
metadata:
6+
name: {{ include "tx-submit-api.fullname" . }}
7+
labels:
8+
{{- include "tx-submit-api.labels" . | nindent 4 }}
9+
{{- with .Values.podMonitor.extraLabels }}
10+
{{ toYaml . | indent 4 }}
11+
{{- end }}
12+
spec:
13+
selector:
14+
matchLabels: {{- include "tx-submit-api.selectorLabels" . | nindent 6 }}
15+
namespaceSelector:
16+
matchNames:
17+
- {{ .Release.Namespace }}
18+
{{- with .Values.podMonitor.podTargetLabels }}
19+
podTargetLabels:
20+
{{- toYaml . | nindent 4 }}
21+
{{- end }}
22+
podMetricsEndpoints:
23+
{{- if .Values.podMonitor.podMetricsEndpoints }}
24+
{{- toYaml .Values.podMonitor.podMetricsEndpoints | nindent 4 }}
25+
{{- else }}
26+
- port: metrics
27+
path: /metrics
28+
scheme: http
29+
interval: 30s
30+
scrapeTimeout: 10s
31+
{{- end }}
32+
{{- end }}

charts/tx-submit-api/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ ingress:
2626
host: submit-api.preview.local
2727
secretName: submit-api-preview-local-tls
2828

29+
extraPodLabels: {}
30+
31+
podMonitor:
32+
enabled: false
33+
extraLabels: {}
34+
podMetricsEndpoints: []
35+
podTargetLabels: []
36+
2937
service:
3038
enabled: false
3139
apiPort: 8090

0 commit comments

Comments
 (0)