Skip to content

Commit 186d859

Browse files
authored
Merge pull request #19 from philstel/feature/add-more-ingress-options
Feature: Add more options to the ingress defintion
2 parents c2adbb6 + 428f386 commit 186d859

File tree

7 files changed

+74
-35
lines changed

7 files changed

+74
-35
lines changed

README.md

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ windmill:
4646
lspReplicas: 2
4747
# postgres URI, pods will crashloop if database is unreachable, sets DATABASE_URL environment variable in app and worker container
4848
databaseUrl: postgres://postgres:windmill@windmill-postgresql/windmill?sslmode=disable
49-
# domain as shown in browser, change to https etc based on your endpoint/ingress configuration, sets BASE_URL environment variable in app and worker container
50-
baseUrl: http://localhost
49+
# domain as shown in browser, this is used together with `baseProtocol` as part of the BASE_URL environment variable in app and worker container and in the ingress resource, if enabled
50+
baseDomain: localhost
51+
baseProtocol: http
5152
...
5253

5354
# enable postgres (bitnami) on kubernetes
@@ -87,6 +88,8 @@ enterprise:
8788
| enterprise.s3CacheBucket | string | `"mybucketname"` | S3 bucket to use for dependency cache. Sets S3_CACHE_BUCKET environment variable in worker container |
8889
| ingress.annotations | object | `{}` | |
8990
| ingress.className | string | `""` | |
91+
| ingress.enabled | bool | `true` | enable/disable included ingress resource |
92+
| ingress.tls | list | `[]` | TLS config for the ingress resource. Useful when using cert-manager and nginx-ingress |
9093
| lsp | string | `"latest"` | lsp image tag |
9194
| postgresql.auth.database | string | `"windmill"` | |
9295
| postgresql.auth.postgresPassword | string | `"windmill"` | |
@@ -102,7 +105,8 @@ enterprise:
102105
| windmill.app.resources | object | `{}` | Resource limits and requests for the pods |
103106
| windmill.app.tolerations | list | `[]` | Tolerations to apply to the pods |
104107
| windmill.appReplicas | int | `2` | replica for the application app |
105-
| windmill.baseUrl | string | `"http://localhost"` | domain as shown in browser, change to https etc based on your endpoint/ingress configuration, sets BASE_URL environment variable in app and worker container |
108+
| windmill.baseDomain | string | `"localhost"` | domain as shown in browser, this variable and `baseProtocol` are used as part of the BASE_URL environment variable in app and worker container and in the ingress resource, if enabled |
109+
| windmill.baseProtocol | string | `"http"` | protocol as shown in browser, change to https etc based on your endpoint/ingress configuration, this variable and `baseDomain` are used as part of the BASE_URL environment variable in app and worker container |
106110
| windmill.cookieDomain | string | `""` | domain to use for the cookies. Use it if windmill is hosted on a subdomain and you need to share the cookies with the hub for instance |
107111
| windmill.databaseUrl | string | `"postgres://postgres:windmill@windmill-postgresql/windmill?sslmode=disable"` | Postgres URI, pods will crashloop if database is unreachable, sets DATABASE_URL environment variable in app and worker container |
108112
| windmill.image | string | `"main"` | windmill app image tag |
@@ -169,13 +173,18 @@ The sync relies on rclone and uses its methods of authentication to s3 per
169173

170174
## Kubernetes Hosting Tips
171175

172-
The included helm chart does not have any ingress configured. The default services are nodeports you can point a load balancer to, or alter the chart to suit. For example, on AWS you might use the AWS ALB controller and configure an ingress like this:
176+
The helm chart does have an ingress configuration included. It's enabled by default.
177+
The ingress uses the `windmill.baseDomain` variable for its hostname configuration.
178+
Here are two example configurations for an AWS ALB and nginx-ingress/cert-manager:
173179

