-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split front-end and back-end containers #173
Conversation
09f67e9
to
6753ebc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I think there is quite a bit that should be able to be removed from the "backend" Dockerfile right?
Hopefully we don't need the SUI stuff and don't need to install all the node deps.
Also we can probably remove the EXPOSE
line from that one.
images/miq-app-frontend/Dockerfile
Outdated
@@ -0,0 +1,69 @@ | |||
FROM bdunne/miq-pods-test:backend-latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we'll need this changed before we merge.
Also, on that note, should we change the directory in this repo to manageiq-app-backend
?
WORKDIR ${APP_ROOT} | ||
RUN source /etc/default/evm && \ | ||
export RAILS_USE_MEMORY_STORE="true" && \ | ||
rake update:bower && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this stuff come out of the other Dockerfile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish, but manageiq-ui-classic
@@ -2,6 +2,7 @@ | |||
|
|||
/usr/sbin/crond & | |||
|
|||
container-initialize.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can do better naming this. Maybe check-dependent-services.sh
?
templates/miq-template-ext-db.yaml
Outdated
annotations: | ||
description: "Defines how to deploy the ManageIQ appliance" | ||
spec: | ||
serviceName: "${NAME}-backend" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think this has a service right?
@@ -107,7 +107,7 @@ objects: | |||
spec: | |||
containers: | |||
- name: manageiq |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we also want to change this dc and container to be named manageiq-frontend
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. I don't want to give it a name that suggests it is limited to only serving the UI / API / WS roles.
requests: | ||
storage: "${APPLICATION_VOLUME_CAPACITY}" | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bonus whitespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been adding a break between some of these things for readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files are impossible
value: "${NAME}" | ||
- | ||
name: "MEMCACHED_SERVER" | ||
value: "${MEMCACHED_SERVICE_NAME}:11211" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this in the backend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, I'm not sure.
templates/miq-template-ext-db.yaml
Outdated
value: "${MEMCACHED_SERVICE_NAME}:11211" | ||
- | ||
name: "MEMCACHED_SERVICE_NAME" | ||
value: "${MEMCACHED_SERVICE_NAME}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, I'm not sure we need this.
templates/miq-template-ext-db.yaml
Outdated
value: "${DATABASE_SERVICE_NAME}" | ||
- | ||
name: "DATABASE_REGION" | ||
value: "${DATABASE_REGION}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this pod is never going to initialize the region I don't think we need to provide this. I think the region id will be detected using the existing database sequence.
# Check readiness of external services | ||
check_svc_status ${MEMCACHED_SERVICE_NAME} 11211 | ||
check_svc_status ${DATABASE_SERVICE_NAME} 5432 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bonus whitespace 😉
By default, set the backend replica count to 0
6753ebc
to
8d8bf40
Compare
Checked commit bdunne@8d8bf40 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
I think all of @carbonin's objections have been covered.
Depends on ManageIQ/manageiq#15470
The frontend ManageIQ pod will receive all web traffic, all frontend replicas must run the UI, API and WS roles (no change here).
Backend replicas will not receive any UI / API / WS requests, so those roles should not be enabled by default. Backend replicas should also wait for the frontend service to become available before attempting to start the application. Backend replicas should be set to 0 by default and users can scale it based on their needs.
This change allows us to scale with a smaller footprint since we usually need more MiqServers for operations and inventory roles than for UI/API roles.