In the Salt system there are grains and pillars. I understand how I can assign custom grains, but when would it be better to consider using pillars?
Pillars are tree-like structures of data defined on the Salt Master and passed through to minions. They allow confidential, targeted data to be securely sent only to the relevant minion.
Append a value to a list in the grains config file. If the grain doesn't exist, the grain key is added and the value is appended to the new grain as a list item. If convert is True, convert non-list contents into a list. If convert is False and the grain contains non-list contents, an error is given.
Salt minions are your servers that actually run your applications and services. Each minion has an ID assigned to it (which can be automatically generated from the minion's hostname), and the Salt master can refer to this ID to target commands to specific minions. Note.
In Salt, grains are used for immutable aspects of your minion, such as the cpu, memory, location, time zone, etc.
A pillar is a list of data on the master (in SLS format) that you need to distribute to your minions. Pillar allows you to set variables that the minions can access, for example a database configuration option.
In short, custom static Grains is likely worse alternative than Pillars.
| Differences | Grains | Pillars | |------------------------------|-------------------------------|-------------------------------------| | This is info which... | ... Minion knows about itself | ... Minion asks Master about | | | | | | Distributed: | Yes (different per minion) | No (single version per master) | | Centralized: | No | Yes | | | | | | Computed automatically: | Yes (preset/computed value) | No (only rendered from Jinja/YAML) | | Assigned manually: | No (too elaborate) | Yes (Jinja/YAML sources) | | | | | | Conceptually intrinsic to... | ... individual Minion node | ... entire system managed by Master | | Data under revision control: | No (computed values) | Yes (Jinja/YAML sources) | | | | | | They define rather... | _provided_ resources | _required_ resources | | | (e.g. minion OS version) | (e.g. packages to install) | | | | |
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With