vagrant: allow to config vagrant with separate etcd (#12045)

This should help test separate etcd configuration locally more easily.
This commit is contained in:
Max Gautier
2025-03-18 10:15:49 +01:00
committed by GitHub
parent 56d37da105
commit e0920b33d7
3 changed files with 17 additions and 7 deletions

20
Vagrantfile vendored
View File

@@ -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

View File

@@ -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

View File

@@ -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