Agreements as Code: how to refactor the infrastructure and not break



This is a transcript of a talk at TechLeadConf 2020-06-09 . Before we start, try to answer the question for yourself what are your expectations from interacting with the infrastructure? For example, how long will it take:



  • Deploy a new test environment.
  • Update java and / or OS version inside container.
  • Grant server access rights.


TechLeadConf



, . -, ?





, , . , - . , , . .





C + + =





? . , . , : .



  1. . . , . / -( !). 10-15 . - . , , - - , . , .
  2. . , jira, email, slack . . " , , ". .
  3. . . : jira, 7 .






, , , . , . CoreOS compose . k8s . : YML git? ? , . . , . . . — , . . : , .



?







, . , , . , . , . : … … . -. , .



Agreements as Code





Jira. , . - - . . DSL, Ansible . . - . ? ?



Agreements as Code





/ . .



  • * — "" . / / .
  • — / .




:



  • , — . confluence , , .
  • , — , . REST api , DNS . .
  • , — . email? ? ?
  • , — , , .. . , , . , * IaC.


-> ->





. .



  • — , , , .
  • — . confluence . .
  • — " "() . , * as Service .




, ?



  • , — . , , LDAP . -> -> LDAP.
  • , — , .. , . AWS, * as Service , - . , , .
  • , — . - email , ; , web .
  • , — , , *( , .. !), .


, * as Service.



.



, . , , . , / . :



  • .
  • .
  • ...


Ansible: 120 VM c Coreos Centos 18





, configuration management . , , , .. , . Ansible, Ansible: 120 VM c Coreos Centos 18 . 1,5 ? — 80% reverse engineering 20% , . :



CFM 2 Ansible



  1. .
  2. .
  3. .
  4. .
  5. .
  6. №2.


Ansible,



Ansible refactoring



Ansible. - , , .. . , air gap( ). . Ansible, , :



  1. .
  2. .
  3. .
  4. /, .


Ansible ?



Ansible testing



, . Jenkins Pipeline, :



  1. .
  2. Jenkins.
  3. lint .
  4. molecule


IaC



IaC refactoring



, / * as Service. . :



  1. .
  2. .
  3. .
  4. .
  5. .
  6. ( ! ).
  7. .


. : , , . :



  • — , , .
  • — , , .
  • — , .






, , IaC . , , . :



  • — YML . , , - .
  • — Ansible .
  • — .


, :



  • .
  • .
  • .


, , . / .



IaC testing pyramid. !



IaC testing pyramid



DevopConf , 200 000 . , , : , , , .



  • Static Analysis — , . , .
  • Unit — IaC . Ansible Molecule.
  • Integrationunit, .
  • E2E — , .


?



, . . . , ? .



№1





, .. , . , .



№2





. .



, . SLOC:



  • 2000 — .
  • 4000
  • 6000 — .
  • 8000 — E2E .


Lessons learned



  1. .
  2. Agreements as ode .
  3. -> -> .
  4. . .
  5. / .
  6. IaC testing pyramid. !







All Articles