Support provisioning vagrant k8s clusters with coreos
parent
6ac1c1c886
commit
6fb17a813c
|
@ -7,6 +7,13 @@ Vagrant.require_version ">= 1.8.0"
|
||||||
|
|
||||||
CONFIG = File.join(File.dirname(__FILE__), "vagrant/config.rb")
|
CONFIG = File.join(File.dirname(__FILE__), "vagrant/config.rb")
|
||||||
|
|
||||||
|
SUPPORTED_OS = {
|
||||||
|
"coreos-stable" => {box: "coreos-stable", bootstrap_os: "coreos"},
|
||||||
|
"coreos-alpha" => {box: "coreos-alpha", bootstrap_os: "coreos"},
|
||||||
|
"coreos-beta" => {box: "coreos-beta", bootstrap_os: "coreos"},
|
||||||
|
"ubuntu" => {box: "bento/ubuntu-16.04", bootstrap_os: "ubuntu"},
|
||||||
|
}
|
||||||
|
|
||||||
# Defaults for config options defined in CONFIG
|
# Defaults for config options defined in CONFIG
|
||||||
$num_instances = 3
|
$num_instances = 3
|
||||||
$instance_name_prefix = "k8s"
|
$instance_name_prefix = "k8s"
|
||||||
|
@ -16,7 +23,8 @@ $vm_cpus = 1
|
||||||
$shared_folders = {}
|
$shared_folders = {}
|
||||||
$forwarded_ports = {}
|
$forwarded_ports = {}
|
||||||
$subnet = "172.17.8"
|
$subnet = "172.17.8"
|
||||||
$box = "bento/ubuntu-16.04"
|
$os = "coreos-stable"
|
||||||
|
$box = SUPPORTED_OS[$os][:box]
|
||||||
# The first three nodes are etcd servers
|
# The first three nodes are etcd servers
|
||||||
$etcd_instances = $num_instances
|
$etcd_instances = $num_instances
|
||||||
# The first two nodes are masters
|
# The first two nodes are masters
|
||||||
|
@ -103,6 +111,7 @@ Vagrant.configure("2") do |config|
|
||||||
# Override the default 'calico' with flannel.
|
# Override the default 'calico' with flannel.
|
||||||
# inventory/group_vars/k8s-cluster.yml
|
# inventory/group_vars/k8s-cluster.yml
|
||||||
"kube_network_plugin": "flannel",
|
"kube_network_plugin": "flannel",
|
||||||
|
"bootstrap_os": SUPPORTED_OS[$os][:bootstrap_os]
|
||||||
}
|
}
|
||||||
config.vm.network :private_network, ip: ip
|
config.vm.network :private_network, ip: ip
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue