0% found this document useful (0 votes)
125 views

An Introduction To Immutable Infrastructure Using Azure Devops Pipelines

This document provides an overview of using immutable infrastructure with Azure DevOps pipelines. It discusses how immutable infrastructure treats the entire machine as a single immutable unit that is regenerated by the continuous integration server after every change. This reduces inconsistencies and improves the deployment process. It then demonstrates how Azure DevOps pipelines can be used to implement immutable infrastructure, providing continuous delivery of infrastructure components. Key tools mentioned include Terraform, Docker, and Packer for defining infrastructure as code.

Uploaded by

Ayeni Ayomide
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
125 views

An Introduction To Immutable Infrastructure Using Azure Devops Pipelines

This document provides an overview of using immutable infrastructure with Azure DevOps pipelines. It discusses how immutable infrastructure treats the entire machine as a single immutable unit that is regenerated by the continuous integration server after every change. This reduces inconsistencies and improves the deployment process. It then demonstrates how Azure DevOps pipelines can be used to implement immutable infrastructure, providing continuous delivery of infrastructure components. Key tools mentioned include Terraform, Docker, and Packer for defining infrastructure as code.

Uploaded by

Ayeni Ayomide
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 57

An introduction to immutable infrastructure using Azure

DevOps pipelines

Ibon Landa
Luis Fraile

@ibonilm @lfraile [email protected] [email protected]


#DevSum19
Don’t forget to evaluate
this session in the DevSum app!

#DevSum19
Ibon Landa
General Manager at Plain Concepts
@ibonilm
[email protected]
Luis Fraile
DevOps Consultant + CTO B!Play
@lfraile
[email protected]
Our team
WHERE TO FIND US
#DevSum19
DevOps Intro
Inmutable infrastructure
Infrastructure as a Code
Agenda
Azure DevOps pipelines
Inmutable infrastructure with Docker
Inmutable infrastructure with Virtual
Machines

8
“DevOps is “DevOps is
development It’s treating your
and operations DevOps! infrastructure
collaboration” as code”

It’s
“DevOps DevOps! “DevOps
It’s DevOps!
is using It’s
DevOps!
is feature
automation” switches”

“Scrum
“DevOps for Ops?”
is small
deployments”
WHAT IS DEVOPS?
People. Process. Products.
Build Deploy
&
Test


DevOps is the union of
people, process, and
Continuous
products to enable Develop
Delivery
Operate

continuous delivery of value


to your end users. ”
Plan Monitor
Donovan Brown (Microsoft) & &
Track Learn

#DevSum19
DevOps Best Practices
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

#DevSum19
Click icon to add picture

Infrastructure
Infrastructure can be complex
Click icon to add picture

A regular
deployment pipeline
A regular deployment pipeline
To produce a release, we need to build it from source
The resulting application deliverable app is…
a single immutable unit
built once and stored in an artifact repository
regenerated by the continuous integration system after every change

#DevSum19
A regular deployment pipeline
Of couse, it requires a stack of software to execute…
Server application
Language runtime
Libraries
OS

#DevSum19
A regular deployment pipeline
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

#DevSum19
A regular deployment pipeline
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

#DevSum19
But sometimes…The system becomes a house of cards
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-from-
source-control process
The operating system has been patched again and again
….

#DevSum19
At the end of the
day …

#DevSum19
Immutable Infrastructure
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

#DevSum19
Click icon to add picture

Immutable
Infrastructure
What is 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

#DevSum19
Advantages
Reduce inconsistency in your infrastructure
It is easy to have a production-like system on development machines

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

#DevSum19
Click icon to add picture

We also need tools!


#DevSum19
Just our tooling…
Microsoft Azure
Azure DevOps pipelines
Terraform
Docker
Ansible
Packer

#DevSum19
Click icon to add picture

Azure DevOps
pipelines
INTRODUCING AZURE DEVOPS

Azure Boards Azure Pipelines Azure Repos


Deliver value to your users faster Build, test, and deploy with CI/CD that Get unlimited, cloud-hosted
using proven agile tools to plan, works with any language, platform, private Git repos and collaborate
track, and discuss work across and cloud. Connect to GitHub or any to build better code with pull
your teams. other Git provider and deploy requests and advanced file
continuously. management.

Azure Test Plans Azure Artifacts


Test and ship with confidence Create, host, and share packages with 
using manual and exploratory your team, and add artifacts to your
testing tools. CI/CD pipelines with a single click. https://azure.com/devops

#DevSum19
AZURE PIPELINES
Cloud-hosted pipelines for Linux, Windows and
macOS, 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 iOS apps. Run in
parallel on Linux, macOS, and Windows. Deploy to
Azure, AWS, GCP or on-premises

Extensible
Explore and implement a wide range of
community-built build, test, and deployment tasks,
along with hundreds of extensions from Slack to
SonarCloud. 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, macOS
and Windows

#DevSum19
Demo

#DevSum19
Click icon to add picture

Infrastructure as code
Infrastructure as code
Infrastructure
IT infrastructure consists of all components that somehow
play a role in overall IT and IT-enabled operations.
It can be used for internal business operations or
developing customer IT or business solutions. 

Code
A set of instructions or statements that are processed by a
computer.

Infrastructure as code
Treating your infrastructure as code to ensure that is as
versionable, repeatable, and testable as application code

#DevSum19
Benefits
Avoid deployment inconsistencies
Speed and simplicity
Configuration consistency
Minimization of risk
Increased efficiency in software development
Cost savings

#DevSum19
What is Terraform
A tool for… “Write, Plan, and Create Infrastructure as Code”
Open Source, created by Hashicorp (vagrant, packer…)
A tool to manage virtual server life cycles (AWS, Azure, VMWare, OpenStack, Google
cloud, Heroku, Kubernetes etc…)
A tool to manage supporting services (DNS, Email..)
Readable and writable
Written in Go
Pluggable
Multiplatform

#DevSum19
Resources (Azure)
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 = "S1"
}
}
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}"
}
#DevSum19
Resources (Amazon)
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 = "64bit Amazon Linux 2018.03 v4.8.1
running Node.js"
}

#DevSum19
Demo

#DevSum19
Click icon to add picture

Immutable Infrastructure
with Docker
Immutable infrastructure with Docker

#DevSum19
Version everything!!

#DevSum19
Build & Publish docker images to ACR

#DevSum19
Deploy to several environments

#DevSum19
Deploy the same artifacts / the same way

#DevSum19
Demo

#DevSum19
Click icon to add picture

Immutable Infrastructure
with Virtual Machines
Ansible, Packer & Terraform

#DevSum19
Packer
Packer is a tool for creating machine and container images for multiple
platforms from a single source configuration

And more…
#DevSum19
Packer Template

#DevSum19
Immutable infrastructure
Continuous integration build definitions
Apply the configuration using Ansible
Create the images using Packer templates
Publish generated images

#DevSum19
Deploy to several environments
Apply the configuration using Ansible
Create the images using Packer templates
Publish generated images

#DevSum19
And….
Last but not least
– don’t forget to evaluate this
session in the DevSum app!

#DevSum19
#DevSum19
WHERE TO FIND US

You might also like