SlideShare a Scribd company logo
1 of 28
Download to read offline
www.vishalbiyani.com
Vishal Biyani, DevOps & Cloud Consultant
[TechTalks]
Learning Configuration Management with SaltStack
(Advanced Concepts)
www.vishalbiyani.com
About Me
Vishal Biyani is a DevOps engineer at large. In his past stints he has
done Java development to operations for enterprise systems.
Current interests around Go, Docker, Mesos and plenty of other
stuff. Scribbles at www.vishalbiyani.com. Other interests around
reading, movies and bit of photography. Latest fascination is to
build a DIY Satellite and launch it.
www.vishalbiyani.com
Quick Poll
• How many know anyone of Puppet, Chef, Ansible or Salt
• How many know Salt?
• WHat problems have you faced in Puppet/Chef/Ansible?
www.vishalbiyani.com
Agenda
• Overview of Basics & some Debugging Techniques
• Peer Communication in Salt
• Events, Orchestration & Reactors
• Mine
• Beacons
• Multi-master & Syndic
• Basic Salt Cloud
You can checkout the project at https://github.com/vishal-biyani/saltstack-cluster - this is a
working Salt server+minion setup and has some of examples in today’s talk. Feel free to
file bugs or send pull requests to enhance.
Remind me to show
some exercises when
you see this balloon if I
forget!
www.vishalbiyani.com
OVERVIEW OF BASICS & SOME
DEBUGGING TECHNIQUES
www.vishalbiyani.com
Quick Basics
• Salt is CM platform based on Python language and YAML data format.
Uses ZeroMQ for scalable and fast communication across large number
of nodes
• Typical use cases you see like any other CM platform:
• Managing OS and platform stack on number of machines
• Remote execution of commands (Remove all data in /temp)
• Managing configuration data
• Orchestration to ensure complex use cases for infrastructure/platform
• Server - Agent based (Called minion-master) though you can use it like
Ansible with salt-ssh module (With some limitations)
www.vishalbiyani.com
Command Line - Remote Execution
•What do you want to target – all web
servers for ex.?
Target
• We are using test module and ping
function - but there are many more
Module + Command
• In our case no argument - but typically
there will be some arguments
ArgumentsHands
on!
www.vishalbiyani.com
State, Pillar, Grains & Formula
• State files is what defines what needs to be done (logic), the extension is sls
• The configuration data parameters is what is stored in Pillar (data) –
extension is sls. This data is stored on server and provided to target
machines based on role, environment etc.
• There is another type of data item – grains. This is set on individual target machines,
some values are in built by Salt like os, cpu etc. and others can be custom built.
• State files and Pillar+Grain data together can be used to get to desired state
on target machines.
• Reusable modules/playbooks are called Formula
• Of course there are more components – but this is minimal to get going
www.vishalbiyani.com
Once more
• Pillar data is configuration data that is sent by master to
minions.
• Grains data is what minions produce and provide to
master about themselves.
www.vishalbiyani.com
(Some) Development & Debugging Techniques
• When you are developing a piece of logic for certain target (Let’s say for app-server), go to
that machine and run “sudo salt-call state.highstate” – this allowes better debugging. Yon
always add “–l debug” for much more information.
• “state.show_top” can be used to show what does the top state look like for a specific node
instead of guessing.
• In jinja files to inspect variables you can use “ {{ var_name|pprint }}” – based on type and
value of object, you will know what is going wrong. (I am not python guy – is there a better
way?)
• For watching events coming to master you can use command “salt-run state.event
pretty=True” – this will show what data is coming. What happens to event is purely visible
only in debug logs – so enable that in master/minion config.
Are there more techniques I might be missing?
Hands
on!
www.vishalbiyani.com
PEER COMMUNICATION IN SALT
www.vishalbiyani.com
Peer Communication 1/2
Use case
• A minion wants to know some details or run some command on other minions
• Communicate between minions for some event coordination
• Get information of other minions for making certain decisions
Before
• If you run publish command - it won't work out of the box, Salt by default does
not enable this:
www.vishalbiyani.com
Peer Communication 2/2
After
• You have to enable peer publishing for specific/all modules and minions to
enable peer communication. Setting change in master config file:
• The output after enabling peer communication for previous command:
Security?
• What if any minions runs destructive commands using 'cmd.run' module on other
minions?
Hands
on!
www.vishalbiyani.com
EVENT, REACTOR AND ORCHESTRATION
www.vishalbiyani.com
Event, Reactor and Orchestration
• Use case
• Events can be sent as part of workflow (Custom events), for example let’s say a
new node is up and needs to be added to load balancer config – so you can
send an event. Internally Salt uses events extensively.
• Reactor is what listens to those events and can invoke another workflow (Call a
SLS file or a formula) etc. You can filter for certain types of events, tags etc.
• Salt internal events can also be listened to and workflows initiated when an
event occurs.
• You can do everything in Reactor that you would do in a normal formula/SLS
call – so fairly complex states can be called as an reaction to certain event.
• You can also pass data with events – which can be retrieved in reactor
execution
www.vishalbiyani.com
SEND AND RECEIVE EVENT
• To send an event through an SLS file:
• To listen to an event and to decide what it should do, you need to add reactor.conf in
/etc/salt/master.d (Or inside master config file):
The tag of the event being sent
You can send data along with event and data can be dynamic as seen from some commands!
This config only tells which event to expect and what action to invoke – like a router sort of. Resides in
www.vishalbiyani.com
Processing The Event
The data is within data – hence you see data.data to get data we just passed
We are calling local state - meaning state of that minion. You can call highstate or other thin
Targeting only certain minions based on data received from event!
Passing event data to the SLS so that it can be used there to make more decusions
Hands
on!
www.vishalbiyani.com
Some learnings from reactor
• Debugging reactor is difficult - enabling debug mode on master as well
minion is your best bet
• Be careful of filters you are applying in event sending/reactor
processing and changing state of your machines. Else events will be
filtered and you will wonder what happened?
• Start with a very basic model of working reactor without any conditions
- test it and then grow it.
• Ask on Salt-Users google group - the community is helpful!
• KISS - Keep It Simple Stupid
www.vishalbiyani.com
SALT MINE
Salina Turda, Romania
(https://en.wikipedia.org/wiki/Salina_Turda) is one of most
visited Salt mine with 2M+ visitors so far!
We are going to talk about a virtual version of the same ;)
www.vishalbiyani.com
Salt Mine
• Mine is like grains – but much more real time. Grains is more or less static data about a
minion. Mine can be used for things which are expected to change over time about a
machine/instance and are provided by machine.
• Mine is also a replacement for peer publishing – remember? (Peer publishing is relatively
slow, because it has to reach all nodes and gather data. So in that sense mine is like a
already built data for certain things you need instead of running publish)
Mine functions are run
every X duration and
data is sent to Master
Master stored only
latest data of every
mine execution
A minion which needs data
about other minions can get
using mine.get with
appropriate filters etc.
www.vishalbiyani.com
Salt mine - working
Schedule at which mine functions shoud be run (Goes on minion)
Mine function definition which goes inside Pillar!
Running mine.get will give you info you need!
Hands
on!
www.vishalbiyani.com
Salt Beacon
www.vishalbiyani.com
Salt Beacons
• Salt beacon can “watch” certain things and fire events (What you can watch is limited
things like service, user login, ps etc.).
• These events can be caught by event bus and can be used to invoke reactor actions.
• Some inbuilt actions are already provided - for example clean up the PID file if the
service goes down (In case someone runs kill -9 or service dies for some reason)
• Beacon config can be done in minion config file or via Pillar (We will use pillar).
• We will only watch event - not write reactor for now (Command to watch events: sudo
salt-run state.event pretty=true )
Hands
on!
www.vishalbiyani.com
Salt Syndic & Salt Multimaster
www.vishalbiyani.com
Salt Syndic, Multimaster
• We won’t cover much code in this and next topic, mostly functional capabilities
• Multi master
• One minion can connect to multiple masters and all of them can be ‘hot’
• On all masters, keys for minions must be accepted separately
• If the setting is set to failover - then minions connect to first master that response
in list
• Syndic:
• Salt syndics are basically masters but responsible for only a part of infrastructure. That way
you can set up multiple syndics to split load.
• Syndic eventually point to a master of master and is in sync
• Both of above topologies can be mixed to achieve a highly scalable, highly available
and fault tolerant infrastructure.
www.vishalbiyani.com
Salt Cloud
www.vishalbiyani.com
Salt Cloud
• Salt cloud enables you provisions systems and bring them under Salt management
immediately.
• Roughly on config side:
• Define a provider (LIke Rackspace, AWS etc.)
• Query provider to get options of region, images etc.
• Create profiles with above information
• Use profiles to create instances and query, destroy etc
• Map files are used to create/destroy machines at scale. Map files are basically
multiple machine information combined into a cluster like definition
• You can define grains etc. when creating instances so you can manage them as per
identity.
www.vishalbiyani.com
Questions/Suggestions?
Thank you for your time and attention

