Table of contents
1.
Introduction
2.
Salt System Architecture
2.1.
Masters and Minions
2.2.
Event Bus
2.3.
Targets and Grains
2.4.
Runners and Reactors
3.
Frequently Asked Questions
3.1.
What is a Salt Master?
3.2.
What is a Minion?
3.3.
What is ZeroMQ in SaltStack?
4.
Conclusion
Last Updated: Mar 27, 2024
Easy

Salt System Architecture

Author Nidhi Kumari
1 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

A system architecture is a model showing various components' functionality, mapping and user interaction. One can use it to assist in designing a composite system. A system architecture involves hardware and software components.

SALT System Architecture

 In this article, we will cover Salt System Architecture, the components of System Architecture in detail and the states of the Salt System Architecture.

Salt System Architecture

Any number of servers, even those in local network systems and other deployments distributed across many data centres, can operate with SaltStack's architecture. A Salt master issues command to a Salt client, who then carries them out. This is known as the master-client model.

The following diagram shows the Salt System Architecture:

SALT System Architecture

We will discuss each component in detail.

Masters and Minions

The Salt Master is a server that manages the salt-master service in the Salt system. It sends instructions to one or more Salt Minions. Minions are also servers that are registered with that specific Salt Master and are used to conduct the salt-minion service.

Salt can also be viewed as a publisher-subscriber model. Salt Minions subscribe to the jobs that the master publishes and that needs to be done. It will carry out a specific job when it applies to that minion.

Master and Minions

A minion returns the job result to the master after completing its assigned task. For the minions to connect with their master by default, Salt uses two ports. The main task of these two ports is to receive and send data to the Message Bus. ZeroMQ is the networking layer of Salt or  Salt's message bus. It builds an asynchronous network topology to provide the quickest communication possible.

Event Bus

The Salt Master and Salt Minions communicate using the event system. The main uses of event systems are as follows:

  • Both the master and the minions are aware of events.
     
  • Both can keep a close watch on events and analyse them.
     

The features of event systems are as follows:

  • Real-time Monitoring.
     
  • Pluggable System.
     
  • Flexible Transport Layer using ZeroMQ.
     
  • Complete TCP-based transport layer using Tornado.
     
  • Efficient.

 

Targets and Grains

By defining a target, the master tells the minions which should perform the task. A target is the collection of minions under the control of one or more masters to which a job's Salt command is applied.

Grains are defined as shared system features or other custom attributes. Although grains can be defined in various methods, they are always derived from or defined on the minion. Some examples of grains are as follows:

  • OS type.
     
  • Domain name.
     
  • IP address.
     
  • Kernel.
     
  • Memory.
     

These traits are used to target the minions by the Master Server.

The master can target the minions in various ways:

  • Using the command.
     
  • Using the specific IDs.
     
  • Using the shared traits(grains).
     

The following is an example of one of the many different types of orders that a master may give to a minion using commands.

salt -v '*' pkg.install <app_name> 

 

Here, the glob( '*') is the target.

Runners and Reactors

The salt-run command executes convenience programmes known as salt runners. Salt execution modules and Salt runners both function similarly. Instead of the Salt Minions, they execute the Salt Master. A Salt runner can be a basic client call or a complex programme.

Reactors can be used in various situations, such as

  • The Scalability of the infrastructure.
     
  • Automatic Rollback.
     
  • Administrator notification.
     
  • Restarting unsuccessful programs.
     

Salt can start actions in reaction to an event thanks to its Reactor mechanism. It provides a simple interface for monitoring Salt's system event bus for event tags that fit a specified pattern and executing one or more actions. This system links SLS files to event tags on the master.

SLS files stand for Salt State files. The SLS is designed to contain all information in a simple format and depicts the state in which a system should be. You can specify how your systems should function using these files, including the installed and active apps and services.

Frequently Asked Questions

What is a Salt Master?

The core idea of Salt is that of a Master who commands one or more Minions. The Master is the Central Management System. Executed on managed systems, the Salt minion communicates with Salt Master via instructions and configurations. Linux is the default operating system for the Salt Master, although any other system can be a minion.

What is a Minion?

Your servers, which power your apps and services, are called salt minions. These are the managed systems that respond to commands from Salt Master. The Salt master can target commands to particular minions by using the ID assigned to each minion.

What is ZeroMQ in SaltStack?

Within Salt, ZeroMQ is now the default transport. A messaging library called ZeroMQ has bindings for many different languages. To pass messages, ZeroMQ implements a socket interface with unique semantics. Additionally, it offers a set of patterns, like request-reply and publish-subscribe, to help you build and organise your network.

Conclusion

We ran through the introduction of the System architecture of the SALTStack. We started our discussion with an overview of the system. Further, we discussed the components in detail. 

We hope this blog has helped you. We recommend you visit our articles on different SALT topics, such as

🔥 Configuration of SALT Proxy Minions.

🔥 Job Cache in SALT.

🔥 Addressing Modes of 8086

🔥 Spring Boot Architecture

If you liked our article, do upvote our article and help other ninjas grow.  You can refer to our Guided Path on Coding Ninjas Studio to upskill yourself in Data Structures and AlgorithmsCompetitive ProgrammingSystem Design, and many more!

Head over to our practice platform Coding Ninjas Studio to practice top problems, attempt mock tests, read interview experiences and interview bundles, follow guided paths for placement preparations, and much more!!

Happy Reading!!

Live masterclass