Skip to content

Commit a254569

Browse files
Allow application websocket connection (#46)
1 parent b21e73b commit a254569

3 files changed

Lines changed: 30 additions & 66 deletions

File tree

app/pipeline/convert/templates/static/3-app.yaml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ metadata:
1010
app.kubernetes.io/component: app
1111
app.kubernetes.io/managed-by: cloudness
1212
spec:
13+
progressDeadlineSeconds: 600
1314
selector:
1415
matchLabels:
1516
app.kubernetes.io/name: {{ .Identifier }}
@@ -25,9 +26,6 @@ spec:
2526
app.kubernetes.io/managed-by: cloudness
2627
spec:
2728
securityContext:
28-
runAsNonRoot: true
29-
runAsUser: 1001
30-
fsGroup: 1001
3129
seccompProfile:
3230
type: RuntimeDefault
3331
serviceAccountName: {{ .Identifier }}-sa
@@ -41,14 +39,6 @@ spec:
4139
containers:
4240
- name: app
4341
image: {{ .Image }}
44-
securityContext:
45-
allowPrivilegeEscalation: false
46-
readOnlyRootFilesystem: false
47-
runAsNonRoot: true
48-
runAsUser: 1001
49-
capabilities:
50-
drop:
51-
- ALL
5242
{{- if .Command }}
5343
command:
5444
{{- range .Command }}
@@ -145,6 +135,7 @@ metadata:
145135
app.kubernetes.io/component: app
146136
app.kubernetes.io/managed-by: cloudness
147137
spec:
138+
podManagementPolicy: Parallel
148139
selector:
149140
matchLabels:
150141
app.kubernetes.io/name: {{ .Identifier }}
@@ -160,9 +151,6 @@ spec:
160151
app.kubernetes.io/managed-by: cloudness
161152
spec:
162153
securityContext:
163-
runAsNonRoot: true
164-
runAsUser: 1001
165-
fsGroup: 1001
166154
seccompProfile:
167155
type: RuntimeDefault
168156
serviceAccountName: {{ .Identifier }}-sa
@@ -176,14 +164,6 @@ spec:
176164
containers:
177165
- name: app
178166
image: {{ .Image }}
179-
securityContext:
180-
allowPrivilegeEscalation: false
181-
readOnlyRootFilesystem: false
182-
runAsNonRoot: true
183-
runAsUser: 1001
184-
capabilities:
185-
drop:
186-
- ALL
187167
{{- if .Command }}
188168
command:
189169
{{- range .Command }}
@@ -267,6 +247,7 @@ spec:
267247
{{- range $index, $value := .ServicePorts }}
268248
- name: {{ $value }}-port
269249
protocol: TCP
250+
appProtocol: {{ if and $.ServiceDomain $.ServiceDomain.Websecure }}kubernetes.io/wss{{ else }}kubernetes.io/ws{{ end }}
270251
port: {{ $value }}
271252
targetPort: {{ $value }}
272253
{{- end }}

app/pipeline/convert/templates/static/4-httproute.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ spec:
3434
type: PathPrefix
3535
value: /
3636

37+
filters:
38+
- type: ResponseHeaderModifier
39+
responseHeaderModifier:
40+
set:
41+
- name: Upgrade
42+
value: websocket
43+
- name: Connection
44+
value: Upgrade
45+
3746
timeouts:
3847
request: 300s
3948
backendRequest: 300s

templates/7-n8n.json

Lines changed: 18 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -27,46 +27,20 @@
2727
"path": "/"
2828
}
2929
},
30-
"volumes": [
31-
{
32-
"name": "n8n-data",
33-
"mountPath": "/home/n8n"
34-
}
35-
],
3630
"variables": [
3731
{
38-
"key": "N8N_USER_FOLDER",
39-
"value": "/home/n8n",
40-
"type": "run"
41-
},
42-
{
43-
"key": "N8N_HOST",
44-
"value": "${{CLOUDNESS_PUBLIC_DOMAIN}}",
45-
"type": "run"
46-
},
47-
{
48-
"key": "N8N_PROTOCOL",
49-
"value": "https",
50-
"type": "run"
51-
},
52-
{
53-
"key": "WEBHOOK_URL",
54-
"value": "${{CLOUDNESS_PUBLIC_DOMAIN}}",
55-
"type": "run"
56-
},
57-
{
58-
"key": "N8N_PORT",
59-
"value": "5678",
32+
"key": "DB_POSTGRESDB_DATABASE",
33+
"value": "${{n8n-db.POSTGRES_DB}}",
6034
"type": "run"
6135
},
6236
{
63-
"key": "DB_TYPE",
64-
"value": "postgresdb",
37+
"key": "DB_POSTGRESDB_HOST",
38+
"value": "${{n8n-db.CLOUDNESS_PRIVATE_DOMAIN}}",
6539
"type": "run"
6640
},
6741
{
68-
"key": "DB_POSTGRESDB_HOST",
69-
"value": "${{n8n-db.CLOUDNESS_PRIVATE_DOMAIN}}",
42+
"key": "DB_POSTGRESDB_PASSWORD",
43+
"value": "${{n8n-db.POSTGRES_PASSWORD}}",
7044
"type": "run"
7145
},
7246
{
@@ -75,33 +49,33 @@
7549
"type": "run"
7650
},
7751
{
78-
"key": "DB_POSTGRESDB_DATABASE",
79-
"value": "${{n8n-db.POSTGRES_DB}}",
52+
"key": "DB_POSTGRESDB_USER",
53+
"value": "${{n8n-db.POSTGRES_USER}}",
8054
"type": "run"
8155
},
8256
{
83-
"key": "DB_POSTGRESDB_USER",
84-
"value": "${{n8n-db.POSTGRES_USER}}",
57+
"key": "DB_TYPE",
58+
"value": "postgresdb",
8559
"type": "run"
8660
},
8761
{
88-
"key": "DB_POSTGRESDB_PASSWORD",
89-
"value": "${{n8n-db.POSTGRES_PASSWORD}}",
62+
"key": "N8N_ENCRYPTION_KEY",
63+
"value": "${{secret(32)}}",
9064
"type": "run"
9165
},
9266
{
93-
"key": "EXECUTIONS_DATA_PRUNE",
94-
"value": "true",
67+
"key": "N8N_PORT",
68+
"value": "5678",
9569
"type": "run"
9670
},
9771
{
98-
"key": "EXECUTIONS_DATA_MAX_AGE",
99-
"value": "168",
72+
"key": "PORT",
73+
"value": "5678",
10074
"type": "run"
10175
},
10276
{
103-
"key": "N8N_METRICS",
104-
"value": "false",
77+
"key": "WEBHOOK_URL",
78+
"value": "${{CLOUDNESS_PUBLIC_DOMAIN}}",
10579
"type": "run"
10680
}
10781
]

0 commit comments

Comments
 (0)