k create deployment awscli --image=amazon/aws-cli --replicas=1 -- sleep infinity
kubectl run <pod-name> --image=<your_image> --namespace=<your-ns> --overrides='{"spec":{"serviceAccount":"your-service-account"}}' --command -- <your-command>
kubectl run --image=<your_image> --namespace= --overrides='{"spec":{"serviceAccount":"default","tolerations":[{"key":"dedicated", "operator":"Equal", "value":"taint-value"}], "nodeSelector":{"label-name":"label-value"}}}' --command -- sleep infinity
kubectl create job --from=cronjob/<cronhob> <job>
k get -n {namespace} $(k get-all -n {namespace} | grep -v 'NAME' | awk '{print $1}' | tr '/' ' ' | awk '{print $1}' | tr '\n' ',' | sed 's/.\{1\}$//')
k api-resources --verbs=list --namespaced -o name | xargs -n 1 kubectl get -n <namespace>
k get-all -n <namespace> # Using Krew get-all plugin
k port-forward service/redis 6379:6379 -n redis
k scale --replicas=5 deployments/<deployment>
If you cannot use pod selector use the custom output and the grep to filter
k get pod -o custom-columns="NAME:.metadata.name,image:.spec.containers[0].image,namespace:metadata.namespace,deployment:metadata.labels.app" -A | grep workspace | awk '{print $4,$3}' | xargs -L 1 bash -c 'kubectl scale deployment $0 --replicas 0 -n $1'
k get pod -o custom-columns=NAME:.metadata.name,NodeSelector:.spec.nodeSelector