diff --git a/Vagrantfile b/Vagrantfile index b7caebf63..986abae13 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -63,12 +63,22 @@ $inventories ||= [] $multi_networking ||= "False" $download_run_once ||= "True" $download_force_cache ||= "False" +# Modify those to have separate groups (for instance, to test separate etcd:) +# first_control_plane = 1 +# first_etcd = 4 +# control_plane_instances = 3 +# etcd_instances = 3 +$first_node ||= 1 +$first_control_plane ||= 1 +$first_etcd ||= 1 + # The first three nodes are etcd servers $etcd_instances ||= [$num_instances, 3].min # The first two nodes are kube masters -$kube_master_instances ||= [$num_instances, 2].min +$control_plane_instances ||= [$num_instances, 2].min # All nodes are kube nodes -$kube_node_instances ||= $num_instances +$kube_node_instances ||= $num_instances - $first_node + 1 + # The following only works when using the libvirt provider $kube_node_instances_with_disks ||= false $kube_node_instances_with_disks_size ||= "20G" @@ -297,9 +307,9 @@ Vagrant.configure("2") do |config| ansible.tags = [$ansible_tags] end ansible.groups = { - "etcd" => ["#{$instance_name_prefix}-[1:#{$etcd_instances}]"], - "kube_control_plane" => ["#{$instance_name_prefix}-[1:#{$kube_master_instances}]"], - "kube_node" => ["#{$instance_name_prefix}-[1:#{$kube_node_instances}]"], + "etcd" => ["#{$instance_name_prefix}-[#{$first_etcd}:#{$etcd_instances + $first_etcd - 1}]"], + "kube_control_plane" => ["#{$instance_name_prefix}-[#{$first_control_plane}:#{$control_plane_instances + $first_control_plane - 1}]"], + "kube_node" => ["#{$instance_name_prefix}-[#{$first_node}:#{$kube_node_instances + $first_node - 1}]"], "k8s_cluster:children" => ["kube_control_plane", "kube_node"], } end diff --git a/tests/files/vagrant_fedora39-kube-router.rb b/tests/files/vagrant_fedora39-kube-router.rb index ab0c4de84..e69a10b63 100644 --- a/tests/files/vagrant_fedora39-kube-router.rb +++ b/tests/files/vagrant_fedora39-kube-router.rb @@ -2,7 +2,7 @@ $num_instances = 2 $vm_memory ||= 2048 $os = "fedora39" -$kube_master_instances = 1 +$control_plane_instances = 1 $etcd_instances = 1 # For CI we are not worried about data persistence across reboot diff --git a/tests/files/vagrant_ubuntu20-kube-router-sep.rb b/tests/files/vagrant_ubuntu20-kube-router-sep.rb index 999f8132e..2b16f2043 100644 --- a/tests/files/vagrant_ubuntu20-kube-router-sep.rb +++ b/tests/files/vagrant_ubuntu20-kube-router-sep.rb @@ -2,7 +2,7 @@ $num_instances = 2 $vm_memory ||= 2048 $os = "ubuntu2004" -$kube_master_instances = 1 +$control_plane_instances = 1 $etcd_instances = 1 # For CI we are not worried about data persistence across reboot