@@ -130,14 +130,18 @@ def linux_config(hostname, args):
130130 system .disable_ssh_password_authentication = True
131131 return system
132132
133- def endpoint_config (name , port ):
133+ def endpoint_config (name , port , probe = False ):
134134 endpoint = ConfigurationSetInputEndpoint (name , 'tcp' , port , port , name )
135+ if probe :
136+ endpoint .load_balancer_probe = probe
137+ return endpoint
138+
139+ def load_balancer_probe (path , port , protocol ):
135140 load_balancer_probe = LoadBalancerProbe ()
136- load_balancer_probe .path = 'health-check'
141+ load_balancer_probe .path = path
137142 load_balancer_probe .port = port
138- load_balancer_probe .protocol = 'http'
139- endpoint .load_balancer_probe = load_balancer_probe
140- return endpoint
143+ load_balancer_probe .protocol = protocol
144+ return load_balancer_probe
141145
142146def network_config (subnet_name = None , port = '59913' , public_ip_name = None ):
143147 network = ConfigurationSet ()
@@ -149,8 +153,10 @@ def network_config(subnet_name=None, port='59913', public_ip_name=None):
149153 if public_ip_name :
150154 network .public_ips .public_ips .append (PublicIP (name = public_ip_name ))
151155 if args .deis :
152- network .input_endpoints .input_endpoints .append (endpoint_config ('http' , '80' ))
153- network .input_endpoints .input_endpoints .append (endpoint_config ('deis' , '2222' ))
156+ # create web endpoint with probe checking /health-check
157+ network .input_endpoints .input_endpoints .append (endpoint_config ('web' , '80' , load_balancer_probe ('/health-check' , '80' , 'http' )))
158+ # create builder endpoint with no health check
159+ network .input_endpoints .input_endpoints .append (endpoint_config ('builder' , '2222' , load_balancer_probe (None , '2222' , 'tcp' )))
154160 return network
155161
156162def data_hd (target_container_url , target_blob_name , target_lun , target_disk_size_in_gb ):
0 commit comments