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

GitOps: Introduction to Atlantis

GitOps: Introduction to Atlantis

More Decks by Bruno Russi Lautenschlager

Other Decks in Technology

Transcript

  1. Bruno Russi Lautenschlager • SRE @ iFood • AWS Community

    Builder • Pai de pet linktr.ee/bruno_russi
  2. What is Infrastructure as Code • Define your infrastructure as

    code instead of creating it manually • Infrastructure can be easily reproduced
  3. Types of IaC Not only infrastructure • Network as Code

    • Policy as Code • Configuration as Code • Security as Code
  4. How usually people use IaC Not on a git repository

    • Create and test locally infra files • Execute from local machine
  5. How usually people use IaC I have a repository but

    commit and push all on main/master No Review/Approval process • No pull requests • No code review • No collaboration • No automated tests
  6. How usually people use IaC Apply the infrastructure locally •

    Tooling version variations from one machine to another • Many people have access to the infrastructure • Difficulty tracking changes ◦ Hard to know who performed it and when ◦ No visibility of what is being applied and what has been applied
  7. How usually people use IaC No defined environment • No

    development/test environment for infra • You will find the problems only after applying
  8. GitOps: workflow 1. Make infrastructure changes 2. Create pull request

    (Visibility, RFC) 3. CI Pipeline (Lint, tests) 4. Approve by team (Review from team) 5. Applies infra files on infrastructure (Atlantis)
  9. How Atlantis works? • Atlantis is self-hosted. Your credentials don't

    leave your infrastructure • Runs as a Golang binary or Docker image • Can be deployed on VMs, Kubernetes, Fargate, etc • Listens for webhooks from GitHub/GitLab/Bitbucket/Azure DevOps • Runs terraform commands remotely and comments back with their output
  10. How to configure? - Git Host - Create git access

    credentials - Deploy Atlantis - Configure webhooks - Configure provider credentials
  11. How to configure Atlantis server? All the Altantis flags can

    be configured using: - Environment variables - Config yaml file - Flags on execution command
  12. Atlantis workflow: apply requirements Atlantis allows you to require certain

    conditions be satisfied before an Atlantis apply command can be run: • Approved • Mergeable
  13. Benefits - Automated process - No tolling version variation -

    No human failures - More transparent - Team collaboration - More quality in code - Any person can send a PR and propose a change - Greater security - Only the pipeline has access to infra - Centralized - Git is the source of truth (everything that passes is applied) - Just revert a commit and open an MR for rollback - Infra reflect what's in git