Open waterjiao opened 3 years ago
Hello. We did encounter such bugs some time ago but it was supposed to be fixed :-)
The reason for the check is the "ip netns" just creates a regular file for the new namespace then quick creates a bind mount from the namespace file in /proc to the regular file.
I'll try to reproduce the problem - pretty tricky to debug indeed - and I'll keep you updated
Did you use the Kubernetes template in contrib/kubernetes
? It specifies to use hostPID: true
Sorry for taking so long to answer.
Yes, I used the Kubernetes template in contrib/kubernetes
.
hostPID: true
hostNetwork: true
I did try to config more pod security policy. This is my config:
hostPID: true
hostNetwork: true
hostIPC: true
securityContext:
privileged: true
runAsUser: 0
allowPrivilegeEscalation: true
It didn't work.
I also try on centos(host) with docker container, get the same issue.
env:
host: centos7
container: centos7
When I run docker container:
docker run -it --privileged -v /var/run/netns:/host/run docker.io/centos /bin/bash
When I add network namespace on host(Centos7)
# ip netns add net1
I use stat command to check this:
in host:
# stat --format=%d /var/run/netns
22
# stat --format=%d /var/run/netns/net1
3
but in container:
# stat --format=%d /host/run
22
# stat --format=%d /host/run/net1
22
Note net1's device number is different in host and container.
@waterjiao Hello. Sorry for the long delay.
On my CentOS 7 VM, I have the same results in the container that in the host. What storage driver are you using ? Is it overlayfs ?
Hello
I used the master version, and I'm running skydive on k8s v0.19.0.
Env:
My config is---skydive.yaml---skydive agent ConfigMap
When I add network namespace on host(Centos7)
Here's the skydive agent log:
Note the
/host/run/net1 does not seem to be a valid namespace
errors which means /host/run/net1 's device number is same with /host/run 's device number.Code is:
I use
stat
command to check this:in host:
but in agent pod(container):
Note net1's device number is different in host and pod.
It's tricky to debug. Has anyone encountered such a problem before?
Thanks