O'Reilly logo

CoreOS Essentials by Rimantas Mocevicius

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reading and writing to etcd from the host machine

You are going to learn how read and write to ectd from the host machine. We will use both the etcdctl and curl examples here.

Logging in to the host

To log in to CoreOS VM, follow these steps:

  1. Boot the CoreOS VM installed in the first chapter. In your terminal, type this:
    $ cdcoreos-vagrant
    $ vagrant up
    
  2. We need to log in to the host via ssh:
    $ vagrant ssh
    

Reading and writing to ectd

Let's read and write to etcd using etcdctl. So, perform these steps:

  1. Set a message1 key with etcdctl with Book1 as the value:
    $ etcdctl set /message1 Book1
    Book1 (we got respond for our successful write to etcd)
    
  2. Now, let's read the key value to double-check whether everything is fine there:
    $ etcdctl get /message1
    Book1 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required