Class: GV::Valley::Etcd

Inherits:
Bedrock::Service
  • Object
show all
Includes:
Common::DockerHelper, Common::HostHelper
Defined in:
lib/gv/valley/etcd.rb

Overview

Etcd Service

Constant Summary collapse

PORT =
4001

Instance Method Summary collapse

Constructor Details

#initializeEtcd

Returns a new instance of Etcd.



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/gv/valley/etcd.rb', line 20

def initialize
  super
  
  pull_image_if_does_not_exists "flynn/etcd"
  
  home = GV::Bedrock::Config.service.get("home")
  
  unless ps? 'etcd'
    cleanup
    pipe "docker run --name etcd -d -p #{self.external_ip}::#{PORT} -v #{home}/etcd:/data/db:rw flynn/etcd --name=greenvalley -data-dir=/data/db"
  end
end

Instance Method Details

#portObject



33
34
35
# File 'lib/gv/valley/etcd.rb', line 33

def port
  container_port 'etcd', self.external_ip, PORT
end