diff --git a/README.md b/README.md index a314df3..4629ac0 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,12 @@ Right now, the available environment variables are: Defaults to **8.8.8.8:53,8.8.4.4:53**, Googles' public [DNS service] (https://developers.google.com/speed/public-dns/docs/using). + - **CLOUD_PROVIDER** defines the specific cloud provider being used. + This is useful, for instance, if you're relying on kubernetes to set + load-balancers for your services. + + Possible values are `gce`, `gke`, `aws`, `azure`, `vagrant`, `vsphere`, + `libvirt-coreos` and `juju`. Defaults to **vagrant**. So, in order to start, say, a Kubernetes cluster with 3 minion nodes, 2GB of RAM and 2 vCPUs per node one just would do... diff --git a/Vagrantfile b/Vagrantfile index ff00657..f693c76 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -88,6 +88,15 @@ DNS_REPLICAS = ENV['DNS_REPLICAS'] || 2 DNS_DOMAIN = ENV['DNS_DOMAIN'] || "k8s.local" DNS_UPSTREAM_SERVERS = ENV['DNS_UPSTREAM_SERVERS'] || "8.8.8.8:53,8.8.4.4:53" +tempCloudProvider = (ENV['CLOUD_PROVIDER'].to_s.downcase) +case tempCloudProvider +when "gce", "gke", "aws", "azure", "vagrant", "sphere", "libvirt-coreos", "juju" + CLOUD_PROVIDER = tempCloudProvider +else + CLOUD_PROVIDER = 'vagrant' +end +puts "Cloud provider: #{CLOUD_PROVIDER}" + (1..(NUM_INSTANCES.to_i + 1)).each do |i| if i == 1 ETCD_SEED_CLUSTER = "" @@ -321,6 +330,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| sed -i "s,__NAME__,#{hostname},g" /tmp/vagrantfile-user-data sed -i "s|__ETCD_SEED_CLUSTER__|#{ETCD_SEED_CLUSTER}|g" /tmp/vagrantfile-user-data sed -i "s|__MASTER_IP__|#{MASTER_IP}|g" /tmp/vagrantfile-user-data + sed -i "s,__CLOUDPROVIDER__,#{CLOUD_PROVIDER},g" /tmp/vagrantfile-user-data mv /tmp/vagrantfile-user-data /var/lib/coreos-vagrant/ EOF end diff --git a/master.yaml b/master.yaml index cae70a8..d3e8852 100644 --- a/master.yaml +++ b/master.yaml @@ -170,6 +170,7 @@ coreos: --etcd_servers=http://127.0.0.1:2379 \ --public_address_override=__MASTER_IP__ \ --runtime_config=api/v1beta3 \ + --cloud_provider=__CLOUDPROVIDER__ \ --logtostderr=true Restart=always RestartSec=10