Skip to content

Commit b0dc7c4

Browse files
authoredFeb 26, 2025··
Add the ability to run separate ASGI and WSGI deployments for ODK Publish. (#9)
1 parent 83cafb8 commit b0dc7c4

15 files changed

+470
-119
lines changed
 

‎charts/odk-publish/Chart.lock

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dependencies:
2+
- name: odk-publish
3+
repository: file://charts/odk-publish
4+
version: 0.1.2
5+
- name: odk-publish
6+
repository: file://charts/odk-publish
7+
version: 0.1.2
8+
digest: sha256:790445c6c82c67f6837534096e2d9a7ae1662d22c9d3e752f6ba5b7dac618577
9+
generated: "2025-02-21T04:16:18.831708002+03:00"

‎charts/odk-publish/Chart.yaml

+12-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,20 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.1
18+
version: 0.1.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "sha-edd8da1"
24+
appVersion: "sha-dd627cc"
25+
26+
dependencies:
27+
- name: odk-publish
28+
repository: file://charts/odk-publish
29+
version: 0.1.2
30+
- name: odk-publish
31+
repository: file://charts/odk-publish
32+
version: 0.1.2
33+
alias: asgi
34+
condition: asgi.enabled
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: odk-publish
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.2
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "sha-dd627cc"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "odk-publish.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "odk-publish.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "odk-publish.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "odk-publish.labels" -}}
37+
helm.sh/chart: {{ include "odk-publish.chart" . }}
38+
{{ include "odk-publish.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "odk-publish.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "odk-publish.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "odk-publish.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "odk-publish.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}

‎charts/odk-publish/templates/deployment.yaml ‎charts/odk-publish/charts/odk-publish/templates/deployment.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ spec:
4747
protocol: TCP
4848
livenessProbe:
4949
httpGet:
50-
path: /
50+
path: {{ .Values.healthChecksPath | default "/" }}
5151
port: {{ .Values.service.port }}
5252
httpHeaders:
5353
- name: Host
5454
value: "{{ .Values.publishDomain }}"
5555
readinessProbe:
5656
httpGet:
57-
path: /
57+
path: {{ .Values.healthChecksPath | default "/" }}
5858
port: {{ .Values.service.port }}
5959
httpHeaders:
6060
- name: Host
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Default values for odk-publish.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
5+
publishDomain: www.example.com
6+
7+
environmentVariables:
8+
DATABASE_URL: "postgresql://postgres@172.17.0.1:9062/odk_publish"
9+
10+
replicaCount: 1
11+
12+
image:
13+
repository: ghcr.io/caktus/odk-publish
14+
pullPolicy: IfNotPresent
15+
# Overrides the image tag whose default is the chart appVersion.
16+
tag: latest
17+
18+
imagePullSecrets: []
19+
nameOverride: ""
20+
fullnameOverride: ""
21+
22+
config: {}
23+
24+
serviceAccount:
25+
# Specifies whether a service account should be created
26+
create: true
27+
# Automatically mount a ServiceAccount's API credentials?
28+
automount: true
29+
# Annotations to add to the service account
30+
annotations: {}
31+
# The name of the service account to use.
32+
# If not set and create is true, a name is generated using the fullname template
33+
name: ""
34+
35+
podAnnotations: {}
36+
podLabels: {}
37+
38+
podSecurityContext: {}
39+
# fsGroup: 2000
40+
41+
securityContext: {}
42+
# capabilities:
43+
# drop:
44+
# - ALL
45+
# readOnlyRootFilesystem: true
46+
# runAsNonRoot: true
47+
# runAsUser: 1000
48+
49+
service:
50+
type: ClusterIP
51+
port: 8000
52+
53+
ingress:
54+
enabled: true
55+
className: nginx
56+
annotations: {}
57+
# kubernetes.io/ingress.class: nginx
58+
# kubernetes.io/tls-acme: "true"
59+
hosts:
60+
- host: chart-example.local
61+
paths:
62+
- path: /
63+
pathType: ImplementationSpecific
64+
tls: []
65+
# - secretName: chart-example-tls
66+
# hosts:
67+
# - chart-example.local
68+
69+
ingressApp:
70+
enabled: false
71+
className: nginx
72+
annotations: {}
73+
# kubernetes.io/ingress.class: nginx
74+
# kubernetes.io/tls-acme: "true"
75+
hosts:
76+
- host: chart-example.local
77+
paths:
78+
- path: /
79+
pathType: ImplementationSpecific
80+
tls: []
81+
# - secretName: chart-example-tls
82+
# hosts:
83+
# - chart-example.local
84+
85+
resources: {}
86+
# We usually recommend not to specify default resources and to leave this as a conscious
87+
# choice for the user. This also increases chances charts run on environments with little
88+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
89+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
90+
# limits:
91+
# cpu: 100m
92+
# memory: 128Mi
93+
# requests:
94+
# cpu: 100m
95+
# memory: 128Mi
96+
97+
autoscaling:
98+
enabled: false
99+
minReplicas: 1
100+
maxReplicas: 100
101+
targetCPUUtilizationPercentage: 80
102+
# targetMemoryUtilizationPercentage: 80
103+
104+
# Additional volumes on the output Deployment definition.
105+
volumes: []
106+
# - name: foo
107+
# secret:
108+
# secretName: mysecret
109+
# optional: false
110+
111+
# Additional volumeMounts on the output Deployment definition.
112+
volumeMounts: []
113+
# - name: foo
114+
# mountPath: "/etc/foo"
115+
# readOnly: true
116+
117+
nodeSelector: {}
118+
119+
tolerations: []
120+
121+
affinity: {}

‎charts/odk-publish/values.yaml

+240-115
Original file line numberDiff line numberDiff line change
@@ -2,120 +2,245 @@
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44

5-
publishDomain: www.example.com
6-
7-
environmentVariables:
8-
DATABASE_URL: "postgresql://postgres@172.17.0.1:9062/odk_publish"
9-
10-
replicaCount: 1
11-
12-
image:
13-
repository: ghcr.io/caktus/odk-publish
14-
pullPolicy: IfNotPresent
15-
# Overrides the image tag whose default is the chart appVersion.
16-
tag: latest # FIXME: Update to a specific version once released
17-
18-
imagePullSecrets: []
19-
nameOverride: ""
20-
fullnameOverride: ""
21-
22-
config: {}
23-
24-
serviceAccount:
25-
# Specifies whether a service account should be created
26-
create: true
27-
# Automatically mount a ServiceAccount's API credentials?
28-
automount: true
29-
# Annotations to add to the service account
30-
annotations: {}
31-
# The name of the service account to use.
32-
# If not set and create is true, a name is generated using the fullname template
33-
name: ""
34-
35-
podAnnotations: {}
36-
podLabels: {}
37-
38-
podSecurityContext: {}
39-
# fsGroup: 2000
40-
41-
securityContext: {}
42-
# capabilities:
43-
# drop:
44-
# - ALL
45-
# readOnlyRootFilesystem: true
46-
# runAsNonRoot: true
47-
# runAsUser: 1000
48-
49-
service:
50-
type: ClusterIP
51-
port: 8000
52-
53-
ingress:
54-
enabled: true
55-
className: nginx
56-
annotations: {}
57-
# kubernetes.io/ingress.class: nginx
58-
# kubernetes.io/tls-acme: "true"
59-
hosts:
60-
- host: chart-example.local
61-
paths:
62-
- path: /
63-
pathType: ImplementationSpecific
64-
tls: []
65-
# - secretName: chart-example-tls
66-
# hosts:
67-
# - chart-example.local
68-
69-
ingressApp:
70-
enabled: true
71-
className: nginx
72-
annotations: {}
73-
# kubernetes.io/ingress.class: nginx
74-
# kubernetes.io/tls-acme: "true"
75-
hosts:
76-
- host: chart-example.local
77-
paths:
78-
- path: /
79-
pathType: ImplementationSpecific
80-
tls: []
81-
# - secretName: chart-example-tls
82-
# hosts:
83-
# - chart-example.local
84-
85-
resources: {}
86-
# We usually recommend not to specify default resources and to leave this as a conscious
87-
# choice for the user. This also increases chances charts run on environments with little
88-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
89-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
90-
# limits:
91-
# cpu: 100m
92-
# memory: 128Mi
93-
# requests:
94-
# cpu: 100m
95-
# memory: 128Mi
96-
97-
autoscaling:
5+
odk-publish:
6+
publishDomain: www.example.com
7+
8+
environmentVariables:
9+
DATABASE_URL: "postgresql://postgres@172.17.0.1:9062/odk_publish"
10+
11+
replicaCount: 1
12+
13+
image:
14+
repository: ghcr.io/caktus/odk-publish
15+
pullPolicy: IfNotPresent
16+
# Overrides the image tag whose default is the chart appVersion.
17+
tag: latest # FIXME: Update to a specific version once released
18+
19+
imagePullSecrets: []
20+
nameOverride: ""
21+
fullnameOverride: ""
22+
23+
config: {}
24+
25+
serviceAccount:
26+
# Specifies whether a service account should be created
27+
create: true
28+
# Automatically mount a ServiceAccount's API credentials?
29+
automount: true
30+
# Annotations to add to the service account
31+
annotations: {}
32+
# The name of the service account to use.
33+
# If not set and create is true, a name is generated using the fullname template
34+
name: ""
35+
36+
podAnnotations: {}
37+
podLabels: {}
38+
39+
podSecurityContext: {}
40+
# fsGroup: 2000
41+
42+
securityContext: {}
43+
# capabilities:
44+
# drop:
45+
# - ALL
46+
# readOnlyRootFilesystem: true
47+
# runAsNonRoot: true
48+
# runAsUser: 1000
49+
50+
service:
51+
type: ClusterIP
52+
port: 8000
53+
54+
ingress:
55+
enabled: true
56+
className: nginx
57+
annotations: {}
58+
# kubernetes.io/ingress.class: nginx
59+
# kubernetes.io/tls-acme: "true"
60+
hosts:
61+
- host: chart-example.local
62+
paths:
63+
- path: /
64+
pathType: ImplementationSpecific
65+
tls: []
66+
# - secretName: chart-example-tls
67+
# hosts:
68+
# - chart-example.local
69+
70+
ingressApp:
71+
enabled: false
72+
className: nginx
73+
annotations: {}
74+
# kubernetes.io/ingress.class: nginx
75+
# kubernetes.io/tls-acme: "true"
76+
hosts:
77+
- host: chart-example.local
78+
paths:
79+
- path: /
80+
pathType: ImplementationSpecific
81+
tls: []
82+
# - secretName: chart-example-tls
83+
# hosts:
84+
# - chart-example.local
85+
86+
resources: {}
87+
# We usually recommend not to specify default resources and to leave this as a conscious
88+
# choice for the user. This also increases chances charts run on environments with little
89+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
90+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
91+
# limits:
92+
# cpu: 100m
93+
# memory: 128Mi
94+
# requests:
95+
# cpu: 100m
96+
# memory: 128Mi
97+
98+
autoscaling:
99+
enabled: false
100+
minReplicas: 1
101+
maxReplicas: 100
102+
targetCPUUtilizationPercentage: 80
103+
# targetMemoryUtilizationPercentage: 80
104+
105+
# Additional volumes on the output Deployment definition.
106+
volumes: []
107+
# - name: foo
108+
# secret:
109+
# secretName: mysecret
110+
# optional: false
111+
112+
# Additional volumeMounts on the output Deployment definition.
113+
volumeMounts: []
114+
# - name: foo
115+
# mountPath: "/etc/foo"
116+
# readOnly: true
117+
118+
nodeSelector: {}
119+
120+
tolerations: []
121+
122+
affinity: {}
123+
124+
# Enable for separate ASGI and WSGI deployments. When disabled there will be only one deployment using Daphne
125+
asgi:
98126
enabled: false
99-
minReplicas: 1
100-
maxReplicas: 100
101-
targetCPUUtilizationPercentage: 80
102-
# targetMemoryUtilizationPercentage: 80
103127

104-
# Additional volumes on the output Deployment definition.
105-
volumes: []
106-
# - name: foo
107-
# secret:
108-
# secretName: mysecret
109-
# optional: false
110-
111-
# Additional volumeMounts on the output Deployment definition.
112-
volumeMounts: []
113-
# - name: foo
114-
# mountPath: "/etc/foo"
115-
# readOnly: true
116-
117-
nodeSelector: {}
118-
119-
tolerations: []
120-
121-
affinity: {}
128+
publishDomain: www.example.com
129+
130+
environmentVariables:
131+
DATABASE_URL: "postgresql://postgres@172.17.0.1:9062/odk_publish"
132+
133+
replicaCount: 1
134+
135+
image:
136+
repository: ghcr.io/caktus/odk-publish
137+
pullPolicy: IfNotPresent
138+
# Overrides the image tag whose default is the chart appVersion.
139+
tag: latest
140+
141+
imagePullSecrets: []
142+
nameOverride: ""
143+
fullnameOverride: ""
144+
145+
config: {}
146+
147+
serviceAccount:
148+
# Specifies whether a service account should be created
149+
create: true
150+
# Automatically mount a ServiceAccount's API credentials?
151+
automount: true
152+
# Annotations to add to the service account
153+
annotations: {}
154+
# The name of the service account to use.
155+
# If not set and create is true, a name is generated using the fullname template
156+
name: ""
157+
158+
podAnnotations: {}
159+
podLabels: {}
160+
161+
podSecurityContext: {}
162+
# fsGroup: 2000
163+
164+
securityContext: {}
165+
# capabilities:
166+
# drop:
167+
# - ALL
168+
# readOnlyRootFilesystem: true
169+
# runAsNonRoot: true
170+
# runAsUser: 1000
171+
172+
service:
173+
type: ClusterIP
174+
port: 8000
175+
176+
ingress:
177+
enabled: true
178+
className: nginx
179+
annotations: {}
180+
# kubernetes.io/ingress.class: nginx
181+
# kubernetes.io/tls-acme: "true"
182+
hosts:
183+
- host: chart-example.local
184+
paths:
185+
- path: /ws
186+
pathType: Prefix
187+
tls: []
188+
# - secretName: chart-example-tls
189+
# hosts:
190+
# - chart-example.local
191+
192+
ingressApp:
193+
enabled: false
194+
className: nginx
195+
annotations: {}
196+
# kubernetes.io/ingress.class: nginx
197+
# kubernetes.io/tls-acme: "true"
198+
hosts:
199+
- host: chart-example.local
200+
paths:
201+
- path: /
202+
pathType: ImplementationSpecific
203+
tls: []
204+
# - secretName: chart-example-tls
205+
# hosts:
206+
# - chart-example.local
207+
208+
resources: {}
209+
# We usually recommend not to specify default resources and to leave this as a conscious
210+
# choice for the user. This also increases chances charts run on environments with little
211+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
212+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
213+
# limits:
214+
# cpu: 100m
215+
# memory: 128Mi
216+
# requests:
217+
# cpu: 100m
218+
# memory: 128Mi
219+
220+
autoscaling:
221+
enabled: false
222+
minReplicas: 1
223+
maxReplicas: 100
224+
targetCPUUtilizationPercentage: 80
225+
# targetMemoryUtilizationPercentage: 80
226+
227+
# Additional volumes on the output Deployment definition.
228+
volumes: []
229+
# - name: foo
230+
# secret:
231+
# secretName: mysecret
232+
# optional: false
233+
234+
# Additional volumeMounts on the output Deployment definition.
235+
volumeMounts: []
236+
# - name: foo
237+
# mountPath: "/etc/foo"
238+
# readOnly: true
239+
240+
nodeSelector: {}
241+
242+
tolerations: []
243+
244+
affinity: {}
245+
246+
healthChecksPath: /ws/health/

0 commit comments

Comments
 (0)
Please sign in to comment.