Skip to content

Commit c633b3f

Browse files
Simon Emmsroboquat
Simon Emms
authored andcommitted
[kots]: automatically enable shiftfs support if cluster supports it
1 parent 9b1f309 commit c633b3f

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

install/kots/manifests/gitpod-installer-job.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ spec:
7777
echo "Gitpod: Generate the base Installer config"
7878
/app/installer init > "${CONFIG_FILE}"
7979
80+
echo "Gitpod: auto-detecting ShiftFS support on host machine"
81+
kubectl wait job -n {{repl Namespace }} --for=condition=complete -l component=shiftfs-module-loader --timeout=30s || true
82+
ENABLE_SHIFTFS=$(kubectl get jobs.batch -n {{repl Namespace }} -l component=shiftfs-module-loader -o jsonpath='{.items[0].status.succeeded}')
83+
84+
if [ "${ENABLE_SHIFTFS}" = "1" ]; then
85+
echo "Gitpod: enabling ShiftFS support"
86+
87+
yq e -i '.workspace.runtime.fsShiftMethod = "shiftfs"' "${CONFIG_FILE}"
88+
fi
89+
8090
echo "Gitpod: auto-detecting containerd location on host machine"
8191
if [ -d "/mnt/node0${CONTAINERD_DIR_K3S}" ]; then
8292
echo "Gitpod: containerd dir detected as k3s"
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2+
# Licensed under the MIT License. See License-MIT.txt in the project root for license information.
3+
4+
# This job is allowed to fail as will default to fuse
5+
apiVersion: batch/v1
6+
kind: Job
7+
metadata:
8+
name: shiftfs-module-loader-{{repl Cursor }}
9+
labels:
10+
app: gitpod
11+
component: shiftfs-module-loader
12+
spec:
13+
ttlSecondsAfterFinished: 60
14+
activeDeadlineSeconds: 30
15+
backoffLimit: 1
16+
parallelism: 1
17+
template:
18+
metadata:
19+
labels:
20+
app: gitpod
21+
component: shiftfs-module-loader
22+
spec:
23+
serviceAccountName: installer
24+
restartPolicy: Never
25+
containers:
26+
- name: shiftfs-module-loader
27+
# This is the current valid tag. This will be auto-updated by the Werft job
28+
image: eu.gcr.io/gitpod-core-dev/build/shiftfs-module-loader:commit-ab235e8bc00f2c1ac70232cea17e5df9a9d262fa
29+
securityContext:
30+
privileged: true
31+
volumeMounts:
32+
- mountPath: /usr/src_node
33+
name: node-linux-src
34+
readOnly: true
35+
volumes:
36+
- name: node-linux-src
37+
hostPath:
38+
path: /usr/src
39+
type: Directory

0 commit comments

Comments
 (0)