$ kubectl apply -f - <<EOF <-- insert YAML content here --> EOF OR $ cat file.yaml | kubectl apply -f -
Maybe outdated, but here's the documentation : https://kubernetes.io/docs/reference/kubectl/cheatsheet/#creating-objects