More Related Content

What's hot

Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...SaltStack
 
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...SaltStack
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltStack
 
SaltConf14 - Saurabh Surana, HP Cloud - Automating operations and support wit...
SaltConf14 - Saurabh Surana, HP Cloud - Automating operations and support wit...SaltConf14 - Saurabh Surana, HP Cloud - Automating operations and support wit...
SaltConf14 - Saurabh Surana, HP Cloud - Automating operations and support wit...SaltStack
 
Salt conf 2014-installing-openstack-using-saltstack-v02
Salt conf 2014-installing-openstack-using-saltstack-v02Salt conf 2014-installing-openstack-using-saltstack-v02
Salt conf 2014-installing-openstack-using-saltstack-v02Yazz Atlas
 
SaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, FasterSaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, FasterThomas Jackson
 
Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Love Nyberg
 
SaltConf14 - Matthew Williams, Flowroute - Salt Virt for Linux contatiners an...
SaltConf14 - Matthew Williams, Flowroute - Salt Virt for Linux contatiners an...SaltConf14 - Matthew Williams, Flowroute - Salt Virt for Linux contatiners an...
SaltConf14 - Matthew Williams, Flowroute - Salt Virt for Linux contatiners an...SaltStack
 
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014Puppet
 
Writing Custom Saltstack Execution Modules
Writing Custom Saltstack Execution ModulesWriting Custom Saltstack Execution Modules
Writing Custom Saltstack Execution ModulesJulian Pacheco
 
Steve Singer - Managing PostgreSQL with Puppet @ Postgres Open
Steve Singer - Managing PostgreSQL with Puppet @ Postgres OpenSteve Singer - Managing PostgreSQL with Puppet @ Postgres Open
Steve Singer - Managing PostgreSQL with Puppet @ Postgres OpenPostgresOpen
 
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Puppet
 
Satellite 6 - Pupet Introduction
Satellite 6 - Pupet IntroductionSatellite 6 - Pupet Introduction
Satellite 6 - Pupet IntroductionMichael Lessard
 
High availability for puppet - 2016
High availability for puppet - 2016High availability for puppet - 2016
High availability for puppet - 2016Zack Smith
 
[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network TroubleshootingOpen Source Consulting
 
Cookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and ServerrspecCookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and ServerrspecDaniel Paulus
 
Foreman-and-Puppet-for-Openstack-Audo-Deployment
Foreman-and-Puppet-for-Openstack-Audo-DeploymentForeman-and-Puppet-for-Openstack-Audo-Deployment
Foreman-and-Puppet-for-Openstack-Audo-Deploymentyating yang
 
Openstack il2014 staypuft- your friendly foreman openstack installer
Openstack il2014   staypuft- your friendly foreman openstack installerOpenstack il2014   staypuft- your friendly foreman openstack installer
Openstack il2014 staypuft- your friendly foreman openstack installerArthur Berezin
 
Salt conf15 presentation-william-cannon
Salt conf15 presentation-william-cannonSalt conf15 presentation-william-cannon
Salt conf15 presentation-william-cannonWilliam Cannon
 

What's hot (20)

Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...Spot Trading - A case study in continuous delivery for mission critical finan...
Spot Trading - A case study in continuous delivery for mission critical finan...
 
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...
SaltConf14 - Ryan Lane, Wikimedia - Immediate consistency with Trebuchet Depl...
 
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability EnvironmentsSaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
SaltConf14 - Ben Cane - Using SaltStack in High Availability Environments
 
SaltConf14 - Saurabh Surana, HP Cloud - Automating operations and support wit...
SaltConf14 - Saurabh Surana, HP Cloud - Automating operations and support wit...SaltConf14 - Saurabh Surana, HP Cloud - Automating operations and support wit...
SaltConf14 - Saurabh Surana, HP Cloud - Automating operations and support wit...
 
Salt conf 2014-installing-openstack-using-saltstack-v02
Salt conf 2014-installing-openstack-using-saltstack-v02Salt conf 2014-installing-openstack-using-saltstack-v02
Salt conf 2014-installing-openstack-using-saltstack-v02
 
SaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, FasterSaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
SaltConf 2015: Salt stack at web scale: Better, Stronger, Faster
 
Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...Using SaltStack to orchestrate microservices in application containers at Sal...
Using SaltStack to orchestrate microservices in application containers at Sal...
 
SaltConf14 - Matthew Williams, Flowroute - Salt Virt for Linux contatiners an...
SaltConf14 - Matthew Williams, Flowroute - Salt Virt for Linux contatiners an...SaltConf14 - Matthew Williams, Flowroute - Salt Virt for Linux contatiners an...
SaltConf14 - Matthew Williams, Flowroute - Salt Virt for Linux contatiners an...
 
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
Puppet Availability and Performance at 100K Nodes - PuppetConf 2014
 
Deep dive networking
Deep dive networkingDeep dive networking
Deep dive networking
 
Writing Custom Saltstack Execution Modules
Writing Custom Saltstack Execution ModulesWriting Custom Saltstack Execution Modules
Writing Custom Saltstack Execution Modules
 
Steve Singer - Managing PostgreSQL with Puppet @ Postgres Open
Steve Singer - Managing PostgreSQL with Puppet @ Postgres OpenSteve Singer - Managing PostgreSQL with Puppet @ Postgres Open
Steve Singer - Managing PostgreSQL with Puppet @ Postgres Open
 
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
Performance Tuning Your Puppet Infrastructure - PuppetConf 2014
 
Satellite 6 - Pupet Introduction
Satellite 6 - Pupet IntroductionSatellite 6 - Pupet Introduction
Satellite 6 - Pupet Introduction
 
High availability for puppet - 2016
High availability for puppet - 2016High availability for puppet - 2016
High availability for puppet - 2016
 
[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting
 
Cookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and ServerrspecCookbook testing with KitcenCI and Serverrspec
Cookbook testing with KitcenCI and Serverrspec
 
Foreman-and-Puppet-for-Openstack-Audo-Deployment
Foreman-and-Puppet-for-Openstack-Audo-DeploymentForeman-and-Puppet-for-Openstack-Audo-Deployment
Foreman-and-Puppet-for-Openstack-Audo-Deployment
 
Openstack il2014 staypuft- your friendly foreman openstack installer
Openstack il2014   staypuft- your friendly foreman openstack installerOpenstack il2014   staypuft- your friendly foreman openstack installer
Openstack il2014 staypuft- your friendly foreman openstack installer
 
Salt conf15 presentation-william-cannon
Salt conf15 presentation-william-cannonSalt conf15 presentation-william-cannon
Salt conf15 presentation-william-cannon
 

Viewers also liked

Cloudlytics Reporting: Analyze Amazon CloudFront, S3 & ELB Logs - Part 2
Cloudlytics Reporting: Analyze Amazon CloudFront, S3 & ELB Logs - Part 2Cloudlytics Reporting: Analyze Amazon CloudFront, S3 & ELB Logs - Part 2
Cloudlytics Reporting: Analyze Amazon CloudFront, S3 & ELB Logs - Part 2Blazeclan Technologies Private Limited
 
[TechTalks] Effects of UI/ UX Designs on Customer Satisfaction & Loyalty
[TechTalks] Effects of UI/ UX Designs on Customer Satisfaction & Loyalty[TechTalks] Effects of UI/ UX Designs on Customer Satisfaction & Loyalty
[TechTalks] Effects of UI/ UX Designs on Customer Satisfaction & LoyaltyBlazeclan Technologies Private Limited
 

Viewers also liked (18)

Analyze Amazon CloudFront, S3 & ELB Logs with Cloudlytics - Part 1
Analyze Amazon CloudFront, S3 & ELB Logs with Cloudlytics - Part 1Analyze Amazon CloudFront, S3 & ELB Logs with Cloudlytics - Part 1
Analyze Amazon CloudFront, S3 & ELB Logs with Cloudlytics - Part 1
 
Cloudlytics Reporting: Analyze Amazon CloudFront, S3 & ELB Logs - Part 2
Cloudlytics Reporting: Analyze Amazon CloudFront, S3 & ELB Logs - Part 2Cloudlytics Reporting: Analyze Amazon CloudFront, S3 & ELB Logs - Part 2
Cloudlytics Reporting: Analyze Amazon CloudFront, S3 & ELB Logs - Part 2
 
Productive Expansion on Amazon Web Services with BlazeClan
 Productive Expansion on Amazon Web Services with BlazeClan Productive Expansion on Amazon Web Services with BlazeClan
Productive Expansion on Amazon Web Services with BlazeClan
 
Enterprise Cloud for your Business Applications
Enterprise Cloud for your Business ApplicationsEnterprise Cloud for your Business Applications
Enterprise Cloud for your Business Applications
 
Hurix case study
Hurix case study Hurix case study
Hurix case study
 
Big Data Building Blocks with AWS Cloud
Big Data Building Blocks with AWS CloudBig Data Building Blocks with AWS Cloud
Big Data Building Blocks with AWS Cloud
 
How to Design for High Availability & Scale with AWS
How to Design for High Availability & Scale with AWSHow to Design for High Availability & Scale with AWS
How to Design for High Availability & Scale with AWS
 
Architecting for Big Data with AWS
Architecting for Big Data with AWSArchitecting for Big Data with AWS
Architecting for Big Data with AWS
 
Solving Big Data problems on AWS by Rajnish Malik
Solving Big Data problems on AWS by Rajnish MalikSolving Big Data problems on AWS by Rajnish Malik
Solving Big Data problems on AWS by Rajnish Malik
 
Life of data from generation to visualization using big data
Life of data from generation to visualization using big dataLife of data from generation to visualization using big data
Life of data from generation to visualization using big data
 
Overview of AWS Services for Media Content
Overview of AWS Services for Media ContentOverview of AWS Services for Media Content
Overview of AWS Services for Media Content
 
AWS RDS Migration Tool
AWS RDS Migration Tool AWS RDS Migration Tool
AWS RDS Migration Tool
 
Micro services on AWS
Micro services on AWSMicro services on AWS
Micro services on AWS
 
Cloud stream webinar
Cloud stream webinarCloud stream webinar
Cloud stream webinar
 
Overview of AWS Services for your Enterprise
Overview of AWS Services for your Enterprise Overview of AWS Services for your Enterprise
Overview of AWS Services for your Enterprise
 
[TechTalks] Effects of UI/ UX Designs on Customer Satisfaction & Loyalty
[TechTalks] Effects of UI/ UX Designs on Customer Satisfaction & Loyalty[TechTalks] Effects of UI/ UX Designs on Customer Satisfaction & Loyalty
[TechTalks] Effects of UI/ UX Designs on Customer Satisfaction & Loyalty
 
Amazon CloudFront Complete with Blazeclan's Media Solution Stack
Amazon CloudFront Complete with Blazeclan's Media Solution StackAmazon CloudFront Complete with Blazeclan's Media Solution Stack
Amazon CloudFront Complete with Blazeclan's Media Solution Stack
 
Solving Big Data Industry Use Cases with AWS Cloud Computing
Solving Big Data Industry Use Cases with AWS Cloud ComputingSolving Big Data Industry Use Cases with AWS Cloud Computing
Solving Big Data Industry Use Cases with AWS Cloud Computing
 

Similar to [TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)

SaltStack Advanced Concepts
SaltStack Advanced ConceptsSaltStack Advanced Concepts
SaltStack Advanced ConceptsVishal Biyani
 
Rock Solid Sametime for High Availability
Rock Solid Sametime for High AvailabilityRock Solid Sametime for High Availability
Rock Solid Sametime for High AvailabilityGabriella Davis
 
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl OpenNebula Project
 
Monitoring of OpenNebula installations
Monitoring of OpenNebula installationsMonitoring of OpenNebula installations
Monitoring of OpenNebula installationsNETWAYS
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudyJohn Adams
 
Understanding salt modular sub-systems and customization
Understanding salt   modular sub-systems and customizationUnderstanding salt   modular sub-systems and customization
Understanding salt modular sub-systems and customizationjasondenning
 
Configuration Management and Salt
Configuration Management and SaltConfiguration Management and Salt
Configuration Management and Salt55020
 
Configuration management
Configuration managementConfiguration management
Configuration managementLuca De Vitis
 
OpenWest 2014-05-10 Where's the Waldo, SaltStack Proxy Minions
OpenWest 2014-05-10 Where's the Waldo, SaltStack Proxy MinionsOpenWest 2014-05-10 Where's the Waldo, SaltStack Proxy Minions
OpenWest 2014-05-10 Where's the Waldo, SaltStack Proxy Minionscroldham
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 minsSharon James
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQLKonstantin Gredeskoul
 
Headaches and Breakthroughs in Building Continuous Applications
Headaches and Breakthroughs in Building Continuous ApplicationsHeadaches and Breakthroughs in Building Continuous Applications
Headaches and Breakthroughs in Building Continuous ApplicationsDatabricks
 
Got Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckGot Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckLuis Guirigay
 
Pluk2013 bodybuilding ratheesh
Pluk2013 bodybuilding ratheeshPluk2013 bodybuilding ratheesh
Pluk2013 bodybuilding ratheeshRatheesh Kaniyala
 
Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...
Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...
Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...Landon Robinson
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterJohn Adams
 
How Percolate uses CFEngine to Manage AWS Stateless Infrastructure
How Percolate uses CFEngine to Manage AWS Stateless InfrastructureHow Percolate uses CFEngine to Manage AWS Stateless Infrastructure
How Percolate uses CFEngine to Manage AWS Stateless InfrastructurePercolate
 
Using Puppet in Small Infrastructures
Using Puppet in Small InfrastructuresUsing Puppet in Small Infrastructures
Using Puppet in Small InfrastructuresRachel Andrew
 

Similar to [TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts) (20)

SaltStack Advanced Concepts
SaltStack Advanced ConceptsSaltStack Advanced Concepts
SaltStack Advanced Concepts
 
Salt at school
Salt at schoolSalt at school
Salt at school
 
Rock Solid Sametime for High Availability
Rock Solid Sametime for High AvailabilityRock Solid Sametime for High Availability
Rock Solid Sametime for High Availability
 
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
OpenNebulaConf 2013 - Monitoring of OpenNebula installations by Florian Heigl
 
Monitoring of OpenNebula installations
Monitoring of OpenNebula installationsMonitoring of OpenNebula installations
Monitoring of OpenNebula installations
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
Understanding salt modular sub-systems and customization
Understanding salt   modular sub-systems and customizationUnderstanding salt   modular sub-systems and customization
Understanding salt modular sub-systems and customization
 
Configuration Management and Salt
Configuration Management and SaltConfiguration Management and Salt
Configuration Management and Salt
 
Configuration management
Configuration managementConfiguration management
Configuration management
 
OpenWest 2014-05-10 Where's the Waldo, SaltStack Proxy Minions
OpenWest 2014-05-10 Where's the Waldo, SaltStack Proxy MinionsOpenWest 2014-05-10 Where's the Waldo, SaltStack Proxy Minions
OpenWest 2014-05-10 Where's the Waldo, SaltStack Proxy Minions
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 mins
 
12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL12-Step Program for Scaling Web Applications on PostgreSQL
12-Step Program for Scaling Web Applications on PostgreSQL
 
Headaches and Breakthroughs in Building Continuous Applications
Headaches and Breakthroughs in Building Continuous ApplicationsHeadaches and Breakthroughs in Building Continuous Applications
Headaches and Breakthroughs in Building Continuous Applications
 
Got Problems? Let's Do a Health Check
Got Problems? Let's Do a Health CheckGot Problems? Let's Do a Health Check
Got Problems? Let's Do a Health Check
 
Pluk2013 bodybuilding ratheesh
Pluk2013 bodybuilding ratheeshPluk2013 bodybuilding ratheesh
Pluk2013 bodybuilding ratheesh
 
Fish Cam.pptx
Fish Cam.pptxFish Cam.pptx
Fish Cam.pptx
 
Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...
Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...
Spark + AI Summit 2019: Headaches and Breakthroughs in Building Continuous Ap...
 
Chirp 2010: Scaling Twitter
Chirp 2010: Scaling TwitterChirp 2010: Scaling Twitter
Chirp 2010: Scaling Twitter
 
How Percolate uses CFEngine to Manage AWS Stateless Infrastructure
How Percolate uses CFEngine to Manage AWS Stateless InfrastructureHow Percolate uses CFEngine to Manage AWS Stateless Infrastructure
How Percolate uses CFEngine to Manage AWS Stateless Infrastructure
 
Using Puppet in Small Infrastructures
Using Puppet in Small InfrastructuresUsing Puppet in Small Infrastructures
Using Puppet in Small Infrastructures
 

More from Blazeclan Technologies Private Limited

Cloudlytics: In Depth S3 & CloudFront Log Analysis - Featuring Reports
Cloudlytics: In Depth S3 & CloudFront Log Analysis - Featuring ReportsCloudlytics: In Depth S3 & CloudFront Log Analysis - Featuring Reports
Cloudlytics: In Depth S3 & CloudFront Log Analysis - Featuring ReportsBlazeclan Technologies Private Limited
 

More from Blazeclan Technologies Private Limited (12)

2020 Recap | Clan's Transformational Journey In The New Normal
2020 Recap | Clan's Transformational Journey In The New Normal2020 Recap | Clan's Transformational Journey In The New Normal
2020 Recap | Clan's Transformational Journey In The New Normal
 
Reminiscing 2019 And Heading Toward A Brighter Future!
Reminiscing 2019 And Heading Toward A Brighter Future!Reminiscing 2019 And Heading Toward A Brighter Future!
Reminiscing 2019 And Heading Toward A Brighter Future!
 
AWS Managed Services - BlazeClan Technologies
AWS Managed Services - BlazeClan TechnologiesAWS Managed Services - BlazeClan Technologies
AWS Managed Services - BlazeClan Technologies
 
Cloudlytics: In Depth S3 & CloudFront Log Analysis - Featuring Reports
Cloudlytics: In Depth S3 & CloudFront Log Analysis - Featuring ReportsCloudlytics: In Depth S3 & CloudFront Log Analysis - Featuring Reports
Cloudlytics: In Depth S3 & CloudFront Log Analysis - Featuring Reports
 
Amazon Reshift as your Data Warehouse Solution
Amazon Reshift as your Data Warehouse SolutionAmazon Reshift as your Data Warehouse Solution
Amazon Reshift as your Data Warehouse Solution
 
Testing Framework on AWS Cloud - Solution Set
Testing Framework on AWS Cloud - Solution SetTesting Framework on AWS Cloud - Solution Set
Testing Framework on AWS Cloud - Solution Set
 
Cloud for Media - A Complete Solution Stack for Faster Cloud Adoption
Cloud for Media - A Complete Solution Stack for Faster Cloud AdoptionCloud for Media - A Complete Solution Stack for Faster Cloud Adoption
Cloud for Media - A Complete Solution Stack for Faster Cloud Adoption
 
5 Points to Consider - Enterprise Road Map to AWS Cloud
5 Points to Consider  - Enterprise Road Map to AWS Cloud5 Points to Consider  - Enterprise Road Map to AWS Cloud
5 Points to Consider - Enterprise Road Map to AWS Cloud
 
How cloud is fueling growth for online gaming
How cloud is fueling growth for online gamingHow cloud is fueling growth for online gaming
How cloud is fueling growth for online gaming
 
A guide on Aws Security Token Service
A guide on Aws Security Token ServiceA guide on Aws Security Token Service
A guide on Aws Security Token Service
 
Working and Features of HTML5 and PhoneGap - An Overview
Working and Features of HTML5 and PhoneGap - An OverviewWorking and Features of HTML5 and PhoneGap - An Overview
Working and Features of HTML5 and PhoneGap - An Overview
 
Cloud Migration Strategy - IT Transformation with Cloud
Cloud Migration Strategy - IT Transformation with CloudCloud Migration Strategy - IT Transformation with Cloud
Cloud Migration Strategy - IT Transformation with Cloud
 

Recently uploaded

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceIES VE
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuidePixlogix Infotech
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....rightmanforbloodline
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governanceWSO2
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxMarkSteadman7
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Decarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational PerformanceDecarbonising Commercial Real Estate: The Role of Operational Performance
Decarbonising Commercial Real Estate: The Role of Operational Performance
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
API Governance and Monetization - The evolution of API governance
API Governance and Monetization -  The evolution of API governanceAPI Governance and Monetization -  The evolution of API governance
API Governance and Monetization - The evolution of API governance
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 

[TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)

  • 1. www.vishalbiyani.com Vishal Biyani, DevOps & Cloud Consultant [TechTalks] Learning Configuration Management with SaltStack (Advanced Concepts)
  • 2. www.vishalbiyani.com About Me Vishal Biyani is a DevOps engineer at large. In his past stints he has done Java development to operations for enterprise systems. Current interests around Go, Docker, Mesos and plenty of other stuff. Scribbles at www.vishalbiyani.com. Other interests around reading, movies and bit of photography. Latest fascination is to build a DIY Satellite and launch it.
  • 3. www.vishalbiyani.com Quick Poll • How many know anyone of Puppet, Chef, Ansible or Salt • How many know Salt? • WHat problems have you faced in Puppet/Chef/Ansible?
  • 4. www.vishalbiyani.com Agenda • Overview of Basics & some Debugging Techniques • Peer Communication in Salt • Events, Orchestration & Reactors • Mine • Beacons • Multi-master & Syndic • Basic Salt Cloud You can checkout the project at https://github.com/vishal-biyani/saltstack-cluster - this is a working Salt server+minion setup and has some of examples in today’s talk. Feel free to file bugs or send pull requests to enhance. Remind me to show some exercises when you see this balloon if I forget!
  • 5. www.vishalbiyani.com OVERVIEW OF BASICS & SOME DEBUGGING TECHNIQUES
  • 6. www.vishalbiyani.com Quick Basics • Salt is CM platform based on Python language and YAML data format. Uses ZeroMQ for scalable and fast communication across large number of nodes • Typical use cases you see like any other CM platform: • Managing OS and platform stack on number of machines • Remote execution of commands (Remove all data in /temp) • Managing configuration data • Orchestration to ensure complex use cases for infrastructure/platform • Server - Agent based (Called minion-master) though you can use it like Ansible with salt-ssh module (With some limitations)
  • 7. www.vishalbiyani.com Command Line - Remote Execution •What do you want to target – all web servers for ex.? Target • We are using test module and ping function - but there are many more Module + Command • In our case no argument - but typically there will be some arguments ArgumentsHands on!
  • 8. www.vishalbiyani.com State, Pillar, Grains & Formula • State files is what defines what needs to be done (logic), the extension is sls • The configuration data parameters is what is stored in Pillar (data) – extension is sls. This data is stored on server and provided to target machines based on role, environment etc. • There is another type of data item – grains. This is set on individual target machines, some values are in built by Salt like os, cpu etc. and others can be custom built. • State files and Pillar+Grain data together can be used to get to desired state on target machines. • Reusable modules/playbooks are called Formula • Of course there are more components – but this is minimal to get going
  • 9. www.vishalbiyani.com Once more • Pillar data is configuration data that is sent by master to minions. • Grains data is what minions produce and provide to master about themselves.
  • 10. www.vishalbiyani.com (Some) Development & Debugging Techniques • When you are developing a piece of logic for certain target (Let’s say for app-server), go to that machine and run “sudo salt-call state.highstate” – this allowes better debugging. Yon always add “–l debug” for much more information. • “state.show_top” can be used to show what does the top state look like for a specific node instead of guessing. • In jinja files to inspect variables you can use “ {{ var_name|pprint }}” – based on type and value of object, you will know what is going wrong. (I am not python guy – is there a better way?) • For watching events coming to master you can use command “salt-run state.event pretty=True” – this will show what data is coming. What happens to event is purely visible only in debug logs – so enable that in master/minion config. Are there more techniques I might be missing? Hands on!
  • 12. www.vishalbiyani.com Peer Communication 1/2 Use case • A minion wants to know some details or run some command on other minions • Communicate between minions for some event coordination • Get information of other minions for making certain decisions Before • If you run publish command - it won't work out of the box, Salt by default does not enable this:
  • 13. www.vishalbiyani.com Peer Communication 2/2 After • You have to enable peer publishing for specific/all modules and minions to enable peer communication. Setting change in master config file: • The output after enabling peer communication for previous command: Security? • What if any minions runs destructive commands using 'cmd.run' module on other minions? Hands on!
  • 15. www.vishalbiyani.com Event, Reactor and Orchestration • Use case • Events can be sent as part of workflow (Custom events), for example let’s say a new node is up and needs to be added to load balancer config – so you can send an event. Internally Salt uses events extensively. • Reactor is what listens to those events and can invoke another workflow (Call a SLS file or a formula) etc. You can filter for certain types of events, tags etc. • Salt internal events can also be listened to and workflows initiated when an event occurs. • You can do everything in Reactor that you would do in a normal formula/SLS call – so fairly complex states can be called as an reaction to certain event. • You can also pass data with events – which can be retrieved in reactor execution
  • 16. www.vishalbiyani.com SEND AND RECEIVE EVENT • To send an event through an SLS file: • To listen to an event and to decide what it should do, you need to add reactor.conf in /etc/salt/master.d (Or inside master config file): The tag of the event being sent You can send data along with event and data can be dynamic as seen from some commands! This config only tells which event to expect and what action to invoke – like a router sort of. Resides in
  • 17. www.vishalbiyani.com Processing The Event The data is within data – hence you see data.data to get data we just passed We are calling local state - meaning state of that minion. You can call highstate or other thin Targeting only certain minions based on data received from event! Passing event data to the SLS so that it can be used there to make more decusions Hands on!
  • 18. www.vishalbiyani.com Some learnings from reactor • Debugging reactor is difficult - enabling debug mode on master as well minion is your best bet • Be careful of filters you are applying in event sending/reactor processing and changing state of your machines. Else events will be filtered and you will wonder what happened? • Start with a very basic model of working reactor without any conditions - test it and then grow it. • Ask on Salt-Users google group - the community is helpful! • KISS - Keep It Simple Stupid
  • 19. www.vishalbiyani.com SALT MINE Salina Turda, Romania (https://en.wikipedia.org/wiki/Salina_Turda) is one of most visited Salt mine with 2M+ visitors so far! We are going to talk about a virtual version of the same ;)
  • 20. www.vishalbiyani.com Salt Mine • Mine is like grains – but much more real time. Grains is more or less static data about a minion. Mine can be used for things which are expected to change over time about a machine/instance and are provided by machine. • Mine is also a replacement for peer publishing – remember? (Peer publishing is relatively slow, because it has to reach all nodes and gather data. So in that sense mine is like a already built data for certain things you need instead of running publish) Mine functions are run every X duration and data is sent to Master Master stored only latest data of every mine execution A minion which needs data about other minions can get using mine.get with appropriate filters etc.
  • 21. www.vishalbiyani.com Salt mine - working Schedule at which mine functions shoud be run (Goes on minion) Mine function definition which goes inside Pillar! Running mine.get will give you info you need! Hands on!
  • 23. www.vishalbiyani.com Salt Beacons • Salt beacon can “watch” certain things and fire events (What you can watch is limited things like service, user login, ps etc.). • These events can be caught by event bus and can be used to invoke reactor actions. • Some inbuilt actions are already provided - for example clean up the PID file if the service goes down (In case someone runs kill -9 or service dies for some reason) • Beacon config can be done in minion config file or via Pillar (We will use pillar). • We will only watch event - not write reactor for now (Command to watch events: sudo salt-run state.event pretty=true ) Hands on!
  • 25. www.vishalbiyani.com Salt Syndic, Multimaster • We won’t cover much code in this and next topic, mostly functional capabilities • Multi master • One minion can connect to multiple masters and all of them can be ‘hot’ • On all masters, keys for minions must be accepted separately • If the setting is set to failover - then minions connect to first master that response in list • Syndic: • Salt syndics are basically masters but responsible for only a part of infrastructure. That way you can set up multiple syndics to split load. • Syndic eventually point to a master of master and is in sync • Both of above topologies can be mixed to achieve a highly scalable, highly available and fault tolerant infrastructure.
  • 27. www.vishalbiyani.com Salt Cloud • Salt cloud enables you provisions systems and bring them under Salt management immediately. • Roughly on config side: • Define a provider (LIke Rackspace, AWS etc.) • Query provider to get options of region, images etc. • Create profiles with above information • Use profiles to create instances and query, destroy etc • Map files are used to create/destroy machines at scale. Map files are basically multiple machine information combined into a cluster like definition • You can define grains etc. when creating instances so you can manage them as per identity.