Skip to main content
Version: v1.0.0

Proxy

Description

The proxy allows targets (e.g. TCP application) to be connected to multiple network service instances (e.g. stateless-lb) via a single network interface.

To create the full mesh between the proxy and the network service instances, the proxy uses the NSM API to monitor the NSEs, and requests the connection to each of them. For the targets, the proxy acts as a network service with the same network service name + proxy as prefix: proxy.<conduit-name>.<trench-name>.<namespace>.

When started, the proxy requests a subnet from the IPAM Service, so each proxy instance will own a unique subnet and will allocate IPs of targets and Network service instances based on it. Since each proxy has a unique subnet, the network service instances will easily find the correct path to the target via the default routes.

From the network service instances side, the proxy acts as a bridge, so the network service instances can access each individual target via their IPs. From the target side, the proxy acts as a router/gateway, the outgoing traffic of the target. Since it acts as a router/gateway, the proxy is creation source based routes to distribute the outgoing traffic among the network service instances.

Note: Currently the proxy support only 1 conduit.

Proxy

Configuration

https://github.com/Nordix/Meridio/blob/master/cmd/proxy/internal/config/config.go

Environment variableTypeDescriptionDefault
NSM_NAMEstringName of the podproxy
NSM_SERVICE_NAMEstringName of the Network Serviceproxy
NSM_CONNECT_TOurl.URLurl to connect to NSMunix:///var/lib/networkservicemesh/nsm.io.sock
NSM_DIAL_TIMEOUTtime.Durationtimeout to dial NSMgr5s
NSM_REQUEST_TIMEOUTtime.Durationtimeout to request NSE15s
NSM_MAX_TOKEN_LIFETIMEtime.Durationmaximum lifetime of tokens24h
NSM_IPAM_SERVICEstringIP (or domain) and port of the IPAM Serviceipam-service:7777
NSM_HOSTstringHost name the proxy is running on
NSM_NETWORK_SERVICE_NAMEstringName of the network service the proxy request the connectionload-balancer
NSM_NAMESPACEstringNamespace the pod is running ondefault
NSM_TRENCHstringTrench the pod is running ondefault
NSM_CONDUITstringName of the conduitload-balancer
NSM_NSP_SERVICE_NAMEstringIP (or domain) of the NSP Servicensp-service
NSM_NSP_SERVICE_PORTintport of the NSP Service7778
NSM_IP_FAMILYstringip familydualstack
NSM_LOG_LEVELstringLog levelDEBUG

Command Line

CommandActionDefault
--helpDisplay a help describing
--versionDisplay the version

Communication

ComponentSecuredMethod
SpireTBDUnix Socket
NSMyes (mTLS)Unix Socket
NSP Serviceyes (mTLS)TCP
IPAM Serviceyes (mTLS)TCP

Health check

TODO

Privileges

NameDescription
Sysctl: net.ipv6.conf.all.forwarding=1
Sysctl: net.ipv4.conf.all.forwarding=1
Sysctl: net.ipv6.conf.all.accept_dad=0
Sysctl: net.ipv4.fib_multipath_hash_policy=1
Sysctl: net.ipv6.fib_multipath_hash_policy=1
Sysctl: net.ipv4.conf.all.rp_filter=0
Sysctl: net.ipv4.conf.default.rp_filter=0
NET_ADMINThe proxy creates IP rules, IP routes, bridge interfaces and modifies NSM interfaces to link them to bridge interfaces.