Browse Source

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

This should help test separate etcd configuration locally more easily.
pull/11991/head
Max Gautier 2 months ago
committed by GitHub
parent
commit
e0920b33d7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
3 changed files with 17 additions and 7 deletions
  1. 20
      Vagrantfile
  2. 2
      tests/files/vagrant_fedora39-kube-router.rb
  3. 2
      tests/files/vagrant_ubuntu20-kube-router-sep.rb

20
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

2
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

2
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

Loading…
Cancel
Save