Skip to content

Commit e8c418c

Browse files
committed
build: add pyxform-http app to chart, bump --> 0.2.1
1 parent 9c41033 commit e8c418c

File tree

7 files changed

+89
-2
lines changed

7 files changed

+89
-2
lines changed

chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: xlsform-builder
33
description: Share and build XLSForms
44
type: application
5-
version: 0.2.0
5+
version: 0.2.1
66
appVersion: "0.1.3"

chart/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# XLSForm Builder Helm Chart
22

33
This Helm chart deploys the XLSForm Builder application,
4-
consisting of a backend API service and a frontend web application.
4+
consisting of a backend API service, a frontend web application, and
5+
a pyxform-http service for XLSForm to XForm conversion.
56

67
## Prerequisites
78

@@ -85,11 +86,18 @@ Key configuration values:
8586
- `ingress.backend.hostname`: Backend API hostname (default: `api.xlsforms.field.hotosm.org`)
8687
- `image.backend.tag`: Backend image tag
8788
- `image.frontend.tag`: Frontend image tag
89+
- `image.pyxform.tag`: Pyxform-http image tag (default: `latest`)
8890
- `frontend.env.apiUrl`: Backend API URL for frontend to use (default: `https://api.xlsforms.field.hotosm.org`)
8991
- `frontend.env.metadataUrl`: S3 metadata.json URL (default: `https://xlsforms.s3.amazonaws.com/metadata.json`)
92+
- `pyxform.healthCheck.enabled`: Enable health checks for pyxform service (default: `false`)
93+
- `pyxform.healthCheck.path`: Health check path (default: `/`)
9094

9195
**Note:** The frontend uses runtime configuration injected via environment variables.
9296
These are used to generate a `config.js` file at container startup, allowing the
9397
frontend to work with different API URLs without rebuilding the image.
9498

99+
**Note:** The backend automatically connects to the pyxform service via the
100+
`PYXFORM_URL` environment variable, which is set to the pyxform service URL
101+
based on the Helm release name.
102+
95103
See `values.yaml` for all available options.

chart/templates/_helpers.tpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@
2222
{{- define "xlsform-builder.frontendFullname" -}}
2323
{{- printf "%s-frontend" (include "xlsform-builder.fullname" .) -}}
2424
{{- end -}}
25+
26+
{{- define "xlsform-builder.pyxformFullname" -}}
27+
{{- printf "%s-pyxform" (include "xlsform-builder.fullname" .) -}}
28+
{{- end -}}

chart/templates/backend-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ spec:
7272
{{- end }}
7373
- name: USE_PATH_STYLE
7474
value: {{ .Values.backend.env.usePathStyle | quote }}
75+
- name: PYXFORM_URL
76+
value: "http://{{ include "xlsform-builder.pyxformFullname" . }}:{{ .Values.service.pyxform.port }}/api/v1/convert"
7577
ports:
7678
- name: http
7779
containerPort: 3001
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "xlsform-builder.pyxformFullname" . }}
5+
labels:
6+
app.kubernetes.io/name: {{ include "xlsform-builder.name" . }}
7+
app.kubernetes.io/component: pyxform
8+
app.kubernetes.io/instance: {{ .Release.Name }}
9+
spec:
10+
replicas: {{ .Values.replicaCount.pyxform }}
11+
selector:
12+
matchLabels:
13+
app.kubernetes.io/name: {{ include "xlsform-builder.name" . }}
14+
app.kubernetes.io/component: pyxform
15+
app.kubernetes.io/instance: {{ .Release.Name }}
16+
template:
17+
metadata:
18+
labels:
19+
app.kubernetes.io/name: {{ include "xlsform-builder.name" . }}
20+
app.kubernetes.io/component: pyxform
21+
app.kubernetes.io/instance: {{ .Release.Name }}
22+
spec:
23+
containers:
24+
- name: pyxform
25+
image: "{{ .Values.image.pyxform.repository }}:{{ .Values.image.pyxform.tag }}"
26+
imagePullPolicy: {{ .Values.image.pyxform.pullPolicy }}
27+
ports:
28+
- name: http
29+
containerPort: {{ .Values.service.pyxform.port }}
30+
{{- if .Values.pyxform.healthCheck.enabled }}
31+
readinessProbe:
32+
httpGet:
33+
path: {{ .Values.pyxform.healthCheck.path }}
34+
port: http
35+
livenessProbe:
36+
httpGet:
37+
path: {{ .Values.pyxform.healthCheck.path }}
38+
port: http
39+
{{- end }}
40+
resources:
41+
{{- toYaml .Values.resources.pyxform | nindent 12 }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "xlsform-builder.pyxformFullname" . }}
5+
labels:
6+
app.kubernetes.io/name: {{ include "xlsform-builder.name" . }}
7+
app.kubernetes.io/component: pyxform
8+
app.kubernetes.io/instance: {{ .Release.Name }}
9+
spec:
10+
type: {{ .Values.service.pyxform.type }}
11+
selector:
12+
app.kubernetes.io/name: {{ include "xlsform-builder.name" . }}
13+
app.kubernetes.io/component: pyxform
14+
app.kubernetes.io/instance: {{ .Release.Name }}
15+
ports:
16+
- name: http
17+
port: {{ .Values.service.pyxform.port }}
18+
targetPort: http

chart/values.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
replicaCount:
22
backend: 1
33
frontend: 1
4+
pyxform: 1
45

56
image:
67
backend:
@@ -13,6 +14,10 @@ image:
1314
# Override tag version; default Chart.AppVersion
1415
tag: ""
1516
pullPolicy: IfNotPresent
17+
pyxform:
18+
repository: ghcr.io/getodk/pyxform-http
19+
tag: "latest"
20+
pullPolicy: IfNotPresent
1621

1722
frontend:
1823
env:
@@ -26,6 +31,9 @@ service:
2631
frontend:
2732
type: ClusterIP
2833
port: 80
34+
pyxform:
35+
type: ClusterIP
36+
port: 80
2937

3038
ingress:
3139
enabled: true
@@ -58,6 +66,12 @@ backend:
5866
resources:
5967
backend: {}
6068
frontend: {}
69+
pyxform: {}
70+
71+
pyxform:
72+
healthCheck:
73+
enabled: false
74+
path: /
6175

6276
nodeSelector: {}
6377

0 commit comments

Comments
 (0)