|
6 | 6 | # included in the /LICENSE file.
|
7 | 7 |
|
8 | 8 |
|
9 |
| -import distutils.spawn |
10 | 9 | import json
|
11 | 10 | import os
|
12 | 11 | from subprocess import check_call,check_output
|
|
116 | 115 | for zone, context in contexts.items():
|
117 | 116 | external_ip = ''
|
118 | 117 | while True:
|
119 |
| - external_ip = check_output(['kubectl', 'get', 'svc', 'kube-dns-lb', '--namespace', 'kube-system', '--context', context, '--template', '{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}']) |
| 118 | + external_ip = check_output(['kubectl', 'get', 'svc', 'kube-dns-lb', '--namespace', 'kube-system', '--context', context, '--template', '{{range .status.loadBalancer.ingress}}{{.ip}}{{end}}']).decode('utf-8') |
120 | 119 | if external_ip:
|
121 | 120 | break
|
122 |
| - print 'Waiting for DNS load balancer IP in %s...' % (zone) |
| 121 | + print('Waiting for DNS load balancer IP in %s...' % (zone)) |
123 | 122 | sleep(10)
|
124 |
| - print 'DNS endpoint for zone %s: %s' % (zone, external_ip) |
| 123 | + print('DNS endpoint for zone %s: %s' % (zone, external_ip)) |
125 | 124 | dns_ips[zone] = external_ip
|
126 | 125 |
|
127 | 126 | # Update each cluster's DNS configuration with an appropriate configmap. Note
|
|
175 | 174 | check_call(['kubectl', 'apply', '-f', yaml_file, '--namespace', zone, '--context', context])
|
176 | 175 |
|
177 | 176 | # Finally, initialize the cluster.
|
178 |
| -print 'Sleeping 30 seconds before attempting to initialize cluster to give time for volumes to be created and pods started.' |
| 177 | +print('Sleeping 30 seconds before attempting to initialize cluster to give time for volumes to be created and pods started.') |
179 | 178 | sleep(30)
|
180 | 179 | for zone, context in contexts.items():
|
181 | 180 | check_call(['kubectl', 'create', '-f', 'cluster-init-secure.yaml', '--namespace', zone, '--context', context])
|
|
0 commit comments