|
|
|
@ -1,3 +1,7 @@
|
|
|
|
|
def get_traefik_ip
|
|
|
|
|
`HTTPS_PROXY=localhost:8888 kubectl -n traefik get services | grep traefik | grep pending | awk '{ print $4 }'`
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if ENV['GCE_PROJECT'] && ENV['GCE_DOMAIN'] && ENV['DNS_EMAIL'] && ENV['GCE_REGION']
|
|
|
|
|
if !File.exist?('traefik-service-account.json')
|
|
|
|
|
puts "File traefik-service-account.json is missing"
|
|
|
|
@ -28,6 +32,13 @@ if ENV['GCE_PROJECT'] && ENV['GCE_DOMAIN'] && ENV['DNS_EMAIL'] && ENV['GCE_REGIO
|
|
|
|
|
system("envsubst < deployment_base.yml > deployment.yml")
|
|
|
|
|
system("HTTPS_PROXY=localhost:8888 kubectl apply -f deployment.yml")
|
|
|
|
|
|
|
|
|
|
puts "Waiting for traefik load balancer's public ip address"
|
|
|
|
|
while !get_traefik_ip.match /[0-9]?[0-9]?[0-9]\.[0-9]?[0-9]?[0-9]\.[0-9]?[0-9]?[0-9]\.[0-9]?[0-9]?[0-9]/ do
|
|
|
|
|
puts "... still waiting"
|
|
|
|
|
sleep 5
|
|
|
|
|
end
|
|
|
|
|
puts "The public IP is #{get_traefik_ip}"
|
|
|
|
|
puts "You probably want to add it to your DNS config : *.#{ENV['GCE_DOMAIN']} A #{get_traefik_ip}"
|
|
|
|
|
else
|
|
|
|
|
puts "Missing env vars, did you define GCE_PROJECT, GCE_DOMAIN, GCE_REGION and DNS_EMAIL ?"
|
|
|
|
|
exit 1
|
|
|
|
|