Skip to content

Commit 51fce93

Browse files
committed
fix(contrib/azure/azure-coreos-cluster): extend load balancer timeout
Azure's load balancer has a default timeout of 4 minutes if there is no activity on the connection. The deis builder sometimes can hold a connection longer for 4 minutes without any getting any tcp packets from the client causing a timeout. This extends the timeout to azure's maximum of 30 minutes suitable for most application deployments.
1 parent f08e9b0 commit 51fce93

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

contrib/azure/azure-coreos-cluster

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ parser.add_argument('--data-disk', action='store_true',
5555
help='optional, attaches a data disk to each VM')
5656
parser.add_argument('--nohttps', action='store_true',
5757
help='optional, disables the creation of the https load balanced endpoint')
58-
5958
cloud_init_template = """#cloud-config
6059
6160
coreos:
@@ -134,8 +133,8 @@ def linux_config(hostname, args):
134133
system.disable_ssh_password_authentication = True
135134
return system
136135

137-
def endpoint_config(name, port, probe=False):
138-
endpoint = ConfigurationSetInputEndpoint(name, 'tcp', port, port, name)
136+
def lb_endpoint_config(name, port, probe=False, idle_timeout_minutes=4):
137+
endpoint = ConfigurationSetInputEndpoint(name, 'tcp', port, port, name, False, idle_timeout_minutes)
139138
if probe:
140139
endpoint.load_balancer_probe = probe
141140
return endpoint
@@ -160,11 +159,12 @@ def network_config(subnet_name=None, port='59913', public_ip_name=None):
160159
network.public_ips.public_ips.append(ip)
161160
if args.deis:
162161
# create web endpoint with probe checking /health-check
163-
network.input_endpoints.input_endpoints.append(endpoint_config('web', '80', load_balancer_probe('/health-check', '80', 'http')))
162+
network.input_endpoints.input_endpoints.append(lb_endpoint_config('web', '80', load_balancer_probe('/health-check', '80', 'http')))
164163
if not args.nohttps:
165-
network.input_endpoints.input_endpoints.append(endpoint_config('https', '443', load_balancer_probe(None, '443', 'tcp')))
166-
# create builder endpoint TCP probe check
167-
network.input_endpoints.input_endpoints.append(endpoint_config('builder', '2222', load_balancer_probe(None, '2222', 'tcp')))
164+
network.input_endpoints.input_endpoints.append(lb_endpoint_config('https', '443', load_balancer_probe(None, '443', 'tcp')))
165+
# create builder endpoint TCP probe check and extended timeout
166+
network.input_endpoints.input_endpoints.append(lb_endpoint_config('builder', '2222',
167+
load_balancer_probe(None, '2222', 'tcp',), 20))
168168
return network
169169

170170
def data_hd(target_container_url, target_blob_name, target_lun, target_disk_size_in_gb):

0 commit comments

Comments
 (0)