Bug 1146112
Summary: | Scaled application fails when HTTP Basic authentication is used | ||
---|---|---|---|
Product: | OpenShift Online | Reporter: | Luke Meyer <lmeyer> |
Component: | Image | Assignee: | Eric Sauer <esauer> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | libra bugs <libra-bugs> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 2.x | CC: | bparees, esauer, jdetiber, jokerman, libra-bugs, libra-onpremise-devel, lmeyer, mfojtik, mmasters, mmccomas, thunt, wzheng |
Target Milestone: | --- | Keywords: | UpcomingRelease |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | 1145810 | Environment: | |
Last Closed: | 2015-02-18 16:51:15 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1145810 |
Description
Luke Meyer
2014-09-24 13:28:27 UTC
I don't think we want to go w/ the PR referenced, we should make this configurable via an env variable the drives the haproxy.cnf settings, as discussed in the trello card. I like this idea of making this configurable, but if we do it via an environment variable, how can we make that env variable configurable by an admin? Ben, Eric, I pretty much like the idea described in the Trello card, to make both (url, status code) configurable with some reasonable default. I don't think the 401 should be included in the default, but if you as a developer know that your gear is UP when it is returning 401, then you will have ability to configure it. Eric: For admins, they can modify the haproxy cartridge and set the default to what they want to be the default (if with admin, you mean 'node' admin) I've made some changes to the PR. The erb now pulls in environment variables to set values for the two items discussed in the trello card. However, I realized that, while this will work for admins, who can set global vars in /etc/openshift/env/, this will not work for users. If someone does a... rhc env set HTTP_CHK_URL="/httpchk.php" .. post app creation, this will have no affect because the erb has already been evaluated and the haproxy.cnf is now more or less static. yeah you'll need to add something to start/restart that updates it appropriately. in most cases we regenerate from the erb on every start, but in this case we can't do that since we modify the file contents dynamically as we add/remove gears, so you'll have to do something slightly smarter. Ok, I think I've come up with something. https://github.com/openshift/origin-server/pull/5835 One other concern in changing how the health check works - can we ensure this is communicated in the routing SPI? Otherwise the routing layer won't have this information correct for HA apps (though the routing layer can always be customized out of band by administrators). Commit pushed to master at https://github.com/openshift/origin-server https://github.com/openshift/origin-server/commit/64bb36e571be31f0c3d4c3553df0cfa2649b056b Bug 1146112 - Added 401 to default expected status codes on health check. This will allow for Basic Auth applications to work in scaled mode. Also provided ability for admins and users to change this and the health check URI values using environment variables. Bug 1146112 - Can now set http-check status codes and GET uri via ENV vars Bug 1146112 - replacing a line that was removed by accident Bug 1146112 - Control script will check for user defined haproxy.cnf variables and set them Bug 1146112 - No need for ternary operator here Bug 1146112 - Per bparees: This came up on the bug scrum and there was agreement that we should accept 401 by default, can you update this to include 401 as part of the default status code list? Bug 1146112 - Changed to double quotes for default values Bug 1146112 - Fixing more syntax issues Just a note: as implemented, the routing layer will never receive this information and will presumably use the cartridge-specified health check unless otherwise customized. I'm not actually sure how the routing layer even could receive this information. I guess the main use case is setting env vars via the REST API which the broker could theoretically publish, except that AFAIK we don't have an "update_endpoint" event for the routing SPI yet. Verified on devenv_5219. After create app with "rhc create-app basicauthtest jbosseap-6 --from-url=https://github.com/etsauer/openshift-quickstart-basic-auth.git -s", access it without any auth info input, 401 code will return; it returns "1" if access /health page. |