Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Saltpad: A saltstack Web GUI

410e3353165c33043ab69be7fc366428?s=47 Boris Feld
February 02, 2016

Saltpad: A saltstack Web GUI

Presentation of SaltPad, a modern web User Interface for Saltstack. Saltstack is a great configuration management tool, but not very accessible for newcomers and non "Configuration Management" experts. SaltPad aims to fill the gap by offering a clean, simple interface to manage the different aspects of Salt, making it ​easier​ to start​ with SaltStack and ​manage​ your SaltStack cluster day after day. If offers a nice reporting view for jobs, especially for highstate jobs; ​helps​ you ​launch​ jobs and define predefined jobs, that can be launched with a single button; and finally, a dashboard for a global ​view​ of your cluster. SaltPad is a great tool to help empower people to be autonomous on deployment and have visibility on the stack and deployment formulas. At first developed​ with a classical Python Stack, SaltPad has been rewritten as a Single App Page with React. Its combination with the websocket interface of salt-api, simplifies​ the implementation and adds the niceties of a reactive interface.

410e3353165c33043ab69be7fc366428?s=128

Boris Feld

February 02, 2016
Tweet

Transcript

  1. SALTPAD: A WEB GUI FELD Boris - @cfgmgmtcamp

  2. ABOUT ME • Python Dev / sqreen.io • DevOps •

    lothiraldan
  3. WHY A WEB GUI?

  4. ❤ SALTSTACK

  5. SALT -V ‘*’ PKG.INSTALL OPENSSL —REFRESH=TRUE

  6. SALT -V ‘*’ TEST.VERSION

  7. SALT-CLOUD -M MAPFILE

  8. DISLIKE SALTSTACK

  9. ONE OR MORE REQUISITE ERROR ?

  10. WHERE IS IT ?

  11. HO IT’S HERE

  12. DEV&OPS FRIENDLY • CLI is efficient, but… • Not QA

    / Frontend Dev / Backend dev friendly
  13. OBJECTIVES • Improve the UX • Decrease the time needed

  14. HIGHSTATE OUTPUT

  15. DO WE NEED TO DISPLAY ALL OUTPUT?

  16. SUCCESS ID: working_file Function: file.managed Name: /etc/working_file Result: True Comment:

    File /etc/working_file is in the correct state Started: 11:12:00.785722 Duration: 3.396 ms Changes:
  17. SUCCESS ID: working_file Function: file.managed Name: /etc/working_file Result: True Comment:

    File /etc/working_file is in the correct state Started: 11:12:00.785722 Duration: 3.396 ms Changes: NOISE ✖
  18. CHANGES ID: changing_file Function: file.managed Name: /etc/changing_file Result: True Comment:

    File /etc/changing_file updated Started: 11:12:00.789479 Duration: 3.244 ms Changes: ---------- diff: <show_diff=False>
  19. CHANGES ID: changing_file Function: file.managed Name: /etc/changing_file Result: True Comment:

    File /etc/changing_file updated Started: 11:12:00.789479 Duration: 3.244 ms Changes: ---------- diff: <show_diff=False> SMALL SIGNAL ✔
  20. ERRORS ID: bad_file Function: file.managed Name: /etc/badfile Result: False Comment:

    User inexistant is not available Started: 11:12:00.802779 Duration: 1.809 ms Changes:
  21. ERRORS ID: bad_file Function: file.managed Name: /etc/badfile Result: False Comment:

    User inexistant is not available Started: 11:12:00.802779 Duration: 1.809 ms Changes: HUGE SIGNAL ✔
  22. REQUISITE ERROR ID: dependency_file Function: file.managed Name: /etc/dependency_file Result: False

    Comment: One or more requisite failed: sample.bad_file Started: Duration: Changes:
  23. REQUISITE ERROR ID: dependency_file Function: file.managed Name: /etc/dependency_file Result: False

    Comment: One or more requisite failed: sample.bad_file Started: Duration: Changes: NOISE ✖
  24. SALTPAD V1

  25. SALTPAD V1

  26. SALTPAD V1 • Classic web interface • Python / Flask

    which request salt-api and render html
  27. ARCHITECTURE

  28. FEEDBACK • Used every day by at least one company

    • Small but nice feedback from community • ~60 issues
  29. USAGE • ~ 60 minions • Deployment every day •

    ~ 10 000 jobs
  30. BEYOND HIGHSTATE OUTPUT • Generic job output • Minion keys

    management • Job launching • Job templates
  31. ISSUES

  32. IT’S PYTHON ! • Compatibility asked with python 2.6 •

    What about python 3 • Windows compatibility • Bug with six module • Bug with werkzeug
  33. IT’S WSGI! • Difficult to configure. • Requires to configure

    gunicorn + nginx or apache + ssl. • Not easy when it’s your job, so when it’s not your job…
  34. NO DB! • Use directly the salt-api • No DB

    to configure • Stored templates in salt-master configuration
  35. REQUEST / RESPONSE BASED • Lack of responsiveness due to

    the traditional request / response design. • Community asked for better UX • Launch a job and stay on the launch page • Have the jobs update their result in near real-time • Requires more JS
  36. IT’S SLOW • Some (most) pages end up in timeout

    because of salt-api requests • Ends up with « working » pages and « not working » pages.
  37. A BETTER WAY

  38. SALT DIRTY LITTLE SECRET

  39. IT’S EVENT BASED!

  40. SALT EVENTS • Each event is shared through an event-bus

    • You can plug reactors (code to respond to events) • See the real-time events across the infrastructure (salt-run state.event pretty=True) • Exposed via salt-api
  41. SALTPAD V2 • Use events forwarded by web socket endpoint!

  42. NEW ARCHITECTURE

  43. NEW ARCHITECTURE • Developed as a Single App Page with

    React. • Listen to the event endpoint and update the view.
  44. SALTPAD V2

  45. REACT FTW • React architecture make it easy to create

    a real- time application. • Receive an event through the event endpoint. • Parse the event and update the global state. • Re-render all the view!
  46. EASIER INSTALL • Drop the archive • Create the settings

    file • Configure your web server
  47. BETTER UX • See the status of your last jobs

    while checking something else • Mark jobs to retrieve them later
  48. PROBLEMS • Not compatible yet with 2015.8.3 :( • People

    don’t read README • Still ALPHA!
  49. JOB MASTER CACHE • Salt store job output on disk

    by default • Easy to saturate, df -h / df -i • Use alternate job master cache like Postgresql
  50. FEATURES

  51. DEMO

  52. CULTURAL IMPACT

  53. ONE CLICK DEPLOYMENT

  54. CLEAN OUTPUT

  55. HTTPS://SALT/JOB_RESULT/ 20160127081900219150 Job result URL

  56. JOB LAUNCHING DOC

  57. OTHER UI • Molten: https://github.com/martinhoefling/molten • Foreman: https://github.com/theforeman/ foreman_salt •

    Halite: https://github.com/saltstack/halite [Deprecated]
  58. WHAT NEXT? • Permissions / Groups • Minions keys management

    • Better data viz of job result • Leverage group for topology viz • Need for much more
  59. WHAT IS YOUR NEEDS?

  60. HELP IMPROVE DX • Developer Experience is important! • Experiment

    and innovate! • Ideas: • Saltstack linter • Saltstack interactive tutorial in the browser • …
  61. I NEED YOUR FEEDBACK!

  62. THANK YOU Questions ? lothiraldan tinyclues/saltpad sqreen.io