Mirantis / Mirantis/cri-dockerd
Enabling hostIPC does not have any effect
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 356
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 3
Description
Expected Behavior
I expect that I can use the host's IPC using k3s and cri-dockerd.
This means that I can set hostIPC: true and the IpcMode of the resulting docker container is set as if you'd run a docker container manually with docker run --ipc=host ....
docker inspect ... should return "IpcMode": "host", in both cases.
Actual Behavior
With k3s and cri-dockerd, docker inspect ... returns "IpcMode": "container:e86cde4006dd4ebb82229db13e77b223e248b4969dc3738d58600971874ff372", even though I set hostIPC: true.
Steps to Reproduce the Problem
- Installed K3s:
curl -sfL https://get.k3s.io | sh - - Create a pod definition:
echo "apiVersion: v1
kind: Pod
metadata:
name: test-ipc
spec:
hostIPC: true
containers:
- name: test-ipc
image: ubuntu:focal
command: [\"sh\", \"-c\"]
args: [\"while true; do echo 'foo'; sleep 1; done;\"]" > test-ipc-pod.yaml
- Install pod:
kubectl apply -f test-ipc-pod.yaml - Check IPC mode:
docker inspect $(docker ps -q --filter "name=k8s_test-ipc") | grep IpcMode
Specifications
- Version:
k3s version v1.30.1+k3s1 (80978b5b)
go version go1.22.2
- Platform:
Linux remod-p1 6.8.0-41-generic #41-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 2 20:41:06 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
- Subsystem:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Kubernetes pod's hostIPC setting through cri-dockerd to the Docker container creation request, using the provided k3s and cri-dockerd reproduction steps. Compare the resulting docker inspect IpcMode with a container started using docker run --ipc=host. Done means hostIPC: true produces IpcMode: host, with the behavior covered by a regression test if the repository provides a suitable test entry point.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go, kubernetes, linux
- Domain
- backend, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100