For more updates and news follow us at:
The default networking mode in Docker is the bridge mode. The bridge mode setting creates a virtual Ethernet bridge device on the Linux host that enables containers to talk to each other, and the host. Docker’s port mappings can then be used to manage external traffic, from the host interface to containers.
However, in some cases you may need to have a container directly attached to an host interface. This can be done by setting the Docker network mode to the “host” option. Here are some reasons why we have seen customers use the host network mode:
In this post I will show you how you can easily use the Host networking mode, for one or more services in an application, with Nirmata.
You can enable Host networking while adding a new service to an application, or by editing an existing service:
Each Service can have one or more endpoints (ports) exposed. When Host networking mode is selected, Nirmata will automatically make the host and container ports the same.
Nirmata’s service affinity rules allow fine-grained control over the placement of groups of services. You can specify rules to place all services, or a subset of services within an application, on a unique host. You can even configure different service affinities, for different environment types (e.g. dev-test, staging, or production).
For example, here is a rule that specifies placement of all services in shopme demo application on a unique host instance:
When you select the Same Host or Unique Host affinity rules, Nirmata will also validate the services for any potential port conflicts – a handy little feature that can save valuable troubleshooting time!
You can now deploy your application, and Nirmata’s orchestration service will select an available host and place all services on the same Host:
Docker has many flexible and powerful configuration options for container networking. Nirmata makes it easy to learn about these options and try them out. You can then apply the right options to one or more environments, using Nirmata’s powerful policy based application orchestration constructs.
At Nirmata our goal is to enable the next generation of software innovation, by making it easy to manage cloud-native applications that are built using application containers. We recently launched a public beta, and are continually releasing new features based on user feedback. If you are using or evaluating Docker, you can save time and effort by having Nirmata manage your applications!
CEO and Founder
Nirmata
For more updates and news follow us at:
Latest
The latest industry news, interviews, technologies, and resources.
View all blogsAs platform engineers, most of us have been there: wrestling with hundreds of Kubernetes clusters, trying to enforce consistent security,…
Three major supply chain attacks. One common thread. In the past few months, GitHub Actions has become one of the…