Skip to content

Instantly share code, notes, and snippets.

@ianhomer
Last active June 26, 2025 13:14
Show Gist options
  • Save ianhomer/3a2caa89b6febb9968a22e087a59abc8 to your computer and use it in GitHub Desktop.
Save ianhomer/3a2caa89b6febb9968a22e087a59abc8 to your computer and use it in GitHub Desktop.
Bastion in namespace
# Create alpine bastion (that will live for a day)
kubectl -n my-namespace run bastion --image alpine --command sleep -- 1d
# Exec onto bastion -
# -i = interactive mode
# -t = tty terminal mode
kubectl -n my-namespace -it exec bastion -- ash
# Delete bastion
kubectl -n my-namespace delete pod bastion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment