What is diff between kubectl exec and kubectl attach

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

Kubectl Exec: In addition to being able to attach to existing processes inside a container, the “exec” command allows you to spawn new processes inside existing containers

Kubectl attach: In addition to interactive execution of commands, you can now also attach to any running process. Like kubectl logs, you’ll get stderr and stdout data, but with attach, you’ll also be able to send stdin from your terminal to the program