By default, the Manifold application relies on sockets to communicate between services (e.g. between the client (frontend) and API (backend)).
This restricts how we can deploy to our infra. Most importantly, all services that communicate across sockets must be in the same pod. This prevents us from being able to scale vertically or horizontally.
The application code should be altered to allow for services to communicate with each other using requests rather than sockets.
Implementation Suggestions
Loose steps:
Add k8 Services for cable and client
Split deployment into API, client, nginx
Change the labels in the services to match the new deployments (unique names)
Change nginx configuration to use ports instead of unix sockets1
4a) See nginx/config/default.conf
1 See code below
upstream manifold_api {
server unix:/manifold_sockets/manifold-api;
# Replace sockets with this pattern (syntax may be incorrect):
# server princeton-manifold-api:3020
}
Story
By default, the Manifold application relies on sockets to communicate between services (e.g. between the client (frontend) and API (backend)).
This restricts how we can deploy to our infra. Most importantly, all services that communicate across sockets must be in the same pod. This prevents us from being able to scale vertically or horizontally.
The application code should be altered to allow for services to communicate with each other using requests rather than sockets.
Implementation Suggestions
Loose steps:
nginx/config/default.conf
1 See code below