From 8980c62ebb459d50cbab25879829049c2a8f7605 Mon Sep 17 00:00:00 2001 From: chexxor Date: Sat, 4 Feb 2017 14:27:46 -0600 Subject: [PATCH] docs(src/applications/inter-app-communication.md) Add first draft Add first draft of inter-app communication. Apply changes requested by review. --- mkdocs.yml | 1 + src/applications/inter-app-communication.md | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 src/applications/inter-app-communication.md diff --git a/mkdocs.yml b/mkdocs.yml index e9870e9a..0fc5bf0f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -49,6 +49,7 @@ pages: - Managing App Processes: applications/managing-app-processes.md - Managing App Configuration: applications/managing-app-configuration.md - Managing App Lifecycle: applications/managing-app-lifecycle.md + - Inter-app Communication: applications/inter-app-communication.md - Resource Limits: applications/managing-resource-limits.md - Domains and Routing: applications/domains-and-routing.md - SSL Certificates: applications/ssl-certificates.md diff --git a/src/applications/inter-app-communication.md b/src/applications/inter-app-communication.md new file mode 100644 index 00000000..b5af7ed5 --- /dev/null +++ b/src/applications/inter-app-communication.md @@ -0,0 +1,7 @@ +## Inter-app Communication + +A common architecture pattern of multi-process applications is to have one process serve public requests while having multiple other processes supporting the public one to, for example, perform actions on a schedule or process work items from a queue. To implement this system of apps in Deis Workflow, set up the apps to communicate using DNS resolution, as shown above, and hide the supporting processes from public view by removing them from the Deis Workflow router. See [Deis Blog: Private Applications on Workflow](https://deis.com/blog/2016/private-applications-on-deis-workflow/) for more details, which walks through an example of removing an app from the router. + +### DNS Service Discovery + +Deis Workflow supports deploying a single app composed of a system of processes. Each Deis Workflow app communicates on a single port, so communicating with another Workflow app means finding that app's address and port. All Workflow apps are mapped to port 80 externally, so finding its IP address is the only challenge. Workflow creates a [Kubernetes Service](https://kubernetes.io/docs/user-guide/services/) for each app, which effectively assigns a name and one cluster-internal IP address to an app. The DNS service running in the cluster adds and removes DNS records which point from the app name to its IP address as services are added and removed. Deis Workflow apps, then, can simply send requests to the domain name given to the service, which is "app-name.app-namespace".