• LOGIN
  • No products in the cart.

Saltstack Tutorial

INTRODUCTION

Salt, or SaltStack, is a remote execution device and configuration management system. The remote execution abilities permit administrators to run instructions on a range of machines in parallel with a flexible targeting system. The configuration management performance establishes a client-server model to quickly, easily, and securely deliver infrastructure factors in line with a given policy.

AGENDA

USE OF SALTSTACK

FEATURES

ARCHITECTURE

PLATFORMS

SALT COMMANDS

TERMINOLOGY

BENEFITS OF SALTSTACK

WHY SALTSTACK?

SaltStack Architecture is developed for offering speed and scale. This is the reason why this architecture is used for managing the thousands of servers at Google, LinkedIn, and many more companies.

For instance – If a person has thousands of servers and user needs to perform functions on each server. A consumer would be required to log in to every server and operate function one at a time. This system will be very complex and time-consuming as features like software set up and configuration primarily based on specific standards may also consume a lot of time.

To overcome this problem, SaltStack Architecture has been added as one can perform one of a kind functions just by using typing one command. Thus, SaltStack is a single solution to overcome all such issues.

FEATURES OF SALTSTACK

SaltStack supports many beneficial elements that had been not existing in the past used Configuration management tools. Some of the vital SaltStack elements mentioned below:

  • Fault tolerance

Salt Minions are capable to connect to more than one masters at a specific moment by means of the configuration of master configuration parameters as all the accessible master’s YAML list. Every master is allowed to provide instructions to the Salt infrastructure.

  • Flexible

Saltstack helps a very flexible management approach. The method can be deployed for following the popular system management models like Agent only, Server only, Agent and Server, or all of them within a similar environment.

  • Scalable Configuration Management

With the help of Saltstack, one can efficiently manage thousands of minions per master.

  • Parallel Execution model

The parallel execution model of Saltstack allows the commands to parallel execute the remote systems.

satlstack training

  • Python API

SaltStack helps the simple programming interface. It is without problems extensible and modular thus, it is convenient to mold to the unique applications.

  • Easy to Set Up

SaltStack is very convenient to set up. The single remote execution architecture provided by means of Saltstack permit to effectively control the one-of-a-kind requirements of the different servers.

  • Language Agnostic

Saltstack templating engines, file type, or configuration files support the different sorts of languages.

ARCHITECTURE

The SaltStack Architecture is designed to work effectively with numerous servers- ranging from the Local Network systems to the deployment made over the various data centers. SaltStack Architecture is essentially a Server/Client model having required functionalities that are constructed into the single set processes.

Saltstack architecture

  • Roles

To understand how saltstack works, analyze the machine roles and understand it, it helps to understand more about the how-to query data about minion and how to use salt modules.

  • Master

Salt master is the machine/node that controls the entire infrastructure and triggers the policies for the servers it manages. It operates both as a repository for configuration information and as the control center that initiates remote commands and ensures the state of your other machines.

While it is possible to manage infrastructure the use of a masterless configuration, most setups gain from the advanced elements available in the Salt master.

Also it can function in a tiered master configuration where commands can be relayed via lower master machines.

  • Minions

The servers that Salt (manager) manages are referred to as minions. The minion is responsible for executing the guidelines sent through the master, reporting on the success of jobs, and presenting data about the underlying host.

PLATFORMS

Following is a listing of all the platforms that assist SaltStack and its competitors.

SaltStack − SaltStack software program runs on and manages many versions of Linux, Windows, Mac OS X and UNIX.

  1. Puppet − Red Hat Enterprise Linux, CentOS, Oracle Linux, Scientific Linux, SUSE Linux Enterprise Server and Ubuntu.

  • Chef − Chef is supported on more than one platforms such as AIX, RHEL/CentOS, FreeBSD, OS X, Solaris, Microsoft Windows and Ubuntu.

  • Ansible − Fedora distribution of Linux, CentOS, and Scientific Linux through Extra Packages for Enterprise Linux (EPEL) as well as for other working systems.

SALT COMMANDS

Salt presents a wide variety of instructions to take benefit of the factors outlined above. There is some significant crossover in terms of performance between these tools, however, we’ve attempted to highlight their fundamental features below.

salt-master: This is the master daemon process. You can begin the master service with this command directly, or more typically, via an init script or service file.

salt-minion: Likewise, this is minion daemon process, used to communicate with the master and execute commands. Most customers will additionally begin this from init scripts or service files.

salt-key: This tool is used to control minion public keys. This tool is used to view current keys and to make selections about public keys sent through prospective minions. It can additionally generate keys to place on minions out-of-band.

salt: This command is used to target minions in order to run ad-hoc execution modules. This is the predominant device used for remote execution.

salt-ssh: This command approves you to use SSH as a choice to ZeroMQ for the transport mechanism.

salt-run: This command is used to run runner modules on the master server.

salt-call: This command is used to run execution modules directly on a minion you are logged into. This is often used to debug troublesome commands by using bypassing the master.

salt-cloud: This command is used to manage and provision cloud resources from many distinct providers. New minions can easily be spun up and bootstrapped.

There are some other commands as well, like salt-api, salt-cp, and salt-syndic, which aren’t used pretty so often.

TERMINOLOGY

 Salt has many powerful features, however, it can be hard to suit names with their functionality at first.

execution modules – ad hoc commands

grains – static data about minions

pillar – secure user-defined variables stored on master and assigned to minions (equivalent to data baggage in Chef or Hiera in Puppet)

Saltstack

formulas (states) – illustration of a device configuration, a grouping of one or more state files, perhaps with pillar data and configuration documents or anything else which defines a neat package for a unique application.

mine – are on the master where outcomes from minion executed commands can be stored, such as the IP address of a backend web server, which can then be used to configure a load balancer

top file – matches formulation and pillar facts to minions

runners – modules carried out on the master

returners – elements that inject minion data to some other system

renderers – components that run the template to produce the valid state of configuration files. The default renderer uses Jinja2 syntax and outputs YAML files.

reactor – a component that triggers reactions on events

thorium – a new variety of reactor, which is still experimental.

beacons – a little piece of code on the minion that listens for activities such as server failure or file changes. When it registers one of these events, it informs the master. Reactors are frequently used to do self-healing.

proxy minions – aspects that translate Salt Language to system precise instructions in order to deliver the system to the favored state the usage of its API, or over SSH.

salt cloud – command to bootstrap cloud nodes

salt ssh – command to run instructions on systems except minions

BENEFITS OF SALTSTACK

There are a number of advantages of the usage of the SaltStack, and they are cited below:

  • Robust: Saltstack is a simple, powerful, strong configuration management framework that can work successfully with lots of systems concurrently without hassle.

  • Authentication: SaltStack helps secure authentication. It makes use of the Secure Shell protocol for authentication purposes.

  • Secure: It maintains facts security through the usage of encrypted protocols.
  • Fast: Saltstack is a very lightweight, fast communication bus which is a base for the remote execution engines.

  • Virtual Machine Automation: Saltstack makes use of Virtual Could Controller abilities for the virtual machine automation.

  • Infrastructure as data, not code: Saltstack offers model-driven configuration management, simple deployment, and commands execution framework.

June 12, 2020
GoLogica Technologies Private Limited. All rights reserved 2024.