Initial commit
This commit is contained in:
commit
7e08800876
6 changed files with 104 additions and 0 deletions
56
Vagrantfile
vendored
Normal file
56
Vagrantfile
vendored
Normal file
|
@ -0,0 +1,56 @@
|
|||
# Controlled by puppet
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
ENV["VAGRANT_DEFAULT_PROVIDER"] = "libvirt"
|
||||
|
||||
$num_instances = 7
|
||||
$vm_memory = 2048
|
||||
$vm_cpus = 2
|
||||
|
||||
$user = "adidenko"
|
||||
$public_subnet = "10.210.0"
|
||||
$private_subnet = "10.210.1"
|
||||
$mgmt_cidr = "10.210.2.0/24"
|
||||
|
||||
$instance_name_prefix = "#{$user}-k8s"
|
||||
# Boxes with libvirt provider support:
|
||||
#$box = "yk0/ubuntu-xenial" #900M
|
||||
#$box = "centos/7"
|
||||
$box = "nrclark/xenial64-minimal-libvirt"
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
(1..$num_instances).each do |i|
|
||||
if i == 1
|
||||
bootstrap_script = "bootstrap-master.sh"
|
||||
else
|
||||
bootstrap_script = "bootstrap-node.sh"
|
||||
end
|
||||
config.ssh.insert_key = false
|
||||
vm_name = "%s-%02d" % [$instance_name_prefix, i]
|
||||
config.vm.define vm_name do |test_vm|
|
||||
test_vm.vm.box = $box
|
||||
test_vm.vm.hostname = vm_name
|
||||
test_vm.vm.provider :libvirt do |domain|
|
||||
domain.uri = "qemu+unix:///system"
|
||||
domain.memory = $vm_memory
|
||||
domain.cpus = $vm_cpus
|
||||
domain.driver = "kvm"
|
||||
domain.host = "localhost"
|
||||
domain.connect_via_ssh = false
|
||||
domain.username = $user
|
||||
domain.storage_pool_name = "default"
|
||||
domain.nic_model_type = "e1000"
|
||||
domain.management_network_name = "#{$instance_name_prefix}-mgmt-net"
|
||||
domain.management_network_address = $mgmt_cidr
|
||||
end
|
||||
|
||||
test_vm.vm.network :private_network, :ip => "#{$private_subnet}.#{i+10}"
|
||||
|
||||
# Provisioning
|
||||
config.vm.provision "file", source: "ssh", destination: "~/ssh"
|
||||
config.vm.provision :shell, :path => bootstrap_script
|
||||
|
||||
end
|
||||
end
|
||||
end
|
12
bootstrap-master.sh
Normal file
12
bootstrap-master.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
echo master > /var/tmp/role
|
||||
|
||||
sudo apt-get --yes update
|
||||
sudo apt-get --yes upgrade
|
||||
sudo apt-get --yes install ansible git screen
|
||||
sudo git clone https://github.com/kubespray/kargo /root/kargo
|
||||
|
||||
sudo rm -rf /root/.ssh
|
||||
sudo mv ~vagrant/ssh /root/.ssh
|
||||
sudo chown -R root: /root/.ssh
|
||||
|
7
bootstrap-node.sh
Normal file
7
bootstrap-node.sh
Normal file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
echo node > /var/tmp/role
|
||||
|
||||
sudo rm -rf /root/.ssh
|
||||
sudo mv ~vagrant/ssh /root/.ssh
|
||||
sudo chown -R root: /root/.ssh
|
||||
|
1
ssh/authorized_keys
Normal file
1
ssh/authorized_keys
Normal file
|
@ -0,0 +1 @@
|
|||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMw+fFXL37UxmicLHQfH+bW8ok/cw+Qd0mWw7NifIw21HtpvMMhE2zzWdJxewjmFG9xZ78F1xYYoJTamnggtpAi8vn+yP2tAlqC9PrW02vNgK3AkhFF2EtdL8anWl4m5YMGeGbN8ykVZeznbflsBiJ0MOgI0RUvukQf6K6I9zKof/tEzntKJO/aL54wC93e2ej2JOE3tMt1ABocOAGv2hJM1nYu2hUcoR9fmSLDhOTpRQY5SLqozZ52GYbx+T180GW6FaKUjcC0DTFFQE8K+98n4oL2mbWpHjDM1u2d3wcrBryDqXjBHat7bv+QW1DisauQzvxwMkwFVa1Jb08XEdX
|
27
ssh/id_rsa
Normal file
27
ssh/id_rsa
Normal file
|
@ -0,0 +1,27 @@
|
|||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEowIBAAKCAQE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PXWxO7y0FnZX887UtTpLuRyx7NTVjLJEJ7x7gS
|
||||
tCM93JOctJ1sf+0Msy30aQL0KVEf7GQLxsg+DusCgYAluvniep76Y0TnvBMPsbQU
|
||||
u+9sQHQHouSBIc26WhneCq4kPzkJUHJd6kUok707floO89ldWDj05M2VDqWCo1L7
|
||||
ezFarqPZ8524vwapS/MIlCf9kpPnK7QopobeRY/q/INjCX6aFfwX7AMUtDnFg0ph
|
||||
SFG+iM+ilixRigwvZE7wgQKBgQCOSJvMj3yzghOBP1vNvQAV7C5hYJoJLHJ1aIxr
|
||||
mlkRhv/+iZ69y+Hvb+GXaPApeSSlR7JRTNDxpCDe+YgdXbmQz1fg40Yj42ckq1qF
|
||||
PZaxyAhOlERh0dACwI/8pNgCIFLT0c/qR8jXwROWIiiGUi5GUsK8nPcDxBb/VKEz
|
||||
vitJswKBgFYTR/e/Y0B5HTJAz+4YSnBKXn5EBo6AFEVHLglY09kpPbSMpxb/olGX
|
||||
3fxd7aNckNxcD+WYq2jTycKwWzG/z5X/de3FccjigNjwRaudbCobj47I9UMAe9KL
|
||||
sawurq+OhVVo90HGkyh7rzcdYi80ARZU5fRikQGtJAfsMZFxEJqU
|
||||
-----END RSA PRIVATE KEY-----
|
1
ssh/id_rsa.pub
Normal file
1
ssh/id_rsa.pub
Normal file
|
@ -0,0 +1 @@
|
|||
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMw+fFXL37UxmicLHQfH+bW8ok/cw+Qd0mWw7NifIw21HtpvMMhE2zzWdJxewjmFG9xZ78F1xYYoJTamnggtpAi8vn+yP2tAlqC9PrW02vNgK3AkhFF2EtdL8anWl4m5YMGeGbN8ykVZeznbflsBiJ0MOgI0RUvukQf6K6I9zKof/tEzntKJO/aL54wC93e2ej2JOE3tMt1ABocOAGv2hJM1nYu2hUcoR9fmSLDhOTpRQY5SLqozZ52GYbx+T180GW6FaKUjcC0DTFFQE8K+98n4oL2mbWpHjDM1u2d3wcrBryDqXjBHat7bv+QW1DisauQzvxwMkwFVa1Jb08XEdX
|
Loading…
Reference in a new issue