SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and...

41
SaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior Product Manager SUSE Linux GmbH [email protected] Bogdan Maryniuk Software Engineer SUSE Linux GmbH [email protected]

Transcript of SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and...

Page 1: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

SaltStack and SUSE® Systems and Configuration Managementthat Scales and is Easy to Extend

Joachim WernerSenior Product Manager

SUSE Linux GmbH

[email protected]

Bogdan Maryniuk Software Engineer

SUSE Linux GmbH

[email protected]

Page 2: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

2

Page 3: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

3

Page 4: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

4

Puppet CFEngine SaltStack

No Agent

Real Time

“Dumb” Device Proxy

Page 5: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

5

Puppet SaltStack

Page 6: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

6

CFEngine

Puppet

SaltStack

Almost 70% bigger

Page 7: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

7

“We had 10,000 lines of Puppet codeand reduced that to roughly 1,000 in Salt”

— Ryan Lane, Lyft

Page 8: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

8

“We are running around 70,000 minions.When you keep doubling boxes like this,

one does not simply scale”

— Thomas Jackson, LinkedIn

Page 9: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

9

“It is not about configuring Linux or Windows machine or configuring an operations or

deployment. It is about development, testing, production and heterogeneity across all that.”

— Ross Gardler, Microsoft Azure

Page 10: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

10

No Agent

Page 11: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

11

Commandsconfiguration

Results

Page 12: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

12

Just SSH

Page 13: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

13

SSH

Commandsconfiguration

Results

Master

No Agents!

Machine

Page 14: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

14

YourData Center

Page 15: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

15

Ports:4505-4506

Master

Minion

Minion

Minion

ØMQ

Page 16: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

16

Page 17: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

17

Master

Minions

Syndic

Minions

Page 18: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

18

Page 19: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

19

Page 20: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

20

Page 21: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

21

Master

Minion

ProxyMinions

“Dumb”Devices

Page 22: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

22

Page 23: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

23

salt 'helios.suse.de' \ cmd.run 'cat /proc/meminfo'salt -G \ 'kernelrelease:3.12.46*' \ cmd.run 'zypper up kernel-default'

salt-cp '*.suse.de' \ -G 'apacheversion:2.14*' \ /etc/apache2/conf.d/php.conf* \ /etc/apache2/conf.d

Page 24: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

24

Real time. Convenient.

Page 25: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

25

file_roots: base: - /srv/salt

/etc/salt/master

Target

Environment

State files

Page 26: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

26

file_roots: develop: - /srv/salt/dev testing: - /srv/salt/qa production: - /srv/salt/prod

/etc/salt/master

Page 27: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

27

base: 'web*': - apache

/srv/salt/top.sls

Page 28: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

28

apache: pkg: - installed - name: httpd

/srv/salt/apache.sls

Page 29: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

29

my: auth: - uid: johnsmith - pwd: f-u-cn-rd-ths-u-cn-uz-unx - host: data.suse.com

/srv/pillar/my.sls

testdb_user: mysql_user.present: - name: {{ salt['pillar.get']('my:auth:uid') }} - password: {{ salt['pillar.get']('my:auth:pwd') }} - host: {{ salt['pillar.get']('my:auth:host') }}

/srv/salt/my/user.sls

Page 30: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

30

#!pydsl

apache = state('apache')apache.pkg.installed()apache.service.running()state('/var/www/index.html')\ .file('managed', source='salt://webserver/index.html')\ .require(pkg='apache')

/srv/salt/apache.sls

Page 31: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

31

Monitoring

Hard to scale

Difficult

Slow

Page 32: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

32

Data StorageUser

InterfaceAgent

Agent

Agent

Page 33: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

33

Data StorageUser

Interface

Page 34: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

34

MonitoringHard to scale Scalable

Difficult Consistent

Slow Fast

Page 35: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

35

import os

def zypper(): """ Return 'zypper' location if present. """

path = os.popen("which zypper 2>/dev/null").read().strip() out = {'zypper' : {'available': path != ''}} if path: out['zypper']['path'] = path

return out

Your custom Grain

Page 36: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

36

1. Save as /srv/salt/_grains/hello.py

Your custom Grain

2. Deploy:

salt '*' saltutils.sync_all

3. Enjoy:

salt '*' grains.item zypper

Page 37: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

37

Page 38: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

38

Page 39: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

39

Page 40: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

Corporate HeadquartersMaxfeldstrasse 590409 NurembergGermany

+49 911 740 53 0 (Worldwide)www.suse.com

Join us on:www.opensuse.org

40

Page 41: SaltStack and SUSE › doc › 2015 › sessions › TUT20514.pdfSaltStack and SUSE ® Systems and Configuration Management that Scales and is Easy to Extend Joachim Werner Senior

Unpublished Work of SUSE LLC. All Rights Reserved.This work is an unpublished work and contains confidential, proprietary and trade secret information of SUSE LLC. Access to this work is restricted to SUSE employees who have a need to know to perform tasks within the scope of their assignments. No part of this work may be practiced, performed, copied, distributed, revised, modified, translated, abridged, condensed, expanded, collected, or adapted without the prior written consent of SUSE. Any use or exploitation of this work without authorization could subject the perpetrator to criminal and civil liability.

General DisclaimerThis document is not to be construed as a promise by any participating company to develop, deliver, or market a product. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. SUSE makes no representations or warranties with respect to the contents of this document, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. The development, release, and timing of features or functionality described for SUSE products remains at the sole discretion of SUSE. Further, SUSE reserves the right to revise this document and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes. All SUSE marks referenced in this presentation are trademarks or registered trademarks of Novell, Inc. in the United States and other countries. All third-party trademarks are the property of their respective owners.