Created
June 1, 2025 17:09
-
-
Save aojea/faee67fbbcd6197788e69b5c3c417138 to your computer and use it in GitHub Desktop.
ssh pod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# based on https://taozhi.medium.com/the-amazing-chroot-making-simply-ssh-to-each-nodes-in-kubernetes-a3448a665c95 | |
# kubectl exec -it ssh-pod -- chroot /host /bin/bash | |
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: ssh-pod | |
labels: | |
app: ssh-pod | |
spec: | |
hostNetwork: true | |
hostPID: true | |
hostIPC: true | |
containers: | |
- name: ssh-pod | |
image: busybox:stable | |
securityContext: | |
privileged: true | |
volumeMounts: | |
- mountPath: /host | |
name: host | |
command: [ "/bin/sh", "-c", "--" ] | |
args: [ "while true; do sleep 30; done;" ] | |
volumes: | |
- name: host | |
hostPath: | |
path: / |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment