Skip to content

Commit c355549

Browse files
authored
feat(tx-submit-api): add PodMonitor, metrics port, and extraPodLabels (#355)
* 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> * fix(tx-submit-api): render extraPodLabels before selectorLabels Ensures selector labels always take precedence over extraPodLabels, preventing accidental override of labels used in matchLabels. Signed-off-by: wcatz <waynecataldo@gmail.com> --------- Signed-off-by: wcatz <waynecataldo@gmail.com>
1 parent f72ebd5 commit c355549

4 files changed

Lines changed: 49 additions & 3 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: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ spec:
1515
matchLabels: {{ include "tx-submit-api.selectorLabels" . | nindent 6 }}
1616
template:
1717
metadata:
18-
labels: {{ include "tx-submit-api.selectorLabels" . | nindent 8 }}
18+
labels:
19+
{{- with .Values.extraPodLabels }}
20+
{{- toYaml . | nindent 8 }}
21+
{{- end }}
22+
{{- include "tx-submit-api.selectorLabels" . | nindent 8 }}
1923
spec:
2024
{{- if .Values.affinity }}
2125
affinity: {{ .Values.affinity | toYaml | nindent 8 }}
@@ -35,7 +39,9 @@ spec:
3539
imagePullPolicy: IfNotPresent
3640
ports:
3741
- name: api
38-
containerPort: 8090
42+
containerPort: {{ .Values.service.apiPort | default 8090 }}
43+
- name: metrics
44+
containerPort: {{ .Values.service.metricsPort | default 8081 }}
3945
readinessProbe:
4046
httpGet:
4147
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)