Skip to content
Snippets Groups Projects
Select Git revision
  • d82abdbef941949e7cf05f34a3efda046b1450e4
  • master default protected
  • v1.14.7
  • v1.14.6
  • v1.14.5
  • v1.14.4
  • v1.14.3
  • v1.14.2
  • v1.14.1
  • v1.14.0
  • v1.13.2
  • v1.13.1
  • v1.13.0
  • v1.12.1
  • v1.12.0
  • v1.11.1
  • v1.11.0
  • v1.10.0
  • v1.9.2
  • v1.9.1
  • v1.9.0
  • v1.8.4
22 results

README-location.md

Blame
  • Vagrantfile 10.69 KiB
    # -*- mode: ruby -*-
    # # vi: set ft=ruby :
    
    # For help on using kubespray with vagrant, check out docs/vagrant.md
    
    require 'fileutils'
    
    Vagrant.require_version ">= 2.0.0"
    
    CONFIG = File.join(File.dirname(__FILE__), ENV['KUBESPRAY_VAGRANT_CONFIG'] || 'vagrant/config.rb')
    
    FLATCAR_URL_TEMPLATE = "https://%s.release.flatcar-linux.net/amd64-usr/current/flatcar_production_vagrant.json"
    
    # Uniq disk UUID for libvirt
    DISK_UUID = Time.now.utc.to_i
    
    SUPPORTED_OS = {
      "flatcar-stable"      => {box: "flatcar-stable",             user: "core", box_url: FLATCAR_URL_TEMPLATE % ["stable"]},
      "flatcar-beta"        => {box: "flatcar-beta",               user: "core", box_url: FLATCAR_URL_TEMPLATE % ["beta"]},
      "flatcar-alpha"       => {box: "flatcar-alpha",              user: "core", box_url: FLATCAR_URL_TEMPLATE % ["alpha"]},
      "flatcar-edge"        => {box: "flatcar-edge",               user: "core", box_url: FLATCAR_URL_TEMPLATE % ["edge"]},
      "ubuntu1604"          => {box: "generic/ubuntu1604",         user: "vagrant"},
      "ubuntu1804"          => {box: "generic/ubuntu1804",         user: "vagrant"},
      "ubuntu2004"          => {box: "generic/ubuntu2004",         user: "vagrant"},
      "centos"              => {box: "centos/7",                   user: "vagrant"},
      "centos-bento"        => {box: "bento/centos-7.6",           user: "vagrant"},
      "centos8"             => {box: "centos/8",                   user: "vagrant"},
      "centos8-bento"       => {box: "bento/centos-8",             user: "vagrant"},
      "fedora32"            => {box: "fedora/32-cloud-base",       user: "vagrant"},
      "fedora33"            => {box: "fedora/33-cloud-base",       user: "vagrant"},
      "opensuse"            => {box: "bento/opensuse-leap-15.2",   user: "vagrant"},
      "opensuse-tumbleweed" => {box: "opensuse/Tumbleweed.x86_64", user: "vagrant"},
      "oraclelinux"         => {box: "generic/oracle7",            user: "vagrant"},
      "oraclelinux8"        => {box: "generic/oracle8",            user: "vagrant"},
      "rhel7"               => {box: "generic/rhel7",              user: "vagrant"},
      "rhel8"               => {box: "generic/rhel8",              user: "vagrant"},
    }
    
    if File.exist?(CONFIG)
      require CONFIG
    end
    
    # Defaults for config options defined in CONFIG
    $num_instances ||= 3
    $instance_name_prefix ||= "k8s"
    $vm_gui ||= false
    $vm_memory ||= 2048
    $vm_cpus ||= 2
    $shared_folders ||= {}
    $forwarded_ports ||= {}
    $subnet ||= "172.18.8"
    $subnet_ipv6 ||= "fd3c:b398:0698:0756"
    $os ||= "ubuntu1804"
    $network_plugin ||= "flannel"
    # Setting multi_networking to true will install Multus: https://github.com/intel/multus-cni
    $multi_networking ||= false
    $download_run_once ||= "True"
    $download_force_cache ||= "True"
    # The first three nodes are etcd servers
    $etcd_instances ||= $num_instances
    # The first two nodes are kube masters
    $kube_master_instances ||= $num_instances == 1 ? $num_instances : ($num_instances - 1)
    # All nodes are kube nodes
    $kube_node_instances ||= $num_instances
    # The following only works when using the libvirt provider
    $kube_node_instances_with_disks ||= false
    $kube_node_instances_with_disks_size ||= "20G"
    $kube_node_instances_with_disks_number ||= 2
    $override_disk_size ||= false
    $disk_size ||= "20GB"