/coreos-sandbox

CoreOS Vagrant for Sandbox

Primary LanguageRuby

CoreOS Sandbox

This repo is a fork of coreos/coreos-vagrant. This provides a template Vagrantfile to create CoreOS cluster using Virtualbox and Vagrant.

REQUIREMENTS

Install dependencies

GETTING STARTED

Clone this project and bootstrapping

$ git clone https://github.com/spesnova/coreos-sandbox && coreos-sandbox
$ script/bootstrap

Startup and SSH

$ vagrant up
$ vagrant ssh

TESTING

$ script/cibuild

CONFIGURATION

Provisioning with Cloud-Config

Using GitHub SSH key to login

user-data.yml.erb

#cloud-config

users:
  - name: seigo
  coreos-ssh-import-github: spesnova

~/.ssh/config

# Local CoreOS Cluster
Host core-01
  HostName 172.17.8.101
  User spesnova
  IdentityFile ~/.ssh/github_ssh_private_key
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  LogLevel FATAL

You can login to CoreOS machine using GitHub SSH key.

$ ssh seigo@core-01

Cluster Setup

Etcd Discovery

Get new token from https://discovery.etcd.io/new , then set this to .env

ETCD_DISCOVERY=https://discovery.etcd.io/xxxxxxxxxxxxxxxxxxxxx

Also, bootstrap script set new one if ETCD_DISCOVERY is empty.

Cluster Nodes

Configure $num_instances in config.rb

$num_instances=3

Specify channel

Configure $update_channel in config.rb

$update_channel="stable"

Updating the Box

Update to newer version of the box "coreos-stable"

$ vagrant box update

Monitoring by Datadog

Datadog API Key

Set datadog API key to .env

DATADOG_API_KEY=xxxxxxxxxxxxxxxxxxxx

Gitreceive

Register SSH public keys that imported from github to Gitreceive.

# on CoreOS machines
$ /home/git/register-keys <github-username-1>,<github-username-2>,<github-username-3>

# Example
$ /home/git/register-keys spesnova