Request for change to allow the mine data to work with syndics via a pluggable data store (aka mysql, redis, etc)
The basic issue is that the data is only stored on the master that the minion is attached to. So if you have the following design, you will get different answers based on the master (or syndic) you run the mine.get against. The data will not be replicated to the other syndics or the master of masters. What we would like is something that makes the mine data store pluggable. We currently us rsync to replicate the data to all the syndics and the master of masters, we also have to replicate the minion public keys to as the mine.get will only return data for minions that master knows about. This is prone to failures and doesn’t scale well when you have 10’s of syndic pairs with 1000’s of minions.
Master of Masters
/ \
/ \
/ \
/ \
Syndic A1 <--> Syndic A2 Syndic B1 <--> Syndic B2
Thanks for filing this. This does look like a pretty good solution, we'll investigate making the store pluggable.
@sejeff @jdconti
The solution here is to add pluggable support for the minion data cache system. This will allow for the minion data cache and the mine (which are stored in the same system on the master) to use this. it should be something we can plug into the returner system by just adding 2-3 functions to the returner definition.
@thatch45 that would be perfect. This would be a HUGE deal for our use case.
Thanks!
as @junster1 mentioned, the workaround here is (unfortunately) rsync. if anyones curious, the two directories you need to duplicate ONEWAY from syndic to master master are: (keys and cache) /etc/salt/pki/master/minions/* /var/cache/salt/master/minions/*
additionally, the syndic's minions wont be able to use your syndic's own mine data unless its rsync'd back from master master. If you need this, you'll have to sync ONLY the syndic pubkey and mine data from master master -> syndic:
/etc/salt/pki/master/minions/
with these two fixes in place, i've achieved (mostly) dynamic pillars.
Our solution was simply to rip out the mine and write a module / state which uses a shared mysql cluster, but we'd still like to see this be made extensible for the future.
+1
+1
+1
If the backend data store allows auth, maybe we can synch the crypto keys too?
its worth also considering (as mentioned my my post above) that the syndics minions also cant access the syndic's mine data, if registered upstream with the master master... eg: asking for syndic mine data from master master works:
salt 'mastermaster*' mine.get 'mysyndic*' grains.items
asking for syndic mine data from the syndics minions fails:
salt 'mysyndicsminion*' mine.get 'mysyndic*' grains.items
the solution may be to register the syndic minion with the syndic master... (rather than upstream). not sure if there are any shortcomings to this idea...
@cachedout @thatch45 you guys need to talk about this next sprint
ZD-798
ZD-843
I havent really figured out, how this contribution fixes the issue. Is there a documentation how to use this cache module? I also need to mine from minions to other minions across syndics.
@fr6nco the external data cache allows to keep the cached minion data inside an external data storage like consul, etcd or mysql. To use this set minion_data_cache to True and configure one of the cache modules as described in the docs.
sorry for reloading an old issue but even using an external data storage (redis) I can't get mines from minions under syndic. My structure is:
3 master of masters
1 syndic under 3 masters of masters
3 minions under 1 syndic
Masters and syndic are using MINION_DATA_CACHE with the same redis.
salt-run mine.get '*' my_mine in the master of masters returns mines only for syndic, just like salt 'syndic' mine.get '*' my_mine. Inside the syndic I can get mines for minions, but this is not useful in my case.
Exists another option to get this mines from master to minions under syndic?