180+
AWS ALB:
174181
```yaml
175-
apiVersion: networking.k8s.io/v1
176-
kind: Ingress
177-
metadata:
178-
name: windmill-ingress
182+
windmill:
183+
baseDomain: "windmill.example.com"
184+
...
185+
186+
ingress:
187+
className: "alb"
179188
annotations:
180189
alb.ingress.kubernetes.io/scheme: internet-facing
181190
alb.ingress.kubernetes.io/tags: Environment=dev,Team=test
@@ -184,23 +193,30 @@ metadata:
184193
alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=600
185194
alb.ingress.kubernetes.io/group.name: windmill
186195
alb.ingress.kubernetes.io/group.order: '10'
187-
alb.ingress.kubernetes.io/certificate-arn: certificatearn
188-
spec:
189-
ingressClassName: alb
190-
rules:
191-
- host: {{ .Values.windmill.baseDomain }}
192-
http:
193-
paths:
194-
- path: /
195-
pathType: Prefix
196-
backend:
197-
service:
198-
name: windmill-app
199-
port:
200-
number: 8000
196+
alb.ingress.kubernetes.io/certificate-arn: my-certificatearn
197+
...
201198
```
202199

203-
Again, there are many ways to expose an app and it will depend on the requirements of your environment. Overall, you want the following endpoints accessible included in the chart:
200+
nginx ingress + cert-manager:
201+
```yaml
202+
windmill:
203+
baseDomain: "windmill.example.com"
204+
...
205+
206+
ingress:
207+
className: "nginx"
208+
tls:
209+
- hosts:
210+
- "windmill.example.com"
211+
secretName: windmill-tls-cert
212+
annotations:
213+
cert-manager.io/issuer: "letsencrypt-prod"
214+
nginx.ingress.kubernetes.io/affinity: "cookie"
215+
nginx.ingress.kubernetes.io/affinity-mode: "persistent"
216+
nginx.ingress.kubernetes.io/session-cookie-name: "route"
217+
...
218+
```
219+
There are many ways to expose an app and it will depend on the requirements of your environment. If you don't want to use the included ingress and roll your own, you can just disable it. Overall, you want the following endpoints accessible included in the chart:
204220

205221
windmill app on port 8000
206222
lsp application on port 3001

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.4.2
4+
version: 1.4.3
55
appVersion: 1.89.0
66
dependencies:
77
- condition: postgresql.enabled

charts/windmill/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ Windmill - Turn scripts into endpoints, workflows and UIs in minutes
3232
| enterprise.s3CacheBucket | string | `"mybucketname"` | S3 bucket to use for dependency cache. Sets S3_CACHE_BUCKET environment variable in worker container |
3333
| ingress.annotations | object | `{}` | |
3434
| ingress.className | string | `""` | |
35+
| ingress.enabled | bool | `true` | enable/disable included ingress resource |
36+
| ingress.tls | list | `[]` | TLS config for the ingress resource. Useful when using cert-manager and nginx-ingress |
3537
| lsp | string | `"latest"` | lsp image tag |
3638
| postgresql.auth.database | string | `"windmill"` | |
3739
| postgresql.auth.postgresPassword | string | `"windmill"` | |
@@ -47,7 +49,8 @@ Windmill - Turn scripts into endpoints, workflows and UIs in minutes
4749
| windmill.app.resources | object | `{}` | Resource limits and requests for the pods |
4850
| windmill.app.tolerations | list | `[]` | Tolerations to apply to the pods |
4951
| windmill.appReplicas | int | `2` | replica for the application app |
50-
| windmill.baseUrl | string | `"http://localhost"` | domain as shown in browser, change to https etc based on your endpoint/ingress configuration, sets BASE_URL environment variable in app and worker container |
52+
| windmill.baseDomain | string | `"localhost"` | domain as shown in browser, this variable and `baseProtocol` are used as part of the BASE_URL environment variable in app and worker container and in the ingress resource, if enabled |
53+
| windmill.baseProtocol | string | `"http"` | protocol as shown in browser, change to https etc based on your endpoint/ingress configuration, this variable and `baseDomain` are used as part of the BASE_URL environment variable in app and worker container |
5154
| windmill.cookieDomain | string | `""` | domain to use for the cookies. Use it if windmill is hosted on a subdomain and you need to share the cookies with the hub for instance |
5255
| windmill.databaseUrl | string | `"postgres://postgres:windmill@windmill-postgresql/windmill?sslmode=disable"` | Postgres URI, pods will crashloop if database is unreachable, sets DATABASE_URL environment variable in app and worker container |
5356
| windmill.image | string | `"main"` | windmill app image tag |

charts/windmill/templates/app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ spec:
7070
- name: "DATABASE_URL"
7171
value: "{{ .Values.windmill.databaseUrl }}"
7272
- name: "BASE_URL"
73-
value: "{{ .Values.windmill.baseUrl }}"
73+
value: "{{ .Values.windmill.baseProtocol }}://{{ .Values.windmill.baseDomain }}"
7474
- name: "RUST_LOG"
7575
value: "{{ .Values.windmill.rustLog }}"
7676
- name: "NUM_WORKERS"
Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1+
{{- if .Values.ingress.enabled }}
12
apiVersion: networking.k8s.io/v1
23
kind: Ingress
34
metadata:
45
name: windmill
56
{{- with .Values.ingress.annotations }}
67
annotations:
7-
{{ toYaml . | indent 8 }}
8-
{{- end }}
8+
{{ toYaml . | indent 8 }}
9+
{{- end }}
910
spec:
1011
{{ if .Values.ingress.className }}
1112
ingressClassName: "{{ .Values.ingress.className }}"
1213
{{ end }}
14+
{{- if .Values.ingress.tls }}
15+
tls:
16+
{{- range .Values.ingress.tls }}
17+
- hosts:
18+
{{- range .hosts }}
19+
- {{ . | quote }}
20+
{{- end }}
21+
secretName: {{ .secretName }}
22+
{{- end }}
23+
{{- end }}
1324
rules:
14-
- http:
25+
- host: {{ .Values.windmill.baseDomain | quote }}
26+
http:
1527
paths:
1628
- path: /ws/
1729
pathType: Prefix
@@ -20,12 +32,14 @@ spec:
2032
name: windmill-lsp
2133
port:
2234
number: 3001
23-
- http:
35+
- host: {{ .Values.windmill.baseDomain | quote }}
36+
http:
2437
paths:
2538
- path: /
2639
pathType: Prefix
2740
backend:
2841
service:
2942
name: windmill-app
3043
port:
31-
number: 8000
44+
number: 8000
45+
{{- end }}

charts/windmill/templates/workers.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ spec:
5454
- name: "DATABASE_URL"
5555
value: "{{ .Values.windmill.databaseUrl }}"
5656
- name: "BASE_URL"
57-
value: "{{ .Values.windmill.baseUrl }}"
57+
value: "{{ .Values.windmill.baseProtocol }}://{{ .Values.windmill.baseDomain }}"
5858
- name: "BASE_INTERNAL_URL"
5959
value: "http://windmill-app:8000"
6060
- name: "RUST_LOG"
@@ -212,7 +212,7 @@ spec:
212212
- name: "DATABASE_URL"
213213
value: "{{ $.Values.windmill.databaseUrl }}"
214214
- name: "BASE_URL"
215-
value: "{{ $.Values.windmill.baseUrl }}"
215+
value: "{{ $.Values.windmill.baseProtocol }}://{{ $.Values.windmill.baseDomain }}"
216216
- name: "BASE_INTERNAL_URL"
217217
value: "http://windmill-app:8000"
218218
- name: "RUST_LOG"

charts/windmill/values.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ windmill:
2020
lspReplicas: 2
2121
# -- Postgres URI, pods will crashloop if database is unreachable, sets DATABASE_URL environment variable in app and worker container
2222
databaseUrl: postgres://postgres:windmill@windmill-postgresql/windmill?sslmode=disable
23-
# -- domain as shown in browser, change to https etc based on your endpoint/ingress configuration, sets BASE_URL environment variable in app and worker container
24-
baseUrl: http://localhost
23+
# -- domain as shown in browser, this variable and `baseProtocol` are used as part of the BASE_URL environment variable in app and worker container and in the ingress resource, if enabled
24+
baseDomain: localhost
25+
# -- protocol as shown in browser, change to https etc based on your endpoint/ingress configuration, this variable and `baseDomain` are used as part of the BASE_URL environment variable in app and worker container
26+
baseProtocol: http
2527
# -- domain to use for the cookies. Use it if windmill is hosted on a subdomain and you need to share the cookies with the hub for instance
2628
cookieDomain: ""
2729
# -- rust log level, set to debug for more information etc, sets RUST_LOG environment variable in app and worker container
@@ -149,8 +151,12 @@ windmill:
149151
lsp: "latest"
150152

151153
ingress:
154+
# -- enable/disable included ingress resource
155+
enabled: true
152156
className: ""
153157
annotations: {}
158+
# -- TLS config for the ingress resource. Useful when using cert-manager and nginx-ingress
159+
tls: []
154160

155161
enterprise:
156162
# -- enable Windmill Enterprise , requires license key.

0 commit comments

Comments
 (0)