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

Deployment Automation and Orchestration with SaltStack

Deployment Automation and Orchestration with SaltStack

Salt is way more than a configuration management tool. It supports many types of other activities such as remote execution and full-blown system orchestration. It can be used as a replacement for remote task tools such as Fabric or Paver.

Six Feet Up CTO Calvin Hendryx-Parker will look at how you can configure your own Salt Master and give it REST API capabilities. He’ll explain how you can respond to events on the Salt event system to trigger actions in the infrastructure. He will also look at how you can setup simple orchestrations to automate common tasks such as backing up databases before you release your application.

4d1fa184d439599ed301821daec94063?s=128

Calvin Hendryx-Parker

May 05, 2020
Tweet

Transcript

  1. DEPLOYMENT AUTOMATION AND DEPLOYMENT AUTOMATION AND ORCHESTRATION ORCHESTRATION WITH SALTSTACK

    WITH SALTSTACK CALVIN HENDRYX-PARKER, CTO CALVIN HENDRYX-PARKER, CTO SIX FEET UP SIX FEET UP
  2. DEPLOYMENT AUTOMATION AND DEPLOYMENT AUTOMATION AND ORCHESTRATION WITH SALTSTACK ORCHESTRATION

    WITH SALTSTACK WHAT IS THE END GOAL? WHAT IS THE END GOAL? » Reliable » Consistent » Repeatable » Scalable » (and preferably as automated as possible)
  3. WHAT SETS SALT APART? WHAT SETS SALT APART? » Remote

    Execution » Event-Driven Orchestration » Agent or Agent-less Operation » Cloud Provisioning » Speed and Scalability
  4. SALT TERMINOLOGY SALT TERMINOLOGY » States » Pillars » Reactors

    » Mines » Events » Beacons » Engines
  5. SALT INSTALLATION SALT INSTALLATION » Bootstrap – » Docker –

    » Package Management careful old packages https://github.com/saltstack/salt-bootstrap https://hub.docker.com/r/saltstack/salt
  6. SALT ARCHITECTURE SALT ARCHITECTURE

  7. FOLLOW ALONG FOLLOW ALONG http://github.com/calvinhp/salt-orchestation-demo

  8. SALT CLI AND REMOTE EXECUTION SALT CLI AND REMOTE EXECUTION

    Demo using the CLI
  9. INTRO TO SALT STATES INTRO TO SALT STATES

  10. DEPENDENCY MANAGEMENT IN SALT DEPENDENCY MANAGEMENT IN SALT » Requisite

    System » Great for Con guration Management
  11. JINJA TEMPLATES WITH SALT JINJA TEMPLATES WITH SALT

  12. MINION SPECIFIC DATA WITH PILLAR MINION SPECIFIC DATA WITH PILLAR

  13. INTRO TO ORCHESTRATION AND INTRO TO ORCHESTRATION AND RUNNERS RUNNERS

  14. JOB MANAGEMENT JOB MANAGEMENT » External and Master Job Caches

  15. ACTIVE JOBS ACTIVE JOBS vagrant@salt:~$ sudo salt-run jobs.active 20200505044728157234: ----------

    Arguments: Function: state.highstate Returned: Running: |_ ---------- app1: 13619 StartTime: 2020, May 05 04:47:28.157234 Target: salt-call Target-type:
  16. SCHEDULED TASKS IN SALT SCHEDULED TASKS IN SALT schedule: dev-db-pack:

    function: state.orchestrate args: - orch.dev-db-pack cron: '0 2 * * 0' dev-db-backup: function: state.orchestrate args: - orch.dev-db-backup cron: '0 23 * * *' prod-db-pack: function: state.orchestrate args: - orch.prod-db-pack cron: '0 2 * * 0' prod-db-backup:
  17. ALTERNATE SCHEDULE FORMAT ALTERNATE SCHEDULE FORMAT schedule: dev-backups: function: state.orchestrate

    args: - orch.dev-db-backup when: - Monday 4:00am - Tuesday 4:00am - Wednesday 4:00am - Thursday 4:00am - Thursday 9:00pm - Friday 4:00am - Saturday 4:00am - Sunday 4:00am
  18. RETURNERS RETURNERS » Elasticsearch » RDBMS

  19. USING DEPENDENCIES WITH USING DEPENDENCIES WITH ORCHESTRATION ORCHESTRATION » True

    master control » Orchestrate from above » Cross minion dependencies
  20. REQUISITES IN ORCHESTRATIONS REQUISITES IN ORCHESTRATIONS Environment passed in as

    pillar: test.check_pillar: - present: - envname {% set envname = salt['pillar.get']('envname', 'MISSING ENVNAME') %} Current {{ envname }} Supervisor Status: salt.function: - name: supervisord.status - tgt: {{ envname }}plone0* - require: - test: Environment passed in as pillar
  21. USE REACTORS TO ORCHESTRATE USE REACTORS TO ORCHESTRATE » Salt

    new minions as they are created » Heal broken services by attempting common xes
  22. SALT PROXY MINIONS SALT PROXY MINIONS

  23. SALT SECURITY SALT SECURITY » Access Control » Hardening Salt

    » Vault for Secrets
  24. ADDING A REST API TO SALT ADDING A REST API

    TO SALT » Multiple Authentication Back-ends » Supports ACLs » Full async websockets for event noti cations Demo of https://github.com/saltstack/pepper
  25. SALT CLOUD SALT CLOUD SUPPORT FOR POPULAR PUBLIC & PRIVATE

    CLOUDS SUPPORT FOR POPULAR PUBLIC & PRIVATE CLOUDS » AWS Examples
  26. ALTERNATE SALT TRANSPORTS ALTERNATE SALT TRANSPORTS » ZeroMQ (Default) »

    Raw TCP Sockets » RAET Or Execute via SSH
  27. SALT MASTER DEPLOYMENT OPTIONS SALT MASTER DEPLOYMENT OPTIONS » Single

    Master » Master Fail-over » Hierarchal Syndics
  28. SALTSTACK ENTERPRISE SALTSTACK ENTERPRISE

  29. None
  30. None
  31. QUESTIONS? QUESTIONS? GET THIS PROJECT: GET THIS PROJECT: CALVIN@SIXFEETUP.COM CALVIN@SIXFEETUP.COM

    @calvinhp http://github.com/calvinhp/salt-orchestation-demo