Book Image

CoreOS Essentials

By : Rimantas Mocevicius
Book Image

CoreOS Essentials

By: Rimantas Mocevicius

Overview of this book

<p>This book will help you get up and running on using CoreOS to develop effective computing networks. You will begin with understanding the basics of CoreOS. You will then discover what etcd is and how it is used, followed by launching Docker containers with systemd and fleet. Learn how to manage clusters, read system logs, and customize with cloud-config. You will set up the deployment to production using Docker builder and a private Docker registry. You will also see how to set up and use CoreUpdate and Enterprise Registry, and get an introduction to the new App Container called rkt and the newly introduced cluster manager known as Kubernetes.</p> <p>This book will equip you with all the information you need to leverage the power of CoreOS and the related containers for the effective deployment of your applications.</p>
Table of Contents (17 chapters)
CoreOS Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Bootstrapping a local cluster


As discussed earlier, we will be installing a three-peer etcd cluster on our computer.

Cloning the coreos-vagrant project

Let's clone the project and get it running. Follow these steps:

  1. In your terminal or command prompt, type this:

    $ mkdir cluster 
    $ cd cluster
    $ git clone https://github.com/coreos/coreos-vagrant.git
    $ cd coreos-vagrant
    $ cpconfig.rb.sampleconfig.rb
    $ cp user-data.sample user-data
    
  2. Now we need to adjust some settings. Edit config.rb and change the file's top part to this example:

    # Size of the CoreOS cluster created by Vagrant
    $num_instances=3
    
    # Used to fetch a new discovery token for a cluster of size $num_instances
    $new_discovery_url="https://discovery.etcd.io/new?size=#{$num_instances}"
    
    # To automatically replace the discovery token on 'vagrant up', uncomment
    # the lines below:
    #
    if File.exists?('user-data') &&ARGV[0].eql?('up')
      require 'open-uri'
      require 'yaml'
    
      token = open($new_discovery_url).read
    
      data = YAML.load(IO.readlines...