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

Reading and writing from the application container


Usually, application containers (this is a general term for docker, rkt, and other types of containers) do not have etcdctl or even curl installed by default. Installing curl is much easier than installing etcdctl.

For our example, we will use the Alpine Linux docker image, which is very small in size and will not take much time to pull from the docker registry:

  1. Firstly, we need to check the docker0 interface IP, which we will use with curl:

    $ echo"$(ifconfig docker0 | awk'/\<inet\>/ { print $2}'):2379"
    10.1.42.1:2379
    
  2. Let's run the docker container with a bash shell:

    $ docker run -it alpine ash
    

    We should see something like this in Command Prompt:/ #.

  3. As curl is not installed by default on Alpine Linux, we need to install it:

    $ apk update&&apk add curl
    $ curl -L http://10.1.42.1:2379/v2/keys/
    {"action":"get","node":{"key":"/","dir":true,"nodes":[{"key":"/coreos.com","dir":true,"modifiedIndex":3,"createdIndex":3}]}}
    
  4. Repeat steps...