Replies: 2 comments 3 replies
-
|
We run |
Beta Was this translation helpful? Give feedback.
-
|
btw that's how i finally ran dind with proper isolation using kata (i was using in coder). Didn't figure out how to make in-cluster-DNS work inside of container, but I didn't want to so I disabled it and opted to external DNS resolution. Goes without saying that you need to enable kata system extension. apiVersion: v1
kind: Pod
metadata:
name: kata-dind-check
labels:
app: kata-dind-check
spec:
runtimeClassName: kata
nodeSelector:
kubernetes.io/hostname: node5 # hard pin to node5
securityContext:
seccompProfile: { type: RuntimeDefault }
dnsPolicy: None
dnsConfig:
nameservers: [1.1.1.1, 9.9.9.9]
searches: []
containers:
- name: dev
resources:
requests:
memory: 16Gi
cpu: 4000m
image: mcr.microsoft.com/devcontainers/universal:linux # has dockerd + docker CLI
securityContext:
privileged: true # required for dockerd net plumbing & mount inside guest
allowPrivilegeEscalation: true
env:
- name: DOCKER_HOST
value: unix:///var/run/docker.sock
volumeMounts:
- name: docker-run
mountPath: /var/run
volumeDevices:
- name: docker-data-block
devicePath: /dev/vdb # Kata typically exposes first block PVC here
readinessProbe:
exec: { command: ["sh", "-lc", "docker info >/dev/null 2>&1"] }
initialDelaySeconds: 5
periodSeconds: 3
command: ["sh", "-lc"]
args:
- |
# If the block device is blank, format it; then mount it
blkid /dev/vdb || mkfs.ext4 -F /dev/vdb
mkdir -p /var/lib/docker
mount -t ext4 -o noatime /dev/vdb /var/lib/docker
# Start dockerd with sane flags for k8s
dockerd --host=unix:///var/run/docker.sock --storage-driver=overlay2 &
# Stay alive so you can exec in and play
tail -f /dev/null
volumes:
- name: docker-run
emptyDir: {}
- name: docker-data-block
persistentVolumeClaim:
claimName: docker-data-block
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: docker-data-block
spec:
accessModes: [ ReadWriteOnce ]
storageClassName: piraeus-storage-kata
resources:
requests:
storage: 50Gi
volumeMode: Block |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Creating this issue/discussion here for visibility that maybe someone had overcome this problem or maybe maintainers of Talos have any insights into this issue.
Docker in Docker (dind) can be used to safely run Docker inside containers, which is used by remote development envinroments like Coder.
The most obvious choice for doing that is sysbox which is currently not supported by Talos so I was researching other solutions.
The closest you can get to that currently is by using kata runtimes via extension that was recently aded. It works, but it's not perfect and comes at a price:
Kata maintainers suggest using loop mounted disks which is something that doesn't work in Talos, specifically
mountpart because it's unable to set up loop device:So docker in kata runtime works but it's slow because it's using slow storage driver. And to overcome that you have to create a loop mounted disk which currently doesn't work in Talos.
Relevant issues: #5803 #4385 #3922
Beta Was this translation helpful? Give feedback.
All reactions