An introduction to immutable infrastructure using Azure Dev
An introduction to immutable infrastructure using Azure Dev. Ops pipelines Ibon Landa Luis Fraile @ibonilm @lfraile ilanda@plainconcepts. com lfraile@plainconcepts. com #Dev. Sum 19
Don’t forget to evaluate this session in the Dev. Sum app! #Dev. Sum 19
Ibon Landa General Manager at Plain Concepts @ibonilm ilanda@plainconcepts. co m
Luis Fraile Dev. Ops Consultant + CTO B!Play @lfraile@plainconcepts. co m
Our team
WHERE TO FIND US
#Dev. Sum 19
Agenda Dev. Ops Intro Inmutable infrastructure Infrastructure as a Code Azure Dev. Ops pipelines Inmutable infrastructure with Docker Inmutable infrastructure with Virtual Machines 8
WHAT IS DEVOPS? People. Process. Products. Build & Test “Dev. Ops is the union of people, process, and products to enable continuous delivery of value to your end users. Continuous Delivery Develop ” Donovan Brown (Microsoft) Deploy Plan & Track Operate Monitor & Learn #Dev. Sum 19
Version everything Automate everything Tokenize configurations Use one-click deployments Deploy the same way to every environment Have always a rollback mechanism in place Build only once Lock down the environments … #Dev. Sum 19
Infrastructure
A regular deployment pipeline
To produce a release, we need to build it from source The resulting application deliverable app is… #Dev. Sum 19
Of couse, it requires a stack of software to execute… #Dev. Sum 19
There are several machines the app needs to run The application is gradually promoted from env to env The same app is pulled from the artifact repository #Dev. Sum 19
The job of the system administrator to ensure that these machines are as identical as possible All changes, patches and upgrades need to be performed on all machines #Dev. Sum 19
Some additional software is missing A resource (directory, . . . ) has been created under the wrong name The wrong version of some software is installed Permissions have been set incorrectly a critical resource (port, . . . ) is occupied Application code is deployed outside of the normal straight-fromsource-control process The operating system has been patched again and again …. #Dev. Sum 19
At the end of the day … #Dev. Sum 19
The whole machine is now packaged as a single immutable unit It contains the entire software stack and it is regenerated by the continuous integration server after every change #Dev. Sum 19
Immutable Infrastructure
Immutable infrastructure is comprised of immutable components that are replaced for every deployment, rather than being updated in-place. Those components are started from a common image that is built once per deployment and can be tested and validated #Dev. Sum 19
Reduce inconsistency in your infrastructure Improve the trust into your deployment process Rollback to an old version is easy Every change is in a script Setting up staging systems is easy and can be automated Testing the new infrastructure in isolation is possible #Dev. Sum 19
We also need tools!
#Dev. Sum 19
Microsoft Azure Dev. Ops pipelines Terraform Docker Ansible Packer … #Dev. Sum 19
Azure Dev. Ops pipelines
INTRODUCING AZURE DEVOPS Azure Boards Azure Pipelines Azure Repos Deliver value to your users faster using proven agile tools to plan, track, and discuss work across your teams. Build, test, and deploy with CI/CD that works with any language, platform, and cloud. Connect to Git. Hub or any other Git provider and deploy continuously. Get unlimited, cloud-hosted private Git repos and collaborate to build better code with pull requests and advanced file management. Azure Test Plans Azure Artifacts Test and ship with confidence using manual and exploratory testing tools. Create, host, and share packages with your team, and add artifacts to your CI/CD pipelines with a single click. https: //azure. com/devops #Dev. Sum 19
AZURE PIPELINES Cloud-hosted pipelines for Linux, Windows and mac. OS, with unlimited minutes for open source Any language, any platform, any cloud Build, test, and deploy Node. js, Python, Java, PHP, Ruby, C/C++, . NET, Android, and i. OS apps. Run in parallel on Linux, mac. OS, and Windows. Deploy to Azure, AWS, GCP or on-premises Extensible Explore and implement a wide range of communitybuilt build, test, and deployment tasks, along with hundreds of extensions from Slack to Sonar. Cloud. Support for YAML, reporting and more Containers and Kubernetes Easily build and push images to container registries like Docker Hub and Azure Container Registry. Deploy containers to individual hosts or Kubernetes. Best-in-class for open source Ensure fast continuous integration/continuous delivery (CI/CD) pipelines for every open source project. Get unlimited build minutes for all open source projects with up to 10 free parallel jobs across Linux, mac. OS and Windows #Dev. Sum 19
Demo #Dev. Sum 19
Infrastructure as code
Infrastructure Code Infrastructure as code #Dev. Sum 19
Avoid deployment inconsistencies Speed and simplicity Configuration consistency Minimization of risk Increased efficiency in software development Cost savings #Dev. Sum 19
A tool for… “Write, Plan, and Create Infrastructure as Code” Open Source, created by Hashicorp (vagrant, packer…) Readable and writable Written in Go Pluggable Multiplatform #Dev. Sum 19
resource "azurerm_resource_group" "test" { name = "example-resources" location = "West Europe" } resource "azurerm_app_service_plan" "test" { name = "example-appserviceplan" location = "${azurerm_resource_group. test. location}" resource_group_name = "${azurerm_resource_group. test. name}" sku { tier = "Standard" size = "S 1" } } resource "azurerm_app_service" "test" { name = "example-app-service“ // Globally unique name here!! location = "${azurerm_resource_group. test. location}" resource_group_name = "${azurerm_resource_group. test. name}" app_service_plan_id = "${azurerm_app_service_plan. test. id}" } #Dev. Sum 19
resource "aws_elastic_beanstalk_application" "tftest" { name = "tf-test-name" description = "tf-test-desc" } resource "aws_elastic_beanstalk_environment" "tfenvtest" { name = "tf-test-name" application = "${aws_elastic_beanstalk_application. tftest. name}" solution_stack_name = "64 bit Amazon Linux 2018. 03 v 4. 8. 1 running Node. js" } #Dev. Sum 19
Demo #Dev. Sum 19
Immutable Infrastructure with Docker
#Dev. Sum 19
#Dev. Sum 19
#Dev. Sum 19
#Dev. Sum 19
#Dev. Sum 19
Demo #Dev. Sum 19
Immutable Infrastructure with Virtual Machines
#Dev. Sum 19
Packer is a tool for creating machine and container images for multiple platforms from a single source configuration And more… #Dev. Sum 19
#Dev. Sum 19
Apply the configuration using Ansible Create the images using Packer templates Publish generated images #Dev. Sum 19
Apply the configuration using Ansible Create the images using Packer templates Publish generated images #Dev. Sum 19
And…. Last but not least – don’t forget to evaluate this session in the Dev. Sum app! #Dev. Sum 19
#Dev. Sum 19
WHERE TO FIND US
- Slides: 57