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

Deployment Automation and Orchestration with Sa...

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.

Calvin Hendryx-Parker

May 05, 2020
Tweet

More Decks by Calvin Hendryx-Parker

Other Decks in Programming

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 INSTALLATION SALT INSTALLATION » Bootstrap – » Docker –

    » Package Management careful old packages https://github.com/saltstack/salt-bootstrap https://hub.docker.com/r/saltstack/salt
  5. 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:
  6. 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:
  7. 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
  8. USING DEPENDENCIES WITH USING DEPENDENCIES WITH ORCHESTRATION ORCHESTRATION » True

    master control » Orchestrate from above » Cross minion dependencies
  9. 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
  10. USE REACTORS TO ORCHESTRATE USE REACTORS TO ORCHESTRATE » Salt

    new minions as they are created » Heal broken services by attempting common xes
  11. 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
  12. SALT CLOUD SALT CLOUD SUPPORT FOR POPULAR PUBLIC & PRIVATE

    CLOUDS SUPPORT FOR POPULAR PUBLIC & PRIVATE CLOUDS » AWS Examples
  13. SALT MASTER DEPLOYMENT OPTIONS SALT MASTER DEPLOYMENT OPTIONS » Single

    Master » Master Fail-over » Hierarchal Syndics