Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
2ae68df4
Unverified
Commit
2ae68df4
authored
7 years ago
by
Maxim Krasilnikov
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2153 from leseb/retry-rotate
Several enhancements and bug fixes
parents
7928cd20
dfcd60a9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Vagrantfile
+26
-2
26 additions, 2 deletions
Vagrantfile
with
26 additions
and
2 deletions
Vagrantfile
+
26
−
2
View file @
2ae68df4
...
@@ -9,12 +9,15 @@ CONFIG = File.join(File.dirname(__FILE__), "vagrant/config.rb")
...
@@ -9,12 +9,15 @@ CONFIG = File.join(File.dirname(__FILE__), "vagrant/config.rb")
COREOS_URL_TEMPLATE
=
"https://storage.googleapis.com/%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json"
COREOS_URL_TEMPLATE
=
"https://storage.googleapis.com/%s.release.core-os.net/amd64-usr/current/coreos_production_vagrant.json"
# Uniq disk UUID for libvirt
DISK_UUID
=
Time
.
now
.
utc
.
to_i
SUPPORTED_OS
=
{
SUPPORTED_OS
=
{
"coreos-stable"
=>
{
box:
"coreos-stable"
,
bootstrap_os:
"coreos"
,
user:
"core"
,
box_url:
COREOS_URL_TEMPLATE
%
[
"stable"
]},
"coreos-stable"
=>
{
box:
"coreos-stable"
,
bootstrap_os:
"coreos"
,
user:
"core"
,
box_url:
COREOS_URL_TEMPLATE
%
[
"stable"
]},
"coreos-alpha"
=>
{
box:
"coreos-alpha"
,
bootstrap_os:
"coreos"
,
user:
"core"
,
box_url:
COREOS_URL_TEMPLATE
%
[
"alpha"
]},
"coreos-alpha"
=>
{
box:
"coreos-alpha"
,
bootstrap_os:
"coreos"
,
user:
"core"
,
box_url:
COREOS_URL_TEMPLATE
%
[
"alpha"
]},
"coreos-beta"
=>
{
box:
"coreos-beta"
,
bootstrap_os:
"coreos"
,
user:
"core"
,
box_url:
COREOS_URL_TEMPLATE
%
[
"beta"
]},
"coreos-beta"
=>
{
box:
"coreos-beta"
,
bootstrap_os:
"coreos"
,
user:
"core"
,
box_url:
COREOS_URL_TEMPLATE
%
[
"beta"
]},
"ubuntu"
=>
{
box:
"bento/ubuntu-16.04"
,
bootstrap_os:
"ubuntu"
,
user:
"vagrant"
},
"ubuntu"
=>
{
box:
"bento/ubuntu-16.04"
,
bootstrap_os:
"ubuntu"
,
user:
"vagrant"
},
"centos"
=>
{
box:
"
bento/centos-7.3"
,
bootstrap_os:
"centos"
,
user:
"vagrant"
},
"centos"
=>
{
box:
"
centos/7"
,
bootstrap_os:
"centos"
,
user:
"vagrant"
},
}
}
# Defaults for config options defined in CONFIG
# Defaults for config options defined in CONFIG
...
@@ -34,6 +37,11 @@ $etcd_instances = $num_instances
...
@@ -34,6 +37,11 @@ $etcd_instances = $num_instances
$kube_master_instances
=
$num_instances
==
1
?
$num_instances
:
(
$num_instances
-
1
)
$kube_master_instances
=
$num_instances
==
1
?
$num_instances
:
(
$num_instances
-
1
)
# All nodes are kube nodes
# All nodes are kube nodes
$kube_node_instances
=
$num_instances
$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
$local_release_dir
=
"/vagrant/temp"
$local_release_dir
=
"/vagrant/temp"
host_vars
=
{}
host_vars
=
{}
...
@@ -112,6 +120,10 @@ Vagrant.configure("2") do |config|
...
@@ -112,6 +120,10 @@ Vagrant.configure("2") do |config|
vb
.
cpus
=
$vm_cpus
vb
.
cpus
=
$vm_cpus
end
end
config
.
vm
.
provider
:libvirt
do
|
lv
|
lv
.
memory
=
$vm_memory
end
ip
=
"
#{
$subnet
}
.
#{
i
+
100
}
"
ip
=
"
#{
$subnet
}
.
#{
i
+
100
}
"
host_vars
[
vm_name
]
=
{
host_vars
[
vm_name
]
=
{
"ip"
:
ip
,
"ip"
:
ip
,
...
@@ -122,7 +134,7 @@ Vagrant.configure("2") do |config|
...
@@ -122,7 +134,7 @@ Vagrant.configure("2") do |config|
}
}
config
.
vm
.
network
:private_network
,
ip:
ip
config
.
vm
.
network
:private_network
,
ip:
ip
# workaround for Vagrant 1.9.1 and centos vm
# workaround for Vagrant 1.9.1 and centos vm
# https://github.com/hashicorp/vagrant/issues/8096
# https://github.com/hashicorp/vagrant/issues/8096
if
Vagrant
::
VERSION
==
"1.9.1"
&&
$os
==
"centos"
if
Vagrant
::
VERSION
==
"1.9.1"
&&
$os
==
"centos"
...
@@ -132,6 +144,18 @@ Vagrant.configure("2") do |config|
...
@@ -132,6 +144,18 @@ Vagrant.configure("2") do |config|
# Disable swap for each vm
# Disable swap for each vm
config
.
vm
.
provision
"shell"
,
inline:
"swapoff -a"
config
.
vm
.
provision
"shell"
,
inline:
"swapoff -a"
if
$kube_node_instances_with_disks
# Libvirt
driverletters
=
(
'a'
..
'z'
).
to_a
config
.
vm
.
provider
:libvirt
do
|
lv
|
# always make /dev/sd{a/b/c} so that CI can ensure that
# virtualbox and libvirt will have the same devices to use for OSDs
(
1
..
$kube_node_instances_with_disks_number
).
each
do
|
d
|
lv
.
storage
:file
,
:device
=>
"hd
#{
driverletters
[
d
]
}
"
,
:path
=>
"disk-
#{
i
}
-
#{
d
}
-
#{
DISK_UUID
}
.disk"
,
:size
=>
$kube_node_instances_with_disks_size
,
:bus
=>
"ide"
end
end
end
# Only execute once the Ansible provisioner,
# Only execute once the Ansible provisioner,
# when all the machines are up and ready.
# when all the machines are up and ready.
if
i
==
$num_instances
if
i
==
$num_instances
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment