When using the host network mode for a container, that container’s network stack is not isolated from the Docker host, so the container shares the host’s networking namespace and does not get its own IP-address allocation.
This recipe has no required configuration options. It can be activated by adding a dependency on org.openrewrite.recipe:rewrite-kubernetes:2.3.0 in your build file or by running a shell command (in which case no build changes are needed):
---type:specs.openrewrite.org/v1beta/recipename:org.openrewrite.kubernetes.NoHostNetworkSharingdisplayName:No host network sharingdescription: When using the host network mode for a container, that container’s network stack is not isolated from the Docker host, so the container shares the host’s networking namespace and does not get its own IP-address allocation.
tags: - kubernetesrecipeList: - org.openrewrite.kubernetes.AddConfiguration:resourceKind:PodconfigurationPath:$.specvalue:hostNetwork:false
See how this recipe works across multiple open-source repositories
The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.
Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.