Slide 1

Slide 1 text

INFRASTRUCTURE IN CODE STRIVING FOR BETTER ABSTRACTIONS AND AUTOMATION @pyr

Slide 2

Slide 2 text

SHORT BIO Pierre-Yves Ritschard CTO @ exoscale - The leading swiss public cloud provider Open Source Developer - riemann, collectd, pallet, openbsd Architect of several cloud platforms - paper.li Recovering Operations Engineer

Slide 3

Slide 3 text

Cloud History 101 Shedding the cognitive load Let cloudstack help you

Slide 4

Slide 4 text

CLOUD HISTORY 101 Getting rid of the physical world

Slide 5

Slide 5 text

Three decades of infrastructure Where we are today What went wrong

Slide 6

Slide 6 text

THREE DECADES OF INFRASTRUCTURE

Slide 7

Slide 7 text

In the 90's we had switches, routers and servers and they all had funny names

Slide 8

Slide 8 text

In the 2000's we had switches, routers ,hypervisors and virtual machines Tangentially, configuration management became a thing

Slide 9

Slide 9 text

Now we have commoditized infrastructure In common speak we have moved from machines to instances

Slide 10

Slide 10 text

WHERE WE ARE TODAY

Slide 11

Slide 11 text

Programmable provisioning

Slide 12

Slide 12 text

Programmable decomissioning

Slide 13

Slide 13 text

Ubiquitous IAAS

Slide 14

Slide 14 text

Much much simpler capacity planning

Slide 15

Slide 15 text

Negligible provision times

Slide 16

Slide 16 text

So, that's it ?

Slide 17

Slide 17 text

« Welp, looks like we done fixed infrastructure once and for all » - no one, ever

Slide 18

Slide 18 text

WHAT WENT WRONG

Slide 19

Slide 19 text

Credit: Jochen Smolka, Lund University

Slide 20

Slide 20 text

We still apply a big ball of mud approach to infrastructure instances are still black boxes full of mutable state

Slide 21

Slide 21 text

As a corollary, we keep a mapping of services to instances Although admittedly, configuration management helps

Slide 22

Slide 22 text

We insist on carrying over concepts from the physical world c r e a t e I P F o r w a r d i n g R u l e ... are we crazy ?

Slide 23

Slide 23 text

snowflakes !

Slide 24

Slide 24 text

SHEDDING THE COGNITIVE LOAD Embracing simplicity

Slide 25

Slide 25 text

Better abstractions Better automation

Slide 26

Slide 26 text

BETTER ABSTRACTIONS

Slide 27

Slide 27 text

Complexity is the enemy of scalability

Slide 28

Slide 28 text

Complexity is the enemy of security

Slide 29

Slide 29 text

We need to change our trust model No more NAT No more Address association No more volumes

Slide 30

Slide 30 text

Simpler abstractions Security groups Snapshots

Slide 31

Slide 31 text

BETTER AUTOMATION

Slide 32

Slide 32 text

Stop treating instances as the base unit of reasoning mitigates the risk of ending with a big ball of mud

Slide 33

Slide 33 text

Nodes are part of homogeneous groups (clusters)

Slide 34

Slide 34 text

Nodes should avoid configuration drift Strive for immutable infrastructure

Slide 35

Slide 35 text

Integrate IAAS features in automation by storing hints for configuration management when provisioning instances

Slide 36

Slide 36 text

Use your IAAS as a low level config registry let clusters discover themselves

Slide 37

Slide 37 text

LET CLOUDSTACK HELP YOU A short guide to better infrastructure

Slide 38

Slide 38 text

Abstractions Tooling Library support

Slide 39

Slide 39 text

ABSTRACTIONS

Slide 40

Slide 40 text

Keypairs you probably use them already

Slide 41

Slide 41 text

User Data c l o u d - i n i t is a great tool

Slide 42

Slide 42 text

Basic networking suffices for almost all use cases More scalable routing Great firewalling abilities through security groups

Slide 43

Slide 43 text

Tags Arbitrary metadata on instances

Slide 44

Slide 44 text

Projects, Instance Groups More heavy weight abstractions

Slide 45

Slide 45 text

TOOLING

Slide 46

Slide 46 text

Puppet Resource manipulation support cloud-init integration

Slide 47

Slide 47 text

Chef knife support for bootstrapping instances cloud-init integration

Slide 48

Slide 48 text

Cloudmonkey Great interaction tool, actively maintained

Slide 49

Slide 49 text

LIBRARY SUPPORT

Slide 50

Slide 50 text

Name your language Java: jclouds Ruby: fog, cloudstack_ruby_client Python: libcloud Clojure: pallet

Slide 51

Slide 51 text

Pallet: a small introduction Configuration management, provisionning, command and control Same tool space than chef and knife, but a library Built on top of apache Jclouds Clojure

Slide 52

Slide 52 text

Pallet: simple abstractions Node specifications Server Specifications Groups

Slide 53

Slide 53 text

Node specifications ( d e f u b u n t u - n o d e ( n o d e - s p e c : n e t w o r k { : i n b o u n d - p o r t s [ 2 2 , 8 0 , 4 4 3 ] } , : i m a g e { : o s - f a m i l y : u b u n t u , : o s - v e r s i o n - m a t c h e s " 1 2 . 0 4 " } , : h a r d w a r e { : m i n - c o r e s 1 , : m i n - d i s k 1 0 , : m i n - r a m 5 1 2 } ) )

Slide 54

Slide 54 text

Server specifications ( d e f w e b - s e r v e r ( s e r v e r - s p e c : p h a s e s { : c o n f i g u r e ( p l a n - f n ( p a c k a g e " n g i n x " ) ( p a c k a g e " m y - w e b - a p p " ) ) } ) ) ( d e f l b - s e r v e r ( s e r v e r - s p e c : p h a s e s { : c o n f i g u r e ( p l a n - f n ( p a c k a g e " h a p r o x y " ) ( h a p r o x y / a d d - b a c k e n d " w e b " : s e r v e r s ( n o d e s - w i t h - r o l e : w e b ) ) ) } ) )

Slide 55

Slide 55 text

Groups ( d e f w e b ( g r o u p - s p e c " w e b " : r o l e s [ : w e b ] : e x t e n d s [ b a s e - s e r v e r w e b - s e r v e r ] : n o d e - s p e c u b u n t u - n o d e ) ) ( d e f l b ( g r o u p - s p e c " l b " : r o l e s [ : l b ] : e x t e n d s [ b a s e - s e r v e r l b - s e r v e r ] : n o d e - s p e c u b u n t u - n o d e ) )

Slide 56

Slide 56 text

Provision from the CLI l e i n p a l l e t c o n v e r g e l b 1 w e b 4 Or your Code ( c o n v e r g e { l b 1 , w e b 4 } )

Slide 57

Slide 57 text

Pallet embraces the cloudstack API ( { : k e y " p a l l e t - g r o u p " , : r e s o u r c e i d " 3 b d 6 d 1 c d - e 8 f 8 - 4 4 5 f - 8 1 8 0 - 6 4 4 9 4 6 f 1 2 e d d " , : r e s o u r c e t y p e " U s e r V M " , : v a l u e " w e b " } , { : k e y " p a l l e t - s t a t e " , : r e s o u r c e i d " 3 b d 6 d 1 c d - e 8 f 8 - 4 4 5 f - 8 1 8 0 - 6 4 4 9 4 6 f 1 2 e d d " , : r e s o u r c e t y p e { : b o o t s t r a p p e d t r u e } , : v a l u e " w e b " } , { : k e y " p a l l e t - g r o u p " , : r e s o u r c e i d " 3 b d 6 d 1 c d - e 8 f 8 - 4 4 5 f - 8 1 8 0 - 6 4 4 9 4 6 f 1 2 e d d " , : r e s o u r c e t y p e " U s e r V M " , : v a l u e { : o s - v e r s i o n " 1 2 . 0 2 " , : o s - f a m i l y : u b u n t u , : i m a g e - i d " a 1 7 b 4 0 d 6 - 8 3 e 4 - 4 f 2 a - 9 e f 0 - d c e 6 a f 5 7 5 f f f a " } } )

Slide 58

Slide 58 text

PARTING WORDS Where to go from here

Slide 59

Slide 59 text

From infrastructure as code to infrastructure as data next step: reactive infrastructure

Slide 60

Slide 60 text

More power to the controller From IAAS to COAAS

Slide 61

Slide 61 text

Resources https://palletops.com https://github.com/exoscale/pallet-exoscale-demo

Slide 62

Slide 62 text

THANK YOU ! QUESTIONS ? @pyr