tendrilinc / marathon-autoscaler

A simple autoscaler for Marathon applications
https://hub.docker.com/r/tendril/marathon-autoscaler/
Apache License 2.0
41 stars 16 forks source link

SSL support? #30

Closed fr33l closed 7 years ago

fr33l commented 7 years ago

Hey guys,

Thanks for the great project. I'm trying to launch it in our environment, but our mesos_uri and marathon_uri are both https, so when I launch container with args I receive this:

2017-01-25 17:30:48,142 | INFO | Namespace(agent_port=5051, cpu_fan_out=None, datadog_api_key=None, datadog_app_key=None, datadog_env=None, enforce_version_match=False, log_config='/app/logging_config.json', marathon_pass=None, marathon_uri='http://marathon-dns/', marathon_user=None, mesos_uri='http://mesos_dns/', rules_prefix='mas_rule', sleep_interval=5)
2017-01-25 17:30:48,143 | INFO | Mesos and Marathon Connections Established.
2017-01-25 17:30:48,260 | ERROR | EOF occurred in violation of protocol (_ssl.c:590)
2017-01-25 17:30:48,260 | ERROR | 'NoneType' object has no attribute 'url'
2017-01-25 17:30:48,261 | CRITICAL | Marathon data could not be retrieved!
2017-01-25 17:30:48,261 | CRITICAL | Poller unable to reach Marathon/Mesos!

The same occurs if I change http to https in args, any help is much appreciated.

kernelpanek-segfault commented 7 years ago

@fr33l Are your Marathon and Mesos endpoints using a self-signed certificate? If you are using the Docker image from Docker Hub, can you run docker run -it tendril/marathon-autoscaler python at the prompt:

URL = "<<USE YOUR MARATHON OR MESOS URL HERE>>"
response = requests.request("GET", URL, params=None, data=None, headers={'Content-Type': 'application/json', 'Accept': 'application/json'}, auth=None)

Does the above code produce an exception? If so, can you post the output of this exception?

kernelpanek-segfault commented 7 years ago

You may or may not need to alter the requests.request() call if your endpoints require authentication.