kubectl exec

The kubectl command that runs a command, such as a shell, inside a running container.

In more detail

The API server passes it to the kubelet as the exec subresource of a pod. Opening a shell in a pod is high-value audit evidence and a common Falco alert.

Examples

kubectl exec web -- printenv
In the audit log, exec appears as a create request on the pods/exec subresource.

Related terms

Taught in

References

Certification courses