Add examples for host network

This commit is contained in:
Nico Schottelius 2023-02-11 20:16:17 +01:00
parent 644a356212
commit 60b7952549
3 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,17 @@
apiVersion: v1
kind: Pod
metadata:
name: alpine-sleep-hostnetwork-netperm
spec:
hostNetwork: true
containers:
- name: alpine
image: alpine:3.15
args:
- sleep
- "1000000"
securityContext:
capabilities:
# NET_ADMIN for wg
# NET_RAW for iptables
add: ["NET_ADMIN", "NET_RAW" ]

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Pod
metadata:
name: alpine-sleep-hostnetwork
spec:
hostNetwork: true
containers:
- name: alpine
image: alpine:3.15
args:
- sleep
- "1000000"

View File

@ -0,0 +1,24 @@
apiVersion: v1
kind: Pod
metadata:
name: alpine-sleep-netperm
spec:
securityContext:
sysctls:
- name: net.ipv6.conf.all.forwarding
value: "1"
containers:
- name: alpine
image: alpine:3.15
args:
- sleep
- "1000000"
securityContext:
capabilities:
# NET_ADMIN for wg
# NET_RAW for iptables
add: ["NET_ADMIN", "NET_RAW" ]
# [12:31] nb3:generic% kubectl get pods -n testnico -w
# NAME READY STATUS RESTARTS AGE
# alpine-sleep-netperm 0/1 SysctlForbidden 0 49s