mesosphere / marathon-lb

Marathon-lb is a service discovery & load balancing tool for DC/OS
Apache License 2.0
449 stars 300 forks source link

Reverse proxy issue: two apps point to the same domain name #395

Open lihengzkj opened 7 years ago

lihengzkj commented 7 years ago

Issus desc: I created two apps named blue and green in DCOS, and I want the two apps point the same domain name, e.g. testdemo.xxx.sg. I know marathon-lb can do this by haproxy, but after I config them, the two apps are invalid in marathon-lb. Could you help to check what happened made the two apps unavailable, I am not sure I config correct. thanks.I am not sure the configuration is correct. thanks.

===============Blue: { "volumes": null, "id": "/cicd/webdemo-blue", "cmd": null, "args": null, "user": null, "instances": 1, "cpus": 0.2, "mem": 500, "disk": 0, "gpus": 0, "executor": null, "constraints": null, "fetch": null, "storeUrls": null, "backoffSeconds": 1, "backoffFactor": 1.15, "maxLaunchDelaySeconds": 3600, "container": { "docker": { "image": "cicd-webdemo:latest", "forcePullImage": false, "privileged": false, "portMappings": [ { "containerPort": 8080, "protocol": "tcp", "servicePort": 10126 } ], "network": "BRIDGE" } }, "healthChecks": [ { "protocol": "HTTP", "path": "/", "gracePeriodSeconds": 300, "intervalSeconds": 60, "timeoutSeconds": 20, "maxConsecutiveFailures": 3, "ignoreHttp1xx": false } ], "readinessChecks": null, "dependencies": null, "upgradeStrategy": { "minimumHealthCapacity": 1, "maximumOverCapacity": 1 }, "labels": { "HAPROXY_GROUP": "external", "HAPROXY_0_VHOST": "testdemo.xxx.sg" "HAPROXY_DEPLOYMENT_GROUP": "cicd-webdemo", "HAPROXY_DEPLOYMENT_ALT_PORT": "10125" }, "acceptedResourceRoles": null, "residency": null, "secrets": null, "taskKillGracePeriodSeconds": null, "portDefinitions": [ { "port": 10126, "protocol": "tcp", "labels": {} } ], "requirePorts": false }

=============Green { "volumes": null, "id": "/cicd/webdemo-green", "cmd": null, "args": null, "user": null, "instances": 0, "cpus": 0.2, "mem": 500, "disk": 0, "gpus": 0, "executor": null, "constraints": null, "fetch": null, "storeUrls": null, "backoffSeconds": 1, "backoffFactor": 1.15, "maxLaunchDelaySeconds": 3600, "container": { "docker": { "image": "cicd-webdemo:latest", "forcePullImage": false, "privileged": false, "portMappings": [ { "containerPort": 8080, "protocol": "tcp", "servicePort": 10125 } ], "network": "BRIDGE" } }, "healthChecks": [ { "protocol": "HTTP", "path": "/", "gracePeriodSeconds": 300, "intervalSeconds": 60, "timeoutSeconds": 20, "maxConsecutiveFailures": 3, "ignoreHttp1xx": false } ], "readinessChecks": null, "dependencies": null, "upgradeStrategy": { "minimumHealthCapacity": 1, "maximumOverCapacity": 1 }, "labels": { "HAPROXY_DEPLOYMENT_GROUP": "cicd-webdemo", "abc": "4", "HAPROXY_GROUP": "external", "HAPROXY_DEPLOYMENT_COLOUR": "green", "HAPROXY_DEPLOYMENT_TARGET_INSTANCES": "1", "HAPROXY_DEPLOYMENT_ALT_PORT": "10125", "HAPROXY_0_PORT": "10126", "HAPROXY_0_VHOST": "testdemo.xxx.sg" }, "acceptedResourceRoles": null, "residency": null, "secrets": null, "taskKillGracePeriodSeconds": null, "portDefinitions": [ { "port": 10125, "protocol": "tcp", "labels": {} } ], "requirePorts": false }

brndnmtthws commented 7 years ago

Perhaps you want to route by path? https://github.com/mesosphere/marathon-lb/blob/master/Longhelp.md#haproxy_n_path

brndnmtthws commented 7 years ago

Oh, nevermind. You're trying to use ZDD? I'd suggest you deploy the app only through the script.