easykubectl

Apply a NetworkPolicy manifest from a file to restrict pod-to-pod traffic

command

kubectl apply -f network-policy.yaml

also accepted

kubectl apply -f

Command breakdown

Part of the Kubernetes CLI (kubectl) — kubectl Advanced category.

kubectlapply-fnetwork-policy.yaml
FlagPurpose
-fBoolean flag

Test your recall — not just your reading.

Practice with interactive quiz →