AppSwitch performs service discovery, access control and traffic management functions on behalf of the applications by transparently taking over the applications’ network API calls. In addition, AppSwitch decouples the application from the constructs of underlying network infrastructure by projecting a consistent, virtual view of the network to the application. In abstract terms, AppSwitch can be thought of as the docker equivalent for the networking stack. It combines the application-level functionality offered by the service mesh approach with the familiarity and compatibility of traditional networking.
Some of the use cases include:
- Automatically curated service registry for seamless service discovery even across hybrid environments.
- Extremely efficient enforcement of label-based access controls without any data path processing.
- Proxy-less load-balancing and traffic management across service instances.
- IP address portability with ability to assign arbitrary IP addresses to applications regardless of underlying network.
- Transparently redirect connection requests to alternate services without using NAT in case of application migration.
- "flat" connectivity with client IP preservation across hybrid network environments.
Installation of the binary (copying to /usr/bin) and bringing up of the daemon can be done with the following compose file:
# # Bring up with: # docker-compose up -d appswitch # version: '2.3' volumes: appswitch_logs: services: appswitch: image: appswitch/ax pid: "host" network_mode: "host" privileged: true volumes: - /usr/bin:/hostbin - /var/run/appswitch:/var/run/appswitch - appswitch_logs:/var/log environment: - AX_DRIVER=user # Syscall forwarding driver - AX_NODE_INTERFACE= # Node interface to use by daemon. Accepts IP address or interface name, eg eth0 - AX_NEIGHBORS= # List (csv) of IP addresses of cluster neighbors - AX_CLUSTER= # Cluster name. Required if cluster is part of a federation - AX_FEDERATION_GATEWAY_IP= # IP address or `interface` name for federation connectivity - AX_FEDERATION_GATEWAY_NEIGHBORS= # List (`csv`) of IP addresses of federation neighbors (other gateway nodes) - AX_OPTS=--clean # Remove any saved state from previous sessions
ax run --ip 184.108.40.206 --expose 8000:10.0.2.23:9000 python -m SimpleHTTPServer 8000 1>/dev/null &
$ ax run -- curl -I 220.127.116.11:8000 HTTP/1.0 200 OK Server: SimpleHTTP/0.6 Python/2.7.5 Date: Tue, 12 Jun 2018 18:51:23 GMT Content-type: text/html; charset=UTF-8 Content-Length: 660 $ curl -I 10.0.2.23:9000 HTTP/1.0 200 OK Server: SimpleHTTP/0.6 Python/2.7.5 Date: Tue, 12 Jun 2018 18:51:56 GMT Content-type: text/html; charset=UTF-8 Content-Length: 660
- AppSwitch Documentation
- For core principles behind AppSwitch and its internals, look at this research paper.
- This blog post by Jerome Petazzoni has a nice description about what AppSwitch does and how it works.