By default Kubernetes allow pods to access other pods using the pod IP.
I have 2 pods. Pod1 and Pod2. Pod1 has a mysql server and a PHP application. And Pod2 has a php application. The Pod1 ip is 174.17.0.4, Within the Pod2 the php application can access the mysql server from the address 174.17.0.4:3306
.
The Pod1 and the Pod2 are 2 different applications. Pod2 doesn't have nothing to do with Pod1. So my concern is if Pod2 got hacked, the hacker can scan the network and brute force attack the Pod1 mysql server.
How can I disallow access to the mysql port 3306
from outside the pod1?