From dfdac9c6f0461544593c14ea86989419659aadc8 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Thu, 15 Aug 2024 23:05:38 +0200 Subject: [PATCH] add pod that allows rebooting a host --- generic/alpine-sleep-privileged.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 generic/alpine-sleep-privileged.yaml diff --git a/generic/alpine-sleep-privileged.yaml b/generic/alpine-sleep-privileged.yaml new file mode 100644 index 0000000..072470a --- /dev/null +++ b/generic/alpine-sleep-privileged.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: Pod +metadata: + name: alpine-privileged-serverXX +spec: + containers: + - name: alpine + image: alpine + args: + - sleep + - "1000000" + securityContext: + privileged: true + capabilities: + add: ["NET_ADMIN", "SYS_ADMIN"] + runAsUser: 0 # run as root (or any other user) + hostIPC: true # Use the host's ipc namespace https://www.man7.org/linux/man-pages/man7/ipc_namespaces.7.html + hostNetwork: true # Use the host's network namespace https://www.man7.org/linux/man-pages/man7/network_namespaces.7.html + hostPID: true + nodeSelector: + kubernetes.io/hostname: "serverXX"