The platform security team wants to prevent application Pods from reaching the cloud provider's instance metadata endpoint, which can otherwise be abused to steal node credentials. Create a NetworkPolicy manifest that enforces this restriction with the following requirements:
name—block-metadata-service.The policy should apply to every Pod.
The policy governs only egress traffic.
Allow outbound traffic to all IPv4 destinations (
0.0.0.0/0) except:169.254.169.254/32— the well-known IMDS address.169.254.0.0/16— the broader link-local range.