mbp-1126: Network segmentation using UDN - #147
mlorenzofr wants to merge 2 commits into
Conversation
|
There seems to be a conflict role of the UDN. In
|
Signed-off-by: Manuel Lorenzo <mlorenzofr@redhat.com>
ba01162 to
f8a7fe3
Compare
f8a7fe3 to
1c411e8
Compare
sabre1041
left a comment
There was a problem hiding this comment.
This looks really good @mlorenzofr. Tested and confirmed successfully. Only potential enhancement would be to provide the ability to enable/disable the enable-multi-network-policy job in the event that this configuration is already managed by another component
Signed-off-by: Manuel Lorenzo <mlorenzofr@redhat.com>
thanks for the suggestion! I'm adding the functionality |
1c411e8 to
70d6aad
Compare
Implements network segmentation using User Defined Networks (UDNs) for the qtodo multi-tier application. The qtodo frontend (
qtodonamespace) and PostgreSQL database (qtodo-dbnamespace) join a shared Layer2 secondaryClusterUserDefinedNetwork(CUDN) so database traffic is isolated from the default cluster network.Because secondary UDNs do not support Kubernetes Services, the database pod uses a static UDN IP and qtodo's JDBC URL targets that address when UDN is enabled.
Summary
ClusterUserDefinedNetworkin theqtodo-dbchart spanning theqtodoandqtodo-dbnamespacesNetworkAttachmentDefinition; pods opt in via thek8s.v1.cni.cncf.io/networksannotationMultiNetworkPolicyon the UDN to allow PostgreSQL (5432/tcp) only fromapp=qtodotoapp=qtodo-dbNetworkPolicywhen UDN is enabled:10.100.0.10) when UDN is enableddocs/user-defined-networks.mdand related docsudnfeature flag to enable bothqtodo-db(udn.enabled) andqtodo(app.udn.enabled)Prerequisites
spec.useMultiNetworkPolicy: trueonnetwork.operator.openshift.io/cluster(required for UDNMultiNetworkPolicy. Can be disabled via chart values if needed)Test plan
useMultiNetworkPolicyon the Cluster Network Operatorpython3 scripts/gen-feature-variants.py --features udnqtodoandqtodo-dbClusterUserDefinedNetworkand NADs exist in both namespacesnet1) and qtodo-db has IP10.100.0.10NetworkPolicyrules (qtodo-db: DNS egress only; no PostgreSQL on eth0)MultiNetworkPolicyrules on the UDN (PostgreSQL allowed qtodo -> qtodo-db only)qtodo-db.qtodo-db.svcfails when UDN is enableddocs/user-defined-networks.md, sync-wave inventory, multi-tier guide)