Here is a section of my network policy:
egress:
-to:
- ipBlock:
cidr: 10.0.0.0/32
- ipBlock:
cidr: 10.0.0.1/32
ports:
- protocol: TCP
port: 5978
I have a doubt whether these IPs will be allowed to connect to the same port.
Basically, if we want to have a different port for a different IP, what can we do?
I assume the snippet you shared is a portion of a NetworkPolicy.
If so, you can have multiple entries in the egress field, like this for example:
egress:
- to:
- ipBlock:
cidr: 10.0.0.1/32
ports:
- protocol: TCP
port: 5978
- to:
- ipBlock:
cidr: 10.0.0.2/32
ports:
- protocol: TCP
port: 1234
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With