Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prow cluster: create loop devices in advance #16212

Merged
merged 1 commit into from
Feb 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions prow/cluster/loop_dev_daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# A daemonset to create /dev/loopX device nodes before they are
# needed.
#
# Normally, new nodes are created dynamically by the kernel. But nodes
# in a KinD cluster are started with a copy of /dev from the host and
# loop devices created later on do not show up in that static /dev
# (https://github.com/kubernetes-sigs/kind/issues/1248). Creating
# "enough" (100 in this daemonset) in advance avoids running out of
# loop devices.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: create-loop-devs
namespace: kube-system
labels:
app: create-loop-devs
spec:
selector:
matchLabels:
name: create-loop-devs
template:
metadata:
labels:
name: create-loop-devs
spec:
tolerations:
- operator: Exists
effect: NoSchedule
containers:
- name: loopdev
command:
- sh
- -c
- |
while true; do
for i in $(seq 0 100); do
if ! [ -e /dev/loop$i ]; then
mknod /dev/loop$i c 7 $i
fi
done
sleep 100000000
done
image: alpine:3.6
imagePullPolicy: IfNotPresent
resources: {}
securityContext:
privileged: true
volumeMounts:
- name: dev
mountPath: /dev
volumes:
- name: dev
hostPath:
path: /dev