This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
141 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,3 +62,6 @@ remora/scripts/images | |
remora/scripts/userdata/*.yaml | ||
|
||
.DS_Store | ||
|
||
# vagrant | ||
.vagrant/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
VAGRANTFILE_API_VERSION = "2" | ||
|
||
public_key = nil | ||
[ENV['REMORA_PUBLIC_KEY'], "~/.ssh/id_rsa.pub", "~/.ssh/id_dsa.pub"].each do |p_key| | ||
if p_key | ||
p_key = File.expand_path(p_key) | ||
if File.file?(p_key) | ||
public_key = open(p_key).read | ||
break | ||
end | ||
end | ||
end | ||
|
||
unless public_key | ||
raise "Please specify ssh public key using following env: REMORA_PUBLIC_KEY" | ||
end | ||
|
||
SCRIPT = <<-EOF | ||
echo "#{public_key}" >> ~vagrant/.ssh/authorized_keys | ||
swapoff /dev/sda2 | ||
sed -i -e "/swap/d" /etc/fstab | ||
EOF | ||
|
||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
config.vm.box = "envimation/ubuntu-xenial-docker" | ||
config.vm.box_url = "https://atlas.hashicorp.com/envimation/boxes/ubuntu-xenial-docker" | ||
|
||
config.vm.define :master do |master| | ||
master.vm.hostname = "master" | ||
master.vm.provider "virtualbox" do |v, override| | ||
v.customize ["modifyvm", :id, "--memory", "2048"] | ||
end | ||
|
||
master.vm.network :private_network, ip: "192.168.43.101" | ||
|
||
master.vm.provision :shell, inline: SCRIPT | ||
end | ||
|
||
[[:worker01, 102], [:worker02, 103]].each do |worker| | ||
config.vm.define worker[0] do |w| | ||
w.vm.hostname = worker[0].to_s | ||
w.vm.provider "virtualbox" do |v, override| | ||
v.customize ["modifyvm", :id, "--memory", "2048"] | ||
end | ||
|
||
w.vm.network :private_network, ip: "192.168.43.#{worker[1]}" | ||
|
||
w.vm.provision :shell, inline: SCRIPT | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
user: vagrant | ||
|
||
local: | ||
assets_dir: "~/.kube/vagrant" | ||
|
||
|
||
masters: &masters | ||
- 192.168.43.101 | ||
workers: &workers | ||
- 192.168.43.102 | ||
- 192.168.43.103 | ||
|
||
roledefs: | ||
bootstrap: | ||
- 192.168.43.101 | ||
etcd: *masters | ||
master: *masters | ||
worker: *workers | ||
|
||
kubernetes: | ||
version: v1.8.1 | ||
public_service_ip: 192.168.43.100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Play with Vagrant | ||
|
||
You can also test `Remora` with Vagrant. | ||
|
||
## Prerequisite | ||
|
||
You will need following softwares. | ||
|
||
- Python 3.5 or later and pip | ||
- kubectl 1.7.x or later | ||
|
||
### Install Python and pip | ||
|
||
```bash | ||
$ sudo apt install curl llvm sqlite3 libssl-dev libbz2-dev libreadline-dev libsqlite3-dev libncurses5-dev libncursesw5-dev python-tk python3-tk tk-dev | ||
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv | ||
$ cat <<-'EOF' >> ~/.bash_profile | ||
export PYENV_ROOT=$HOME/.pyenv | ||
export PATH=$PYENV_ROOT/bin:$PATH | ||
eval "$(pyenv init -)" | ||
EOF | ||
$ source ~/.bash_profile | ||
$ pyenv install 3.5.3 | ||
$ pyenv global 3.5.3 | ||
$ curl -kL https://bootstrap.pypa.io/get-pip.py | python | ||
``` | ||
|
||
### Install kubectl | ||
|
||
```bash | ||
$ curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl | ||
$ chmod +x ./kubectl | ||
$ sudo mv ./kubectl /usr/local/bin/kubectl | ||
``` | ||
|
||
## Install Kubernetes Cluster using Remora | ||
|
||
### Install Remora | ||
|
||
```bash | ||
$ git clone https://github.com/nec-openstack/remora.git | ||
$ cd remora | ||
$ pip install -r requirements.txt | ||
``` | ||
|
||
### Install Kubernetes Cluster | ||
|
||
```bash | ||
$ vagrant up | ||
$ fab vagrant render | ||
$ fab vagrant install | ||
``` | ||
|
||
### Access your Kubernetes Cluster | ||
|
||
```bash | ||
$ fab vagrant config | ||
$ kubectl version | ||
``` |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.