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

Saltpad: A saltstack Web GUI

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.

Boris Feld

February 02, 2016
Tweet

More Decks by Boris Feld

Other Decks in Programming

Transcript

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

    View full-size slide

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

    View full-size slide

  3. WHY A WEB GUI?

    View full-size slide

  4. ❤ SALTSTACK

    View full-size slide

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

    View full-size slide

  6. SALT -V ‘*’
    TEST.VERSION

    View full-size slide

  7. SALT-CLOUD -M MAPFILE

    View full-size slide

  8. DISLIKE SALTSTACK

    View full-size slide

  9. ONE OR MORE REQUISITE ERROR ?

    View full-size slide

  10. WHERE IS IT ?

    View full-size slide

  11. HO IT’S HERE

    View full-size slide

  12. DEV&OPS FRIENDLY
    • CLI is efficient, but…
    • Not QA / Frontend Dev / Backend dev friendly

    View full-size slide

  13. OBJECTIVES
    • Improve the UX
    • Decrease the time needed

    View full-size slide

  14. HIGHSTATE OUTPUT

    View full-size slide

  15. DO WE NEED TO DISPLAY ALL
    OUTPUT?

    View full-size slide

  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:

    View full-size slide

  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 ✖

    View full-size slide

  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:

    View full-size slide

  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:

    SMALL SIGNAL ✔

    View full-size slide

  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:

    View full-size slide

  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 ✔

    View full-size slide

  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:

    View full-size slide

  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 ✖

    View full-size slide

  24. SALTPAD V1
    • Classic web interface
    • Python / Flask which request salt-api and render
    html

    View full-size slide

  25. ARCHITECTURE

    View full-size slide

  26. FEEDBACK
    • Used every day by at least one company
    • Small but nice feedback from community
    • ~60 issues

    View full-size slide

  27. USAGE
    • ~ 60 minions
    • Deployment every day
    • ~ 10 000 jobs

    View full-size slide

  28. BEYOND HIGHSTATE OUTPUT
    • Generic job output
    • Minion keys management
    • Job launching
    • Job templates

    View full-size slide

  29. IT’S PYTHON !
    • Compatibility asked with python 2.6
    • What about python 3
    • Windows compatibility
    • Bug with six module
    • Bug with werkzeug

    View full-size slide

  30. 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…

    View full-size slide

  31. NO DB!
    • Use directly the salt-api
    • No DB to configure
    • Stored templates in salt-master configuration

    View full-size slide

  32. 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

    View full-size slide

  33. IT’S SLOW
    • Some (most) pages end up in timeout because of
    salt-api requests
    • Ends up with « working » pages and « not
    working » pages.

    View full-size slide

  34. A BETTER WAY

    View full-size slide

  35. SALT DIRTY LITTLE SECRET

    View full-size slide

  36. IT’S EVENT BASED!

    View full-size slide

  37. 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

    View full-size slide

  38. SALTPAD V2
    • Use events forwarded by web socket endpoint!

    View full-size slide

  39. NEW ARCHITECTURE

    View full-size slide

  40. NEW ARCHITECTURE
    • Developed as a Single App Page with React.
    • Listen to the event endpoint and update the view.

    View full-size slide

  41. 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!

    View full-size slide

  42. EASIER INSTALL
    • Drop the archive
    • Create the settings file
    • Configure your web server

    View full-size slide

  43. BETTER UX
    • See the status of your last jobs while checking
    something else
    • Mark jobs to retrieve them later

    View full-size slide

  44. PROBLEMS
    • Not compatible yet with 2015.8.3 :(
    • People don’t read README
    • Still ALPHA!

    View full-size slide

  45. 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

    View full-size slide

  46. CULTURAL IMPACT

    View full-size slide

  47. ONE CLICK DEPLOYMENT

    View full-size slide

  48. CLEAN OUTPUT

    View full-size slide

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

    View full-size slide

  50. JOB LAUNCHING DOC

    View full-size slide

  51. OTHER UI
    • Molten: https://github.com/martinhoefling/molten
    • Foreman: https://github.com/theforeman/
    foreman_salt
    • Halite: https://github.com/saltstack/halite
    [Deprecated]

    View full-size slide

  52. WHAT NEXT?
    • Permissions / Groups
    • Minions keys management
    • Better data viz of job result
    • Leverage group for topology viz
    • Need for much more

    View full-size slide

  53. WHAT IS YOUR NEEDS?

    View full-size slide

  54. HELP IMPROVE DX
    • Developer Experience is important!
    • Experiment and innovate!
    • Ideas:
    • Saltstack linter
    • Saltstack interactive tutorial in the browser
    • …

    View full-size slide

  55. I NEED YOUR FEEDBACK!

    View full-size slide

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

    View full-size slide