Bobcares

Docker Swarm and Ingress Network

by | Jul 15, 2022

When a user initializes a docker swarm an overlay network is generated called an ingress network which handles swarm service control and data traffic.

Bobcares answers all questions no matter the size, with our Docker hosting support

Let us take a look at the docker swarm ingress network in detail.

Overlay networks and Ingress

When the user initializes a swarm or joins a Docker host to an existing swarm. It will generate two new networks that Docker hosts. Ingress is an overlay network that handles the control and data traffic related to swarm services.

When a user creates a swarm service without connecting it to a user-defined overlay network. It connects by default to the ingress network. When a user starts a swarm, the manager creates an overlay network called ingress. The ingress network includes every node that joins the swarm. The ingress network’s sole purpose is to transport traffic from external clients. It publishes the service ports to the services within the swarm.

When a node on the ingress network receives an external request, it resolves the service name to a virtual IP address. This processing will be using the same internal DNS server. The request is then load balanced to a service replica via the ingress network by the IP virtual server.

Here, every node is part of the ingress network, every node can resolve and handle external requests. For all of this to work, the nodes must have a couple of ports open: o TCP and UDP protocol port 7946 for container network discovery. o UDP port 4789 for enabling the container ingress network.

Customize the default ingress network for the docker swarm ingress network

Most users will never need to configure the ingress network, but Docker makes it possible. This is useful if the automatically selected subnet conflicted with one already in use on your network, or if you need to change other low-level network settings such as the MTU.

Customizing the network ingress entails removing and recreating it. This is usually before creating any swarm services. If you already have services that publish ports, you must remove them before you can remove the ingress network. Existing services that do not publish ports continue to function but are not in load-balancing while there is no ingress network. This has an impact on services that publish ports, such as a WordPress service that publishes port 80.

Using the docker network, inspect the ingress network. Examine ingress and remove any services in connection. These are ports that are published by services, such as a WordPress service that publishes port 80. If all such services are not terminated, the following step fails.

Get rid of the existing ingress network:

docker network rm ingress

Using the —ingress flag and the custom options to set, create a new overlay network. In this example, the MTU is set to 1200, the subnet is set to 10.11.0.0/16, and the gateway is set to 10.11.0.2.

docker network create \
--driver overlay \
--ingress \
--subnet=10.11.0.0/16 \
--gateway=10.11.0.2 \
--opt com.docker.network.driver.mtu=1200 \
my-ingress

It is important to note, that the user can name their ingress to network anything other than ingress, but they can only have one. An attempt to make a duplicate fails. After the configuration, the user has to restart the services stopped earlier in the first step.

[Need assistance with similar queries? We are here to help]

Conclusion

To conclude, the docker swarm initialization generates an ingress network. A user can easily manage and customize the Ingress network.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF