Skip to content

Commit d0755e3

Browse files
authored
feat(tx-submit-api): enhance tx-submit-api (#226)
1 parent a5c280a commit d0755e3

File tree

7 files changed

+65
-31
lines changed

7 files changed

+65
-31
lines changed

.github/workflows/publish-tx-submit-api-helm-chart.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: publish-tx-submit-api-helm-chart
33
on:
44
push:
55
branches: ['main']
6-
paths: ['charts/tx-submit-api-/**','.github/workflows/publish-tx-submit-api-helm-chart.yml']
6+
paths: ['charts/tx-submit-api/**','.github/workflows/publish-tx-submit-api-helm-chart.yml']
77

88
jobs:
99
build-and-push-tx-submit-api-helm-chart:

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.14
4+
version: 0.1.15
55
appVersion: 0.20.8
66
maintainers:
77
- name: aurora

charts/tx-submit-api/templates/_helpers.tpl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Create chart name and version as used by the chart label.
3131
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
3232
{{- end -}}
3333

34-
3534
{{/*
3635
Define Cardano network.
3736
*/}}
@@ -57,3 +56,13 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
5756
cardano_network: {{ include "tx-submit-api.network" . }}
5857
cardano_service: tx-submit-api
5958
{{- end -}}
59+
60+
{{/*
61+
tx-submit-api selector labels
62+
*/}}
63+
{{- define "tx-submit-api.selectorLabels" -}}
64+
app.kubernetes.io/name: {{ include "tx-submit-api.fullname" . }}
65+
app.kubernetes.io/instance: {{ .Release.Name }}
66+
cardano_network: {{ include "tx-submit-api.network" . }}
67+
cardano_service: tx-submit-api
68+
{{- end -}}

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

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,17 @@ metadata:
88
spec:
99
replicas: {{ .Values.replicaCount }}
1010
selector:
11-
matchLabels:
12-
cardano_network: {{ .Values.cardano_network }}
13-
app.kubernetes.io/name: {{ include "tx-submit-api.fullname" . }}
14-
{{ include "tx-submit-api.labels" . | indent 6 }}
11+
matchLabels: {{ include "tx-submit-api.selectorLabels" . | nindent 6 }}
1512
template:
1613
metadata:
17-
labels:
18-
cardano_network: {{ .Values.cardano_network }}
19-
app.kubernetes.io/name: {{ include "tx-submit-api.fullname" . }}
20-
{{ include "tx-submit-api.labels" . | indent 8 }}
14+
labels: {{ include "tx-submit-api.selectorLabels" . | nindent 8 }}
2115
spec:
2216
{{- if .Values.affinity }}
2317
affinity: {{ .Values.affinity | toYaml | nindent 8 }}
2418
{{- end }}
2519
containers:
26-
- env:
20+
- name: tx-submit-api
21+
env:
2722
- name: CARDANO_NETWORK
2823
value: {{ .Values.cardano_network }}
2924
- name: CARDANO_NODE_SOCKET_TCP_HOST
@@ -34,7 +29,6 @@ spec:
3429
value: {{ .Values.cardano_node.skip_check | quote }}
3530
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
3631
imagePullPolicy: IfNotPresent
37-
name: tx-submit-api
3832
ports:
3933
- name: api
4034
containerPort: 8090
@@ -46,6 +40,23 @@ spec:
4640
volumeMounts:
4741
- mountPath: /node-ipc
4842
name: node-ipc
43+
- name: socat-socket-server
44+
env:
45+
- name: CARDANO_NODE_SOCKET_TCP_HOST
46+
value: {{ .Values.cardano_node.host }}
47+
- name: CARDANO_NODE_SOCKET_TCP_PORT
48+
value: {{ .Values.cardano_node.port | quote }}
49+
- name: SOCAT_TIMEOUT
50+
value: "3600"
51+
image: alpine/socat
52+
args:
53+
- -d
54+
- -d
55+
- "UNIX-LISTEN:/node-ipc/node.socket,fork,unlink-early"
56+
- "TCP:$(CARDANO_NODE_SOCKET_TCP_HOST):$(CARDANO_NODE_SOCKET_TCP_PORT),keepalive,nodelay,connect-timeout=5,forever,interval=5"
57+
volumeMounts:
58+
- mountPath: /node-ipc
59+
name: node-ipc
4960
restartPolicy: Always
5061
serviceAccountName: ""
5162
{{- if .Values.tolerations }}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ spec:
2121
tls:
2222
- hosts:
2323
- {{ .Values.ingress.host }}
24+
secretName: {{ .Values.ingress.secretName }}
2425
{{- end }}
Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1+
{{- if .Values.service.enabled }}
12
---
23
apiVersion: v1
34
kind: Service
45
metadata:
5-
labels:
6-
app: {{ include "tx-submit-api.fullname" . }}
7-
{{ include "tx-submit-api.labels" . | indent 4 }}
6+
labels: {{ include "tx-submit-api.selectorLabels" . | nindent 4 }}
87
name: {{ include "tx-submit-api.fullname" . }}
98
spec:
109
ports:
11-
- name: tx-submit-api
12-
port: 8090
10+
- name: api
11+
port: {{ .Values.service.apiPort }}
1312
protocol: TCP
1413
targetPort: 8090
15-
selector:
16-
cardano_network: {{ .Values.cardano_network }}
17-
app.kubernetes.io/name: {{ include "tx-submit-api.fullname" . }}
14+
- name: metrics
15+
port: {{ .Values.service.metricsPort }}
16+
protocol: TCP
17+
targetPort: 8081
18+
selector: {{ include "tx-submit-api.selectorLabels" . | nindent 4 }}
1819
sessionAffinity: ClientIP
19-
type: ClusterIP
20+
type: {{ .Values.service.type }}
21+
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
22+
{{- end }}

charts/tx-submit-api/values.yaml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
---
22
cardano_network: preview
33
cardano_node:
4-
host: cardano-node-headless
5-
port: 30000
4+
host: preview-node.play.dev.cardano.org:3001
5+
port: 3001
66
skip_check: true
77
image:
88
repository: ghcr.io/blinklabs-io/tx-submit-api
99
tag: 0.20.7
10+
replicaCount: 1
11+
resources: {}
12+
13+
affinity: {}
14+
15+
tolerations: []
16+
1017
ingress:
1118
enabled: false
19+
annotations: {}
1220
host: submit-api.preview.local
13-
replicaCount: 1
14-
resources: {}
15-
tolerations:
16-
- key: kubernetes.io/arch
17-
operator: Equal
18-
value: arm64
19-
effect: NoSchedule
21+
secretName: submit-api-preview-local-tls
22+
23+
service:
24+
enabled: false
25+
apiPort: 8090
26+
metricsPort: 8081
27+
annotations: {}
28+
type: LoadBalancer
29+
externalTrafficPolicy: Cluster

0 commit comments

Comments
 (0)