-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Achieve Docker-Compose Network functionality using NetworkPolicy in Kubernates #1188
Comments
The reason we chose 'label' over 'namespace' is the following: |
Agreed. |
@mudverma Thanks! |
@mudverma I know this issue has been closed and implemented. In the case that the network is an external network, I don't think network polices are exactly the right k8s abstraction for this |
Currently Kompose does not support Network Key Translation. However, Network functionality is widely used is Docker World.
Consider the following interactions:
Services A1, A2 are part of net_a while Services B1, B2 are part of Net_B, there is also a gateway that is part of Both the networks (net_a and net_b). This provides an isolated environment to a subset of services. It would be interesting to achieve equivalent functionality in Kubernates via translated artefacts.
Since Kubernates follows a flat networking structure, where every pod can talk to each other by default, achieving direct Network key translation is not straight forward.
There is a proposal to treat Docker-Compose network as Namespaces in Kubernates, however, we feel that an alternate approach is required for the following reasons. #1066
We propose that using "Labels" and "NetworkPolicy" in Kubernates we can achieve same functionality as multi Networks in Docker world.
We can extract network information from docker-compose and persist them as Labels in generated/translated kubernates artefacts. Along-with, we can also generate a networkPolicy that limits the communications amongst pods with same Network Labels.
Input:
docker-compose.yaml
Output:
appfoo-deployment.yaml
web-network-networkpolicy.yaml:
app-network-networkpolicy.yaml:
The text was updated successfully, but these errors were encountered: