Skip to content

Commit cb4edf3

Browse files
committed
rework ingress and showcase worker-group
1 parent a568f4d commit cb4edf3

File tree

9 files changed

+392
-117
lines changed

9 files changed

+392
-117
lines changed

README.md

Lines changed: 34 additions & 9 deletions
Large diffs are not rendered by default.

charts/windmill/Chart.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: postgresql
3+
repository: https://charts.bitnami.com/bitnami
4+
version: 12.3.1
5+
digest: sha256:9b58040ae97d52661fa3bc6d2fb1bbcbf22749ad1b9563c03dcb3bc74208e64f
6+
generated: "2023-04-25T19:22:32.107347129+02:00"

charts/windmill/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: windmill
33
type: application
4-
version: 1.3.8
4+
version: 1.4.0
55
appVersion: 1.89.0
66
dependencies:
77
- condition: postgresql.enabled

charts/windmill/README.md

Lines changed: 70 additions & 59 deletions
Large diffs are not rendered by default.

charts/windmill/templates/app.yaml

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,34 @@ spec:
7777
value: "0"
7878
- name: "JSON_FMT"
7979
value: "true"
80+
{{ if .Values.windmill.instanceEventsWebhook }}
81+
- name: "INSTANCE_EVENTS_WEBHOOK"
82+
value: "true"
83+
{{ end }}
8084
{{ if .Values.enterprise.enabled }}
8185
- name: "LICENSE_KEY"
8286
value: "{{ .Values.enterprise.licenseKey }}"
8387
{{ end }}
88+
- name: "CUSTOM_TAGS"
89+
value: "{{- range $v := .Values.windmill.workerGroups }}{{ $v.name }},{{ end}}"
90+
resources:
91+
{{ toYaml .Values.windmill.frontend.resources | indent 12 }}
8492
volumes:
8593
- name: oauth-volume
8694
secret:
8795
secretName: {{ if .Values.windmill.oauthSecretName }}{{ .Values.windmill.oauthSecretName }}{{ else }} {{ .Release.Name }}-oauth-secret {{- end }}
88-
96+
{{- with .Values.windmill.frontend.nodeSelector }}
97+
nodeSelector:
98+
{{ toYaml . | indent 8 }}
99+
{{- end }}
100+
{{- with .Values.windmill.frontend.affinity }}
101+
affinity:
102+
{{ toYaml . | indent 8 }}
103+
{{- end }}
104+
{{- with .Values.windmill.frontend.tolerations }}
105+
tolerations:
106+
{{ toYaml . | indent 8 }}
107+
{{- end }}
89108
securityContext:
90109
runAsUser: 0
91110
---
@@ -100,7 +119,7 @@ spec:
100119
targetPort: 8000
101120
selector:
102121
app.kubernetes.io/name: windmill-app
103-
sessionAffinity: None
122+
sessionAffinity: ClientIP
104123
type: ClusterIP
105124
---
106125
apiVersion: v1
@@ -119,6 +138,37 @@ spec:
119138
app.kubernetes.io/name: windmill-app
120139
sessionAffinity: None
121140
type: ClusterIP
141+
---
142+
apiVersion: networking.k8s.io/v1
143+
kind: Ingress
144+
metadata:
145+
name: windmill-lsp-ingress
146+
annotations:
147+
# alb.ingress.kubernetes.io/scheme: internet-facing
148+
# alb.ingress.kubernetes.io/tags: Environment=dev,Team=test
149+
# alb.ingress.kubernetes.io/target-type: ip
150+
# alb.ingress.kubernetes.io/group.name: windmill
151+
# alb.ingress.kubernetes.io/target-group-attributes: stickiness.enabled=true,stickiness.type=app_cookie,stickiness.app_cookie.cookie_name=token,stickiness.app_cookie.duration_seconds=86400
152+
# alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=600
153+
# {{ if .Values.windmill.sslIngress }}
154+
# alb.ingress.kubernetes.io/certificate-arn: {{ .Values.certArn}}
155+
# {{ end }}
156+
# alb.ingress.kubernetes.io/success-codes: '200'
157+
# alb.ingress.kubernetes.io/group.order: '1'
158+
spec:
159+
ingressClassName: alb
160+
rules:
161+
- host: {{ .Values.windmill.baseDomain }}
162+
http:
163+
paths:
164+
- path: /ws/
165+
pathType: Prefix
166+
backend:
167+
service:
168+
name: windmill-lsp
169+
port:
170+
number: 3001
171+
122172
# ---
123173
# apiVersion: monitoring.coreos.com/v1
124174
# kind: ServiceMonitor
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
apiVersion: networking.k8s.io/v1
3+
kind: Ingress
4+
metadata:
5+
name: windmill
6+
{{- with .Values.ingress.lspAnnotations }}
7+
annotations:
8+
{{ toYaml . | indent 8 }}
9+
{{- end }}
10+
spec:
11+
{{ if .Values.ingress.className }}
12+
ingressClassName: "{{ .Values.ingress.className }}"
13+
{{ end }}
14+
rules:
15+
- http:
16+
paths:
17+
- path: /ws/
18+
pathType: Prefix
19+
backend:
20+
service:
21+
name: windmill-lsp
22+
port:
23+
number: 3001
24+
- http:
25+
paths:
26+
- path: /
27+
pathType: Prefix
28+
backend:
29+
service:
30+
name: windmill-app
31+
port:
32+
number: 8000

charts/windmill/templates/lsp.yaml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ spec:
2424
app: windmill-lsp
2525
app.kubernetes.io/name: windmill-lsp
2626
container: windmill-lsp
27+
{{- with .Values.windmill.lsp.annotations }}
28+
annotations:
29+
{{ toYaml . | indent 8 }}
30+
{{- end }}
2731
spec:
2832
containers:
2933
- name: windmill-lsp
@@ -47,24 +51,6 @@ spec:
4751
{{- end }}
4852
securityContext:
4953
runAsUser: 0
50-
# ---
51-
# apiVersion: v1
52-
# kind: Service
53-
# metadata:
54-
# name: lsp
55-
# spec:
56-
# clusterIP: None
57-
# ports:
58-
# - port: 3001
59-
# protocol: TCP
60-
# targetPort: 3001
61-
# selector:
62-
# app: windmill
63-
# container: lsp
64-
# sessionAffinity: None
65-
# type: ClusterIP
66-
# status:
67-
# loadBalancer: {}
6854
---
6955
apiVersion: v1
7056
kind: Service

charts/windmill/templates/workers.yaml

Lines changed: 151 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ spec:
3535
#because nsjail requires privileged access
3636
securityContext:
3737
privileged: true
38+
{{ else }}
39+
securityContext:
40+
runAsUser: 0
3841
{{end}}
3942
{{ if .Values.enterprise.enabled }}
4043
image: ghcr.io/windmill-labs/windmill-ee:{{ .Values.windmill.image }}
@@ -62,6 +65,22 @@ spec:
6265
value: "true"
6366
- name: "JSON_FMT"
6467
value: "true"
68+
{{ if .Values.windmill.pipIndexUrl }}
69+
- name: "PIP_INDEX_URL"
70+
value: "{{ .Values.windmill.pipIndexUrl }}"
71+
{{ end }}
72+
{{ if .Values.windmill.pipExtraIndexUrl }}
73+
- name: "PIP_EXTRA_INDEX_URL"
74+
value: "{{ .Values.windmill.pipExtraIndexUrl }}"
75+
{{ end }}
76+
{{ if .Values.windmill.pipTrustedHost }}
77+
- name: "PIP_TRUSTED_HOST"
78+
value: "{{ .Values.windmill.pipTrustedHost }}"
79+
{{ end }}
80+
{{ if .Values.windmill.npmConfigRegistry }}
81+
- name: "NPM_CONFIG_REGISTRY"
82+
value: "{{ .Values.windmill.npmConfigRegistry }}"
83+
{{ end }}
6584
{{ if .Values.enterprise.enabled }}
6685
- name: "S3_CACHE_BUCKET"
6786
value: "{{ .Values.enterprise.s3CacheBucket }}"
@@ -74,8 +93,20 @@ spec:
7493
value: "false"
7594
{{ end }}
7695
{{ end }}
77-
securityContext:
78-
runAsUser: 0
96+
resources:
97+
{{ toYaml .Values.windmill.workers.resources | indent 12 }}
98+
{{- with .Values.windmill.workers.nodeSelector }}
99+
nodeSelector:
100+
{{ toYaml . | indent 8 }}
101+
{{- end }}
102+
{{- with .Values.windmill.workers.affinity }}
103+
affinity:
104+
{{ toYaml . | indent 8 }}
105+
{{- end }}
106+
{{- with .Values.windmill.workers.tolerations }}
107+
tolerations:
108+
{{ toYaml . | indent 8 }}
109+
{{- end }}
79110
---
80111
apiVersion: v1
81112
kind: Service
@@ -119,28 +150,121 @@ spec:
119150
# - port: metrics
120151
# interval: 30s
121152
# path: /metrics
122-
# ---
123-
# apiVersion: v1
124-
# kind: Service
125-
# metadata:
126-
# name: windmill
127-
# spec:
128-
# externalTrafficPolicy: Cluster
129-
# ports:
130-
# - port: 80
131-
# name: http
132-
# protocol: TCP
133-
# targetPort: 8000
134-
# nodePort: 30080
135-
# # - port: 443
136-
# # name: https
137-
# # protocol: TCP
138-
# # targetPort: 443
139-
# # nodePort: 30081
140-
# selector:
141-
# app: windmill
142-
# container: caddy
143-
# sessionAffinity: None
144-
# type: NodePort
145-
# status:
146-
# loadBalancer: {}
153+
154+
{{- range $v := .Values.windmill.workerGroups }}
155+
---
156+
apiVersion: apps/v1
157+
kind: Deployment
158+
metadata:
159+
name: windmill-workers-{{ $v.name }}
160+
labels:
161+
app: windmill-workers
162+
app.kubernetes.io/name: windmill-workers
163+
chart: {{ template "windmill.chart" $ }}
164+
release: {{ $.Release.Name }}
165+
heritage: {{ $.Release.Service }}
166+
workerGroup: {{ $v.name }}
167+
spec:
168+
replicas: {{ $v.replicas }}
169+
strategy:
170+
type: RollingUpdate
171+
rollingUpdate:
172+
maxSurge: 3
173+
maxUnavailable: 0
174+
selector:
175+
matchLabels:
176+
app: windmill-workers
177+
workerGroup: {{ $v.name }}
178+
template:
179+
metadata:
180+
labels:
181+
app: windmill-workers
182+
app.kubernetes.io/name: windmill-workers
183+
release: {{ $.Release.Name }}
184+
workerGroup: {{ $v.name }}
185+
{{- with $v.annotations }}
186+
annotations:
187+
{{ toYaml . | indent 8 }}
188+
{{- end }}
189+
spec:
190+
containers:
191+
- name: windmill-worker
192+
{{ if $.Values.enterprise.nsjail }}
193+
#because nsjail requires privileged access
194+
securityContext:
195+
privileged: true
196+
{{ else }}
197+
securityContext:
198+
runAsUser: 0
199+
{{end}}
200+
{{ if $.Values.enterprise.enabled }}
201+
image: ghcr.io/windmill-labs/windmill-ee:{{ $.Values.windmill.image }}
202+
{{ else }}
203+
image: ghcr.io/windmill-labs/windmill:{{ $.Values.windmill.image }}
204+
{{ end }}
205+
imagePullPolicy: Always
206+
ports:
207+
- containerPort: 8000
208+
- containerPort: 8001
209+
env:
210+
- name : "METRICS_ADDR"
211+
value: "true"
212+
- name: "DATABASE_URL"
213+
value: "{{ $.Values.windmill.databaseUrl }}"
214+
- name: "BASE_URL"
215+
value: "{{ $.Values.windmill.baseUrl }}"
216+
- name: "BASE_INTERNAL_URL"
217+
value: "http://windmill-app:8000"
218+
- name: "RUST_LOG"
219+
value: "{{ $.Values.windmill.rustLog }}"
220+
- name: "NUM_WORKERS"
221+
value: "{{ $.Values.windmill.numWorkers }}"
222+
- name: "DISABLE_SERVER"
223+
value: "true"
224+
- name: "JSON_FMT"
225+
value: "true"
226+
{{ if $.Values.windmill.pipIndexUrl }}
227+
- name: "PIP_INDEX_URL"
228+
value: "{{ $.Values.windmill.pipIndexUrl }}"
229+
{{ end }}
230+
{{ if $.Values.windmill.pipExtraIndexUrl }}
231+
- name: "PIP_EXTRA_INDEX_URL"
232+
value: "{{ $.Values.windmill.pipExtraIndexUrl }}"
233+
{{ end }}
234+
{{ if $.Values.windmill.pipTrustedHost }}
235+
- name: "PIP_TRUSTED_HOST"
236+
value: "{{ $.Values.windmill.pipTrustedHost }}"
237+
{{ end }}
238+
{{ if $.Values.windmill.npmConfigRegistry }}
239+
- name: "NPM_CONFIG_REGISTRY"
240+
value: "{{ $.Values.windmill.npmConfigRegistry }}"
241+
{{ end }}
242+
{{ if $.Values.enterprise.enabled }}
243+
- name: "S3_CACHE_BUCKET"
244+
value: "{{ .Values.enterprise.s3CacheBucket }}"
245+
- name: "LICENSE_KEY"
246+
value: "{{ .Values.enterprise.licenseKey }}"
247+
- name: "RCLONE_S3_PROVIDER"
248+
value: "AWS"
249+
{{ if $.Values.enterprise.nsjail }}
250+
- name: "DISABLE_NSJAIL"
251+
value: "false"
252+
{{ end }}
253+
{{ end }}
254+
- name: "WORKER_TAGS"
255+
value: "{{ $v.name }}"
256+
resources:
257+
{{ toYaml $v.resources | indent 12 }}
258+
{{- with $v.nodeSelector }}
259+
nodeSelector:
260+
{{ toYaml . | indent 8 }}
261+
{{- end }}
262+
{{- with $v.affinity }}
263+
affinity:
264+
{{ toYaml . | indent 8 }}
265+
{{- end }}
266+
{{- with $v.tolerations }}
267+
tolerations:
268+
{{ toYaml . | indent 8 }}
269+
{{- end }}
270+
{{- end }}

0 commit comments

Comments
 (0)