Skip to content

Instantly share code, notes, and snippets.

@leoluz
Last active September 25, 2020 19:55
Show Gist options
  • Save leoluz/7a074478734aa5965803f63c54b9b17b to your computer and use it in GitHub Desktop.
Save leoluz/7a074478734aa5965803f63c54b9b17b to your computer and use it in GitHub Desktop.
create a pod that starts a shell and stops when exiting
# Run a pod and exec into it to run curl commands. Pod will self delete on exit.
kubectl run curlpod-debug -i --tty --image=appropriate/curl --restart=Never --rm -- sh
# To run in a specific node:
apiVersion: v1
kind: Pod
metadata:
name: curlpod-debug
labels:
app: curl-debug
spec:
nodeSelector:
kubernetes.io/hostname: NODE_NAME
containers:
- name: curl
image: appropriate/curl
imagePullPolicy: IfNotPresent
command:
- sleep
- "3600"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment