Last active
April 9, 2020 17:55
-
-
Save mjbright/0ba4189629262946908866ec17c0513b to your computer and use it in GitHub Desktop.
Basic Pod definition to get a shell inside a 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
# 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