0

Requirement: If I do ifconfig, then I want to see the physical interface cards, which I need to access to be used inside a container.

Why? - coz i need to create a socket from container to interface NOTE: This interface has to be accessed at OSI Layer 2 and not with IP.

What I Tried (Privileged hostnetwork mode. Don't follow this, it may not be right) It's very insecure and risky way to achieve it.

root@canmaster:~# cat priv.yaml

apiVersion: v1
kind: Pod
metadata:
name: privileged
spec:
hostNetwork: true
hostname: canmasterpriv
containers:
- name: pause
image: docker.io/nginx:stable-perl
securityContext:
privileged: true
Mikołaj Głodziak
  • 4,775
  • 7
  • 28
  • That sounds like you're trying to escape the container. If you need access to the host network devices, your process should generally run outside a container. Why does this need to be in Kubernetes specifically? – David Maze Jun 08 '21 at 00:52
  • Can you provide more details on what you want to achieve ? Maybe there is another easier/better solution. – matt_j Jun 08 '21 at 11:08

0 Answers0