SlideShare a Scribd company logo
Immutable Infrastructure as Code.
True story.
Vladlen Fedosov, Director of R&D @Namecheap, Inc
Vladlen Fedosov
Director of R&D @Namecheap
TL;DR:

• 10 years in the industry

• Went path from Junior to Architect 

• Amateur DevOps evangelist 

• AWS ninja

• Believe in self-organized, cross-functional teams
“Opening the door for
everyone to a free and
open Internet”
The beginning
Disclaimer: Here I’m talking mostly about my experience and part of the infrastructure that my team
was responsible for. So further statements may not apply to every department in the company. Timeline for the things
mentioned below was changes to simplify storytelling.
DevOps Fest 2020. immutable infrastructure as code. True story.
Project takeover from outsourcing company
Brave New World
For a small dev team with no infra support / capabilities
So what do we have now?
State of the project after takeover
● Half broken Chef cookbooks

● Sketchy CD pipelines

● Fault tolerance in place

● And… Everything went down after failure of the single (out of 3)
etcd node. We realized that we have fault tolerance only on paper
After some refactoring… We’ve got typical setup
Issues we noticed
- Multiple apps were sharing same OS, language versions, dependencies
- Horizontal scaling was hard

- Sometimes failing chef scripts on random instances mostly due to network
errors & configuration differences
Configuration Synchronisation problem, in short
martinfowler.com/bliki/ConfigurationSynchronization.html
Issues we noticed
- Manual sync of the AWS setup between environments

- Manually configured CI/CD

- Easy to break something and hard to repair or modify anything
Blue sky vision
● Immutable infrastructure
● Everything as code
○ Infrastructure as code

○ CI/CD as code
Blue sky vision
● Hard to break
● Easy to repair
● Easy to modify
Immutable infrastructure
+ extra takeaways
What is immutable infrastructure?
martinfowler.com/bliki/ImmutableServer.html
Why go Immutable?
● Forget about change flow, only “create” matters

● Defeat Configuration Drift

● Use much simpler tools

● Build highly available systems easier

● Fix issues faster
How to achieve this?
● Complexity → Docker (or AMI) images

● OS → Docker runtime only

● App/OS configuration methods:

○ K8s pod definitions (or similar)

○ “cloud-init”

● Terraform to define “datacenter config”
Main tools we use
● AMI images & Docker images

● Cloud-Init (98%)

● Hashicorp Packer (2%)

● Terraform, Terraform everywhere
Single fact you could memorise here
Immutable Infrastructure allows you to significantly simplify
management steps and consequently reduce number of
bugs your customers will face with. Work with images rather
than servers.
CI/CD as code
DevOps Fest 2020. immutable infrastructure as code. True story.
DevOps Fest 2020. immutable infrastructure as code. True story.
Everything as code: full list
● Everything as code, it supports:
○ job steps definition as code (via pipelines)

○ jobs creation as code (via job dsl)

○ system configuration as code (via groovy API, XML configs & CasC yml)

● Shared libraries, ability to share common steps between apps
P.S: Talk to me if know better alternative ;)
Other factors influenced the choice
● Has deployment dashboard so we can see the state of all the
environments
● Highly extensible
● Elastic EC2 instances as agents
Nowadays
● It went beyond one project and now almost every team at Namecheap uses it

● 300+ pipelines

● Around 38 projects

● We expect even more in the future
Nowadays: CI
@Library('namecheap/common') _
node('CommonCLarge') {
ciJavascript.servicePipeline {
productName = "ProductA"
serviceName = "Apps.Api"
}
}
Nowadays: CD
@Library('namecheap/common') _
properties([parameters([
string(name: 'image', description: 'Application container name'),
string(name: 'version', description: 'Application container tag'),
choice(choices: ['production', 'sandbox'], description: 'Environment', name: 'env')
])])
node() {
def authToken = "XXXX"
stage('Deploy') {
deployToOKD(params, authToken)
}
}
Lessons learned
● Hide all complexity inside. Provide as much logic as you can in a form of
Shared Libraries. 

● Documentation & examples are crucial for developers

● If possible - provide standardized pipelines invoked as Shared Library
function

● It takes about 1.5 months for 2 people to setup Jenkins properly for the first
time
Single fact you could memorise here
Always keep your CI/CD configuration, written as code,
near the app, in the same repo. It will give an understanding
to everyone in your company on how to build & deploy any
app.
Infrastructure as code: Terraform
How Terraform is different to Ansible/Chef/Puppet
Terraform is not a configuration management tool. It focuses on the higher-level
abstraction of the datacenter (or cloud provider), without sacrificing the ability to
use configuration management tools to do what they do best: bootstrapping
and initializing resources.
resource "aws_instance" "web" {
ami = "ami-dbc3b9aa"
instance_type = "t2.micro"
}
Imperative VS Declarative infrastructure code
Declarative
“Can I have a cup of coffee on my
desk at 9AM on Monday morning?”
Imperative
“Go to that machine, then get the
glass jar, then fill it with water, then
put it back in the machine” 

…you get the idea...
Why go Declarative?
Key challenges this approach solves for us:

● Dealing with “Configuration Drift” / State management

● Idempotency

● Dependency graph management, correct order of operations
Terraform CI
Try now:

https://www.runatlantis.io/ 

https://app.terraform.io/
Deploy with Terraform
What we had:
1. Write TF configs

2. Run TF to create infrastructure

3. Take TF outputs & enter them to
Jenkins

4. Deploy app itself with Jenkins
What we wanted to have:
1. Write TF configs

2. Deploy app
Deploy with Terraform
Deploy with Terraform
!"" vars <-- Environment specific variables
# !"" production.tfvars
# !"" staging.tfvars
!"" main.tf
!"" io.tf
!"" db.tf
!"" etc.tf
Single fact you could memorize here
Try to have as much declarative infrastructure configs as
you can, avoid imperative scripts at all cost.
Learnings & further improvements
Tests for infrastructure code
The more infrastructure code you have - the more bugs you see.
Chaos monkey
We wrote a Lambda that randomly reboots every instance once a day. This
simple tweak ensures that:

● Apps you launch can survive instance failure

● Updates to the cluster setup is easy as you’re sure that you won’t harm
anyone by killing outdated machines

● Problem resolution can be simpler sometimes. You can always reboot/kill any
instance that behaves abnormally as a first action

Apply this to control fleet too
No SSH keys distribution over instances
● If you’re using AWS - simply install SSM agent to your instances and disable
SSH daemon. You will be able to use SSH console to perform your
administrative actions.

● If you’re not in AWS - you can use Hashicorp Vault. It provides you with
SSH backend that allows central management & audit of the login identities.
Things that work for 3 teams - doesn’t work for 10
Issues
# of users
Key learnings here:
● Operational work grows exponentially the more teams you add 

● 1 new tool/approach for devs at a time

● Conduct educational courses for big new things like Docker, AWS, Terraform

● Gain trust within the team you’re challenging with a change first

● Documentation is paramount, start it as early as possible
Things that work for 3 teams - doesn’t work for 10
DevOps on Call & transparent SLAs
● We’ve established “on call” schedule 

● Agreed on SLAs & shared then among the teams

● Created chat room & Jira board

Result: significant reduction of the distraction level, better productivity, happier
teams
Even you’re doing good now, you can make it even better with this practice
Encourage feedback
● Ask for it proactively, show that it's important for you

● Public retrospectives

● Respond to the feedback
Summing up
What we’ve achieved
● Immutable infrastructure (done)
○ ECS with immutable data plane

○ Immutable EC2 instances for stateful instances

● Everything as code (done)
○ Infrastructure as code: Terraform, Cloud-init

○ CI/CD as code: Jenkins

Now it’s hard to break & easy to repair things as well as

easy to track changes.
Vlad Fedosov
Director of R&D
@Namecheap, Inc
vlad.fedosov@gmail.com
Or just scan it:
Evolving Terraform experience

More Related Content

What's hot (20)

PDF
Devops with Python by Yaniv Cohen DevopShift
Yaniv cohen
 
PPTX
Infrastructure as Code for Network
Damien Garros
 
PDF
Puppet overview
joshbeard
 
PPTX
Continuous integration of_puppet_code
Devoteam Revolve
 
PDF
DevOps Summit 2016 - The immutable Journey
smalltown
 
PDF
PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...
Puppet
 
PDF
Devops For Drupal
Kris Buytaert
 
ODP
Is Python still production ready ? Ludovic Gasc
Pôle Systematic Paris-Region
 
PDF
DevTernity - DevOps with smell
Antons Kranga
 
PDF
Rule jenkins with configuration as code
Christian Rasp
 
PPTX
Immutable Infrastructure: the new App Deployment
Axel Fontaine
 
PDF
CommandBox & ForgeBox Package Management
Ortus Solutions, Corp
 
PPT
Continuous Deployment with Cloud Foundry, Github and Travis CI
Platform CF
 
PPT
From VB Script to PowerShell
Concentrated Technology
 
ZIP
Drupal Deployment
Jeff Eaton
 
PDF
Puppet Camp Charlotte 2015: Manage Your Switches Like Servers
Puppet
 
PPT
PS scripting and modularization
Concentrated Technology
 
PDF
ContainerCon - Test Driven Infrastructure
Yury Tsarev
 
KEY
John Adams Puppet Camp 2010
Puppet
 
PPTX
Implementing blue-green deployment with Atlassian Bamboo
Dave Clark
 
Devops with Python by Yaniv Cohen DevopShift
Yaniv cohen
 
Infrastructure as Code for Network
Damien Garros
 
Puppet overview
joshbeard
 
Continuous integration of_puppet_code
Devoteam Revolve
 
DevOps Summit 2016 - The immutable Journey
smalltown
 
PuppetConf 2016: Keynote: Pulling the Strings to Containerize Your Life - Sco...
Puppet
 
Devops For Drupal
Kris Buytaert
 
Is Python still production ready ? Ludovic Gasc
Pôle Systematic Paris-Region
 
DevTernity - DevOps with smell
Antons Kranga
 
Rule jenkins with configuration as code
Christian Rasp
 
Immutable Infrastructure: the new App Deployment
Axel Fontaine
 
CommandBox & ForgeBox Package Management
Ortus Solutions, Corp
 
Continuous Deployment with Cloud Foundry, Github and Travis CI
Platform CF
 
From VB Script to PowerShell
Concentrated Technology
 
Drupal Deployment
Jeff Eaton
 
Puppet Camp Charlotte 2015: Manage Your Switches Like Servers
Puppet
 
PS scripting and modularization
Concentrated Technology
 
ContainerCon - Test Driven Infrastructure
Yury Tsarev
 
John Adams Puppet Camp 2010
Puppet
 
Implementing blue-green deployment with Atlassian Bamboo
Dave Clark
 

Similar to DevOps Fest 2020. immutable infrastructure as code. True story. (20)

PDF
Successful DevOps implementation for small teams a true story
Jakub Paweł Głazik
 
PDF
Docker in Production at the Aurora Team
Haufe-Lexware GmbH & Co KG
 
PPTX
Using Docker EE to Scale Operational Intelligence at Splunk
Docker, Inc.
 
PDF
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Richard Bullington-McGuire
 
PDF
Meetup 2020 - Back to the Basics part 101 : IaC
DamienCarpy
 
PDF
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
Haggai Philip Zagury
 
PDF
Old Is the New New
Kevlin Henney
 
PDF
Product! - The road to production deployment
Filippo Zanella
 
PDF
Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...
Lean IT Consulting
 
PDF
The "Holy Grail" of Dev/Ops
Erik Osterman
 
PDF
JUST EAT: Embracing DevOps
Peter Mounce
 
PPTX
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Demi Ben-Ari
 
PDF
Scalable TensorFlow Deep Learning as a Service with Docker, OpenPOWER, and GPUs
Indrajit Poddar
 
PDF
Confoo-Montreal-2016: Controlling Your Environments using Infrastructure as Code
Steve Mercier
 
PDF
How Percolate uses CFEngine to Manage AWS Stateless Infrastructure
Percolate
 
PDF
Drupal 8 DevOps . Profile and SQL flows.
Andrii Podanenko
 
PPTX
Normalizing x pages web development
Shean McManus
 
PPTX
Kubernetes 101
Stanislav Pogrebnyak
 
PDF
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
Ambassador Labs
 
PPTX
Devops interview questions 1 www.bigclasses.com
bigclasses.com
 
Successful DevOps implementation for small teams a true story
Jakub Paweł Głazik
 
Docker in Production at the Aurora Team
Haufe-Lexware GmbH & Co KG
 
Using Docker EE to Scale Operational Intelligence at Splunk
Docker, Inc.
 
Extensible dev secops pipelines with Jenkins, Docker, Terraform, and a kitche...
Richard Bullington-McGuire
 
Meetup 2020 - Back to the Basics part 101 : IaC
DamienCarpy
 
DevOpsDays Tel Aviv DEC 2022 | Building A Cloud-Native Platform Brick by Bric...
Haggai Philip Zagury
 
Old Is the New New
Kevlin Henney
 
Product! - The road to production deployment
Filippo Zanella
 
Continuos Integration and Delivery: from Zero to Hero with TeamCity, Docker a...
Lean IT Consulting
 
The "Holy Grail" of Dev/Ops
Erik Osterman
 
JUST EAT: Embracing DevOps
Peter Mounce
 
Kubernetes, Toolbox to fail or succeed for beginners - Demi Ben-Ari, VP R&D @...
Demi Ben-Ari
 
Scalable TensorFlow Deep Learning as a Service with Docker, OpenPOWER, and GPUs
Indrajit Poddar
 
Confoo-Montreal-2016: Controlling Your Environments using Infrastructure as Code
Steve Mercier
 
How Percolate uses CFEngine to Manage AWS Stateless Infrastructure
Percolate
 
Drupal 8 DevOps . Profile and SQL flows.
Andrii Podanenko
 
Normalizing x pages web development
Shean McManus
 
Kubernetes 101
Stanislav Pogrebnyak
 
[KubeCon NA 2018] Telepresence Deep Dive Session - Rafael Schloming & Luke Sh...
Ambassador Labs
 
Devops interview questions 1 www.bigclasses.com
bigclasses.com
 
Ad

More from Vlad Fedosov (6)

PDF
OdessaJs 2020 - How to build your first micro frontend in a matter of minutes
Vlad Fedosov
 
PDF
Maximizing your professional value, from junior to leader
Vlad Fedosov
 
PDF
XP Days 2019: First secret delivery for modern cloud-native applications
Vlad Fedosov
 
PDF
JSFest 2019: Technology agnostic microservices at SPA frontend
Vlad Fedosov
 
PDF
LvivCSS: Web Components as a foundation for Design System
Vlad Fedosov
 
PDF
KharkivJS: Flaws of the Web Components in 2019 and how to address them
Vlad Fedosov
 
OdessaJs 2020 - How to build your first micro frontend in a matter of minutes
Vlad Fedosov
 
Maximizing your professional value, from junior to leader
Vlad Fedosov
 
XP Days 2019: First secret delivery for modern cloud-native applications
Vlad Fedosov
 
JSFest 2019: Technology agnostic microservices at SPA frontend
Vlad Fedosov
 
LvivCSS: Web Components as a foundation for Design System
Vlad Fedosov
 
KharkivJS: Flaws of the Web Components in 2019 and how to address them
Vlad Fedosov
 
Ad

Recently uploaded (20)

PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Digital Circuits, important subject in CS
contactparinay1
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 

DevOps Fest 2020. immutable infrastructure as code. True story.

  • 1. Immutable Infrastructure as Code. True story. Vladlen Fedosov, Director of R&D @Namecheap, Inc
  • 2. Vladlen Fedosov Director of R&D @Namecheap TL;DR: • 10 years in the industry • Went path from Junior to Architect  • Amateur DevOps evangelist  • AWS ninja • Believe in self-organized, cross-functional teams
  • 3. “Opening the door for everyone to a free and open Internet”
  • 4. The beginning Disclaimer: Here I’m talking mostly about my experience and part of the infrastructure that my team was responsible for. So further statements may not apply to every department in the company. Timeline for the things mentioned below was changes to simplify storytelling.
  • 6. Project takeover from outsourcing company
  • 7. Brave New World For a small dev team with no infra support / capabilities
  • 8. So what do we have now?
  • 9. State of the project after takeover ● Half broken Chef cookbooks ● Sketchy CD pipelines ● Fault tolerance in place ● And… Everything went down after failure of the single (out of 3) etcd node. We realized that we have fault tolerance only on paper
  • 10. After some refactoring… We’ve got typical setup
  • 11. Issues we noticed - Multiple apps were sharing same OS, language versions, dependencies - Horizontal scaling was hard - Sometimes failing chef scripts on random instances mostly due to network errors & configuration differences
  • 12. Configuration Synchronisation problem, in short martinfowler.com/bliki/ConfigurationSynchronization.html
  • 13. Issues we noticed - Manual sync of the AWS setup between environments - Manually configured CI/CD - Easy to break something and hard to repair or modify anything
  • 14. Blue sky vision ● Immutable infrastructure ● Everything as code ○ Infrastructure as code ○ CI/CD as code
  • 15. Blue sky vision ● Hard to break ● Easy to repair ● Easy to modify
  • 17. What is immutable infrastructure? martinfowler.com/bliki/ImmutableServer.html
  • 18. Why go Immutable? ● Forget about change flow, only “create” matters ● Defeat Configuration Drift ● Use much simpler tools ● Build highly available systems easier ● Fix issues faster
  • 19. How to achieve this? ● Complexity → Docker (or AMI) images ● OS → Docker runtime only ● App/OS configuration methods: ○ K8s pod definitions (or similar) ○ “cloud-init” ● Terraform to define “datacenter config”
  • 20. Main tools we use ● AMI images & Docker images ● Cloud-Init (98%) ● Hashicorp Packer (2%) ● Terraform, Terraform everywhere
  • 21. Single fact you could memorise here Immutable Infrastructure allows you to significantly simplify management steps and consequently reduce number of bugs your customers will face with. Work with images rather than servers.
  • 25. Everything as code: full list ● Everything as code, it supports: ○ job steps definition as code (via pipelines) ○ jobs creation as code (via job dsl) ○ system configuration as code (via groovy API, XML configs & CasC yml) ● Shared libraries, ability to share common steps between apps P.S: Talk to me if know better alternative ;)
  • 26. Other factors influenced the choice ● Has deployment dashboard so we can see the state of all the environments ● Highly extensible ● Elastic EC2 instances as agents
  • 27. Nowadays ● It went beyond one project and now almost every team at Namecheap uses it ● 300+ pipelines ● Around 38 projects ● We expect even more in the future
  • 28. Nowadays: CI @Library('namecheap/common') _ node('CommonCLarge') { ciJavascript.servicePipeline { productName = "ProductA" serviceName = "Apps.Api" } }
  • 29. Nowadays: CD @Library('namecheap/common') _ properties([parameters([ string(name: 'image', description: 'Application container name'), string(name: 'version', description: 'Application container tag'), choice(choices: ['production', 'sandbox'], description: 'Environment', name: 'env') ])]) node() { def authToken = "XXXX" stage('Deploy') { deployToOKD(params, authToken) } }
  • 30. Lessons learned ● Hide all complexity inside. Provide as much logic as you can in a form of Shared Libraries. ● Documentation & examples are crucial for developers ● If possible - provide standardized pipelines invoked as Shared Library function ● It takes about 1.5 months for 2 people to setup Jenkins properly for the first time
  • 31. Single fact you could memorise here Always keep your CI/CD configuration, written as code, near the app, in the same repo. It will give an understanding to everyone in your company on how to build & deploy any app.
  • 33. How Terraform is different to Ansible/Chef/Puppet Terraform is not a configuration management tool. It focuses on the higher-level abstraction of the datacenter (or cloud provider), without sacrificing the ability to use configuration management tools to do what they do best: bootstrapping and initializing resources. resource "aws_instance" "web" { ami = "ami-dbc3b9aa" instance_type = "t2.micro" }
  • 34. Imperative VS Declarative infrastructure code Declarative “Can I have a cup of coffee on my desk at 9AM on Monday morning?” Imperative “Go to that machine, then get the glass jar, then fill it with water, then put it back in the machine” …you get the idea...
  • 35. Why go Declarative? Key challenges this approach solves for us: ● Dealing with “Configuration Drift” / State management ● Idempotency ● Dependency graph management, correct order of operations
  • 36. Terraform CI Try now: https://www.runatlantis.io/ https://app.terraform.io/
  • 37. Deploy with Terraform What we had: 1. Write TF configs 2. Run TF to create infrastructure 3. Take TF outputs & enter them to Jenkins 4. Deploy app itself with Jenkins What we wanted to have: 1. Write TF configs 2. Deploy app
  • 39. Deploy with Terraform !"" vars <-- Environment specific variables # !"" production.tfvars # !"" staging.tfvars !"" main.tf !"" io.tf !"" db.tf !"" etc.tf
  • 40. Single fact you could memorize here Try to have as much declarative infrastructure configs as you can, avoid imperative scripts at all cost.
  • 41. Learnings & further improvements
  • 42. Tests for infrastructure code The more infrastructure code you have - the more bugs you see.
  • 43. Chaos monkey We wrote a Lambda that randomly reboots every instance once a day. This simple tweak ensures that: ● Apps you launch can survive instance failure ● Updates to the cluster setup is easy as you’re sure that you won’t harm anyone by killing outdated machines ● Problem resolution can be simpler sometimes. You can always reboot/kill any instance that behaves abnormally as a first action Apply this to control fleet too
  • 44. No SSH keys distribution over instances ● If you’re using AWS - simply install SSM agent to your instances and disable SSH daemon. You will be able to use SSH console to perform your administrative actions. ● If you’re not in AWS - you can use Hashicorp Vault. It provides you with SSH backend that allows central management & audit of the login identities.
  • 45. Things that work for 3 teams - doesn’t work for 10 Issues # of users
  • 46. Key learnings here: ● Operational work grows exponentially the more teams you add ● 1 new tool/approach for devs at a time ● Conduct educational courses for big new things like Docker, AWS, Terraform ● Gain trust within the team you’re challenging with a change first ● Documentation is paramount, start it as early as possible Things that work for 3 teams - doesn’t work for 10
  • 47. DevOps on Call & transparent SLAs ● We’ve established “on call” schedule ● Agreed on SLAs & shared then among the teams ● Created chat room & Jira board Result: significant reduction of the distraction level, better productivity, happier teams Even you’re doing good now, you can make it even better with this practice
  • 48. Encourage feedback ● Ask for it proactively, show that it's important for you ● Public retrospectives ● Respond to the feedback
  • 50. What we’ve achieved ● Immutable infrastructure (done) ○ ECS with immutable data plane ○ Immutable EC2 instances for stateful instances ● Everything as code (done) ○ Infrastructure as code: Terraform, Cloud-init ○ CI/CD as code: Jenkins Now it’s hard to break & easy to repair things as well as
 easy to track changes.
  • 51. Vlad Fedosov Director of R&D @Namecheap, Inc [email protected] Or just scan it: