Skip to content

Instantly share code, notes, and snippets.

@mjbright
Last active April 9, 2020 17:55
Show Gist options
  • Save mjbright/0ba4189629262946908866ec17c0513b to your computer and use it in GitHub Desktop.
Save mjbright/0ba4189629262946908866ec17c0513b to your computer and use it in GitHub Desktop.
Basic Pod definition to get a shell inside a Pod
# Creates a Pod which sleeps for 1 hour.
#
# But we can create a shell inside the Pod using the kubectl 'exec' sub-command
# kubectl exec -it alpine -- /bin/sh
apiVersion: v1
kind: Pod
metadata:
labels:
run: alpine
name: alpine
spec:
containers:
- image: alpine:latest
name: alpine
command: ["/bin/sleep", "3600"]
dnsPolicy: ClusterFirst
restartPolicy: Always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment