Skip to content

Commit 4b0979b

Browse files
akurinnoyclaude
andcommitted
feat: use init container and shared volume for ttyd binary injection
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Oleksii Kurinnyi <okurinny@redhat.com>
1 parent 23c576e commit 4b0979b

1 file changed

Lines changed: 28 additions & 3 deletions

File tree

editors-definitions/che-web-terminal-latest.yaml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,47 @@ metadata:
4444
</svg>
4545
4646
commands:
47+
- id: init-ttyd-command
48+
apply:
49+
component: ttyd-injector
4750
- id: start-ttyd-command
4851
exec:
4952
component: ttyd-runtime
50-
commandLine: /usr/bin/ttyd -p 7681 /bin/sh
53+
commandLine: nohup /ttyd-vol/ttyd -W -p 7681 /bin/sh -c 'cd "${PROJECT_SOURCE:-.}" && exec /bin/sh' > /ttyd-vol/ttyd.log 2>&1 &
5154
events:
55+
preStart:
56+
- init-ttyd-command
5257
postStart:
5358
- start-ttyd-command
5459
components:
60+
- name: ttyd-injector
61+
container:
62+
image: docker.io/tsl0922/ttyd:1.7.7-alpine
63+
command:
64+
- sh
65+
- -c
66+
- cp /usr/bin/ttyd /ttyd-vol/ttyd && chmod +x /ttyd-vol/ttyd
67+
volumeMounts:
68+
- name: ttyd-volume
69+
path: /ttyd-vol
70+
memoryLimit: 64Mi
71+
memoryRequest: 16Mi
72+
cpuLimit: 500m
73+
cpuRequest: 30m
5574
- name: ttyd-runtime
5675
attributes:
5776
app.kubernetes.io/component: web-terminal-runtime
5877
app.kubernetes.io/part-of: web-terminal.eclipse.org
5978
controller.devfile.io/container-contribution: true
6079
container:
6180
image: docker.io/tsl0922/ttyd:1.7.7-alpine
62-
memoryLimit: 128Mi
63-
memoryRequest: 32Mi
81+
memoryLimit: 256Mi
82+
memoryRequest: 64Mi
6483
cpuLimit: 500m
6584
cpuRequest: 30m
85+
volumeMounts:
86+
- name: ttyd-volume
87+
path: /ttyd-vol
6688
endpoints:
6789
- name: web-terminal
6890
targetPort: 7681
@@ -73,6 +95,9 @@ components:
7395
cookiesAuthEnabled: true
7496
discoverable: false
7597
urlRewriteSupported: true
98+
secure: true
99+
- name: ttyd-volume
100+
volume: {}
76101

77102
attributes:
78103
version: null

0 commit comments

Comments
 (0)