Slide 1

Slide 1 text

Service Discovery and Configuration Management Puppet Labs Gareth Rushgrove Two speeds of configuration

Slide 2

Slide 2 text

@garethr

Slide 3

Slide 3 text

Gareth Rushgrove

Slide 4

Slide 4 text

Gareth Rushgrove

Slide 5

Slide 5 text

This talk

Slide 6

Slide 6 text

A quick introduction to Service Discovery Gareth Rushgrove

Slide 7

Slide 7 text

Why it’s useful to have two speeds of configuration Gareth Rushgrove

Slide 8

Slide 8 text

An example of using Consul alongside Puppet Gareth Rushgrove

Slide 9

Slide 9 text

Some brief thoughts about change control and autonomous systems Gareth Rushgrove

Slide 10

Slide 10 text

What is Service Discovery?

Slide 11

Slide 11 text

Gareth Rushgrove

Slide 12

Slide 12 text

Service discovery is a key component of most distributed systems and service oriented architectures. Gareth Rushgrove http://jasonwilder.com/blog/2014/02/04/service-discovery-in-the-cloud/

Slide 13

Slide 13 text

The problem seems simple at first: How do clients determine the IP and port for a service that exist on multiple hosts? Gareth Rushgrove http://jasonwilder.com/blog/2014/02/04/service-discovery-in-the-cloud/

Slide 14

Slide 14 text

Etcd, Consul, Zookeeper Gareth Rushgrove

Slide 15

Slide 15 text

Hadoop uses Zookeeper Socketplane uses Consul CoreOS uses etcd Cloud Foundry uses Consul Cloud Foundry also uses etcd Kubernetes uses etcd Gareth Rushgrove

Slide 16

Slide 16 text

Gareth Rushgrove Thanks to etcd for the graphics

Slide 17

Slide 17 text

Gareth Rushgrove Thanks to etcd for the graphics

Slide 18

Slide 18 text

Gareth Rushgrove Thanks to etcd for the graphics

Slide 19

Slide 19 text

Gareth Rushgrove Jepsen

Slide 20

Slide 20 text

Why now?

Slide 21

Slide 21 text

Every organisation wants to move quicker Gareth Rushgrove

Slide 22

Slide 22 text

Provisioning times are decreasing rapidly Gareth Rushgrove

Slide 23

Slide 23 text

The number of applications, and instances of those applications, is increasing rapidly Gareth Rushgrove

Slide 24

Slide 24 text

The number of systems administrators is probably going to stay the same. Sorry. Gareth Rushgrove

Slide 25

Slide 25 text

Technology moving towards a cluster centric view rather than a host centric view Gareth Rushgrove

Slide 26

Slide 26 text

Hard-coding everything doesn’t scale Gareth Rushgrove

Slide 27

Slide 27 text

Some relevant technology you may have heard of Gareth Rushgrove

Slide 28

Slide 28 text

Gareth Rushgrove

Slide 29

Slide 29 text

Gareth Rushgrove

Slide 30

Slide 30 text

Gareth Rushgrove

Slide 31

Slide 31 text

Gareth Rushgrove

Slide 32

Slide 32 text

Two speeds of configuration

Slide 33

Slide 33 text

Configuration management tools tend to focus on upfront modelling, managing configuration we know and want to control over time Gareth Rushgrove

Slide 34

Slide 34 text

For example the version of a package or application, user permissions, security settings, system constrains Gareth Rushgrove

Slide 35

Slide 35 text

Service discovery tools handle emergent configuration which is a property of the running system Gareth Rushgrove

Slide 36

Slide 36 text

For example load balancer and proxy backends, network and firewall routes as applications come and go Gareth Rushgrove

Slide 37

Slide 37 text

Wait, but I want to define some of my network configuration upfront Gareth Rushgrove

Slide 38

Slide 38 text

Hence two speeds, model driven and emergent Gareth Rushgrove

Slide 39

Slide 39 text

How to mix configuration management and service discovery

Slide 40

Slide 40 text

We’ll use Consul for this example Gareth Rushgrove

Slide 41

Slide 41 text

We’ll also use Puppet Gareth Rushgrove

Slide 42

Slide 42 text

First lets install Consul everywhere Gareth Rushgrove

Slide 43

Slide 43 text

Gareth Rushgrove

Slide 44

Slide 44 text

That’s it Gareth Rushgrove

Slide 45

Slide 45 text

Gareth Rushgrove KyleAnderson/consul

Slide 46

Slide 46 text

We can configure servers and clients using Hiera Gareth Rushgrove

Slide 47

Slide 47 text

Gareth Rushgrove

Slide 48

Slide 48 text

Gareth Rushgrove

Slide 49

Slide 49 text

Consul nodes need to register with a server Gareth Rushgrove

Slide 50

Slide 50 text

Gareth Rushgrove

Slide 51

Slide 51 text

Populating the Consul service registry Gareth Rushgrove

Slide 52

Slide 52 text

Gareth Rushgrove

Slide 53

Slide 53 text

Gareth Rushgrove Consul dashboard

Slide 54

Slide 54 text

Create your own types Gareth Rushgrove

Slide 55

Slide 55 text

Gareth Rushgrove

Slide 56

Slide 56 text

Gareth Rushgrove

Slide 57

Slide 57 text

Using information from Consul in Puppet Gareth Rushgrove

Slide 58

Slide 58 text

Gareth Rushgrove

Slide 59

Slide 59 text

Gareth Rushgrove

Slide 60

Slide 60 text

Gareth Rushgrove

Slide 61

Slide 61 text

Gareth Rushgrove lynxman/hiera_consul

Slide 62

Slide 62 text

Trigger Puppet when something pertinent changes Gareth Rushgrove

Slide 63

Slide 63 text

Gareth Rushgrove

Slide 64

Slide 64 text

Gareth Rushgrove Demo time

Slide 65

Slide 65 text

Same example possible with a bit of hacking for etcd Gareth Rushgrove

Slide 66

Slide 66 text

Gareth Rushgrove garethr/hiera-etcd

Slide 67

Slide 67 text

Gareth Rushgrove KyleAnderson/etcd

Slide 68

Slide 68 text

Advantages Changes happen quickly, but without losing the ability to address configuration drift Gareth Rushgrove

Slide 69

Slide 69 text

Advantages Reduce complexity of watchers, all changes lead to a Puppet run Gareth Rushgrove

Slide 70

Slide 70 text

Advantages All changes to configuration, however triggered, are tracked in one place Gareth Rushgrove

Slide 71

Slide 71 text

Advantages Define all watchers in code Gareth Rushgrove

Slide 72

Slide 72 text

Advantages Reduce duplication, same code runs for new and existing instances Gareth Rushgrove

Slide 73

Slide 73 text

Bonus distributed configuration Gareth Rushgrove

Slide 74

Slide 74 text

Replace lots of identical local files on disk with distributed key/values Gareth Rushgrove

Slide 75

Slide 75 text

Gareth Rushgrove

Slide 76

Slide 76 text

Gareth Rushgrove

Slide 77

Slide 77 text

Gareth Rushgrove garethr/key_value_config

Slide 78

Slide 78 text

Conclusions

Slide 79

Slide 79 text

Change control and autonomous systems Gareth Rushgrove

Slide 80

Slide 80 text

The importance of building trust in automation Gareth Rushgrove

Slide 81

Slide 81 text

Two speeds of configuration Gareth Rushgrove

Slide 82

Slide 82 text

Questions? And thanks for listening