You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I am missing something, but I cannot find a way how to add a static IP entry not belonging to any managed VM.
My use-case: 3 managed VMs are configured with keepalived to create a virtual IP in the same network. I'd like to assign a name to this IP using this plugin.
Here's my shortened Vagrant file:
Vagrant.configure("2")do |config|
config.vm.box="ubuntu/jammy64"config.vm.provider"virtualbox"do |vb|
# Display the VirtualBox GUI when booting the machinevb.gui=falsevb.default_nic_type="virtio"vb.linked_clone=truevb.memory="#{1024 * 6}"vb.cpus=3endNET="192.168.56"GW="#{NET}.1"# localhost IP on the VM networkAPI_VIP="#{NET}.9"config.dns.tld="vdev"config.dns.patterns=[/^(?:\w+\.)?k0s.vdev$/]N=3# number of schedulable control-plane nodes(1..N).eachdo |machine_id|
config.vm.define("ctrl-%02d" % [machine_id])do |machine|
machine.vm.hostname="ctrl-%02d" % [machine_id]machine.vm.network"private_network",ip: "#{NET}.#{10+machine_id}"machine.dns.patterns="#{machine.vm.hostname}.k0s.vdev"machine.vm.provision"shell",run: 'always',inline: <<-EOF set -euo pipefail if ip route | grep -q '^default via #{GW} dev.*'; then echo "replacing default GW ..." ip route replace default via #{GW} metric 10 else echo "adding default GW ..." ip route add default via #{GW} metric 10 fi EOFifmachine_id == Nmachine.vm.provision:ansibledo |ansible|
...
ansible.groups={"masters"=>["ctrl-[01:%02d]" % [N]],"masters:vars"=>{"k8s_master_keepalived_vip_address"=>"#{API_VIP}/24",# TODO: allow to add custom DNS entries without adding more VMs#"k0s_api_url" => "https://api.k0s.vdev:6443","k0s_api_url"=>"https://#{API_VIP}:6443",
...
}}endendendend
I wonder if in addition to config.dns.patterns = [/^(?:\w+\.)?k0s.vdev$/], one could add something like:
However, you could edit - either manually or using ruby in your vagrant file. ~/.vagrant.d/tmp/dns/config (which is a YAML file). If you can do that before the machines getting up, you won’t even need to restart the vagrant-dns server.
But remember, that there’s no one cleaning up after you :)
First of all, thanks for the great plugin.
Maybe I am missing something, but I cannot find a way how to add a static IP entry not belonging to any managed VM.
My use-case: 3 managed VMs are configured with keepalived to create a virtual IP in the same network. I'd like to assign a name to this IP using this plugin.
Here's my shortened Vagrant file:
I wonder if in addition to
config.dns.patterns = [/^(?:\w+\.)?k0s.vdev$/]
, one could add something like:Your help would be appreciated.
The text was updated successfully, but these errors were encountered: