mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-13 21:34:40 +03:00
vagrant: allow to config vagrant with separate etcd (#12045)
This should help test separate etcd configuration locally more easily.
This commit is contained in:
20
Vagrantfile
vendored
20
Vagrantfile
vendored
@@ -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,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,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
|
||||
|
||||
Reference in New Issue
Block a user