So you are following a long tutorial…
And you are getting bloody tired of copying and pasting all the YAMLs… urgh.
What if I told you that I can make your work 50% less painful? Would you pay me a coffee? β
Please refer to the YAML below
apiVersion: v1
kind: Pod
metadata:
name: definitely-not-prod
labels:
owner: "friday-5pm-dev"
spec:
containers:
- name: chaos-container
image: busybox
command: ["sh", "-c", "echo 'Deploying... just kidding!' && sleep 3600"]
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "echo 'Context set correctly?'"]
preStop:
exec:
command: ["/bin/sh", "-c", "echo 'Goodbye, cruel cluster!'"]
restartPolicy: Never
nodeSelector:
coffee-supply: "critical"
You can simply copy the YAML above and use pbpaste to pipe your clipboard through the kubectl apply with the command below:
pbpaste | k apply -f-
TadΓ‘! Works like a charm

Now be careful with what you copy π«‘