Skip to content

Commit

Permalink
fix(contrib/azure): fix health-check for builder
Browse files Browse the repository at this point in the history
  • Loading branch information
carmstrong committed Feb 10, 2015
1 parent 105fdc1 commit 9793fd5
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions contrib/azure/azure-coreos-cluster
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,18 @@ def linux_config(hostname, args):
system.disable_ssh_password_authentication = True
return system

def endpoint_config(name, port):
def endpoint_config(name, port, probe=False):
endpoint = ConfigurationSetInputEndpoint(name, 'tcp', port, port, name)
if probe:
endpoint.load_balancer_probe = probe
return endpoint

def load_balancer_probe(path, port, protocol):
load_balancer_probe = LoadBalancerProbe()
load_balancer_probe.path = 'health-check'
load_balancer_probe.path = path
load_balancer_probe.port = port
load_balancer_probe.protocol = 'http'
endpoint.load_balancer_probe = load_balancer_probe
return endpoint
load_balancer_probe.protocol = protocol
return load_balancer_probe

def network_config(subnet_name=None, port='59913', public_ip_name=None):
network = ConfigurationSet()
Expand All @@ -149,8 +153,10 @@ def network_config(subnet_name=None, port='59913', public_ip_name=None):
if public_ip_name:
network.public_ips.public_ips.append(PublicIP(name=public_ip_name))
if args.deis:
network.input_endpoints.input_endpoints.append(endpoint_config('http', '80'))
network.input_endpoints.input_endpoints.append(endpoint_config('deis', '2222'))
# create web endpoint with probe checking /health-check
network.input_endpoints.input_endpoints.append(endpoint_config('web', '80', load_balancer_probe('/health-check', '80', 'http')))
# create builder endpoint with no health check
network.input_endpoints.input_endpoints.append(endpoint_config('builder', '2222', load_balancer_probe(None, '2222', 'tcp')))
return network

def data_hd(target_container_url, target_blob_name, target_lun, target_disk_size_in_gb):
Expand Down

0 comments on commit 9793fd5

Please sign in to comment.