SlideShare a Scribd company logo
Managing Microservices
using Terraform, Docker, and the Cloud
Given by Derek C. Ashmore
DevOps West – June 6, 2018
©2018 Derek C. Ashmore, All Rights Reserved 1
Who am I?
• Professional Geek
since 1987
• Java/J2EE/Java EE
since 1999
• AWS since 2010
• Specialties
• Refactoring
• Performance
Tuning
• Yes – I still code!
©2018 Derek C. Ashmore, All Rights Reserved 2
Discussion Resources
• This slide deck
– http://www.slideshare.net/derekashmore
• The hands-on-lab code
– https://github.com/Derek-Ashmore/terraform-hands-on-lab
• The Moneta microservice (written in Java)
– https://github.com/Derek-Ashmore/moneta
• Slide deck has hyper-links!
– Don’t bother writing down URLs
©2018 Derek C. Ashmore, All Rights Reserved 3
Agenda
Microservices,
Docker, and
the Cloud
Cloud with
Terraform
Terraform’s
Competitors
Summary /
Q&A
©2018 Derek C. Ashmore, All Rights Reserved 4
What are Microservices?
• No concrete definition
• Common microservice traits
– Single functional purpose
• Most/all changes only impact one service
• Not dependent on execution context
– “loosely coupled”
– Independent process/jvm
– Stateless
– Standard Interface (typically Web Service/REST)
– Analogy: Stereo system, Linux utilities
©2018 Derek C. Ashmore, All Rights Reserved 5
Microservices Application Architecture
• Separate Databases
• Eventual Consistency
• More network activity
©2018 Derek C. Ashmore, All Rights Reserved 6
Typical Microservice Library
©2018 Derek C. Ashmore, All Rights Reserved 7
Microservice Development
©2018 Derek C. Ashmore, All Rights Reserved 8
Docker
• Is a “mini VM”
• runs a linux kernal
• Compare to shipping
container
• Standard “connections” to
outside world
• Supported formally by
Oracle, Tomcat, Jboss, and
many more
9©2018 Derek C. Ashmore, All Rights Reserved
Package Once, Run Anywhere!
Why Docker?
• Docker is Win-Win
– Easier for OPS and system administrators
• All software looks the same
• Standard interface for disk and network resources
– Containers can be “linked”
• Inherently automated
– Easier for developers
• Fewer environment difference issues
• Less to communicate to OPS / system administrators
• Easy to leverage work of others (docker-hub)
©2018 Derek C. Ashmore, All Rights Reserved 10
Microservice Deployments
©2018 Derek C. Ashmore, All Rights Reserved 11
Basic Microservice Install at AWS
©2018 Derek C. Ashmore, All Rights Reserved 12
• Horizontal scaling is supported
• Multiple copies of microservice / web application
running at the same time
• Elastic Load Balancer distributes load across
copies of your service
• Sticky sessions available
• ELB can use health checks
• Autoscaling Groups scale number of copies up
and down based on rules you give it
• CPU Utilization or other metrics
Infrastructure as Code
• Manual changes
– Increase errors
– Increase unwanted differences
between environments
– Increase admin workload
• Scripted/Coded changes
– Larger upfront cost, but…..
– Less busywork
– Leverage Others Work
– Decreases Errors
– Errors fixed in one place
– Eliminates unwanted differences
– Change history (with source control)
©2018 Derek C. Ashmore, All Rights Reserved 13
Agenda
Microservices,
Docker, and
the Cloud
Cloud with
Terraform
Terraform’s
Competitors
Summary /
Q&A
©2018 Derek C. Ashmore, All Rights Reserved 14
Terraform
• Cloud Management
– Open Source
• Very active community
– Extensible to any cloud vendor
• AWS, Azure, GCP, AliCloud, Digital Ocean, OpenStack
– Supported for Cloud Support products
• Chef, Consul, Kubernetes, Datadog
• 62 Providers as of April, 2017 and growing
©2018 Derek C. Ashmore, All Rights Reserved 15
Terraform HCL
• Declarative Language
– Describe what the end product contains
• Terraform figures out how to get there
– Terraform Resources
• Describes deployed artifacts
– Network  Virtual Networks, Subnets, Network ACLs, Gateways, ELB/ALB
– Hosts  Virtual Machines, Databases
– Security  Security groups/policies/roles/groups/users
– Much more
©2018 Derek C. Ashmore, All Rights Reserved 16
Terraform Basics
• Declarative Programming
– All *.tf files loaded  Terraform decides execution order
– No GUI  All command line and text editor
• Terraform Command Flow
©2018 Derek C. Ashmore, All Rights Reserved 17
Terraform Resources
• AWS Subnet Resource
– Count = 3  Three subnets created
– Availability Zones come from a data source (lookup)
– CIDR blocks are input variables
• Sample source
©2018 Derek C. Ashmore, All Rights Reserved 18
Terraform Data Sources
• Example Data Sources (lookups)
• Sample source
©2018 Derek C. Ashmore, All Rights Reserved 19
Terraform Providers
• Example Provider
• Sample AWS source
• Azure Provider
©2018 Derek C. Ashmore, All Rights Reserved 20
Terraform Input Variables
• Example Provider
• Sample source
©2018 Derek C. Ashmore, All Rights Reserved 21
Reusing Terraform Templates
• Example Template Reuse
• Sample source
©2018 Derek C. Ashmore, All Rights Reserved 22
Typical Project Structure
©2018 Derek C. Ashmore, All Rights Reserved 23
Terraform State
• Terraform stores state
– Local file terraform.tfstate
• Teams need to manage state centrally
– Terraform Backends
• Locks so that only one person at a time can update
• Remote storage
– S3, Azure containers, Google cloud storage, etc.
©2018 Derek C. Ashmore, All Rights Reserved 24
Agenda
Microservices,
Docker, and
the Cloud
Cloud with
Terraform
Terraform’s
Competitors
Summary /
Q&A
©2018 Derek C. Ashmore, All Rights Reserved 25
Terraform vs. Ansible/Chef
• Terraform designed for infrastructure
– Not designed for configuration management
– Terraform deploys images
• Not good at maintaining what’s on those images
• If deployments update existing VMs
– You need Ansible, Chef, or Puppet
• If deployments are “new” VMs
– Terraform can handle deployments too
©2018 Derek C. Ashmore, All Rights Reserved 26
Paradigm Shift
• Deployment as new infrastructure
– New version  new VMs
• Software versions baked into images
– Advantages
• Facilitates Canary Deployments
– Route53 Routing Policies
• Go-live operation has less risk
– Deploy/Backout is just a load balancer switch
– Disadvantages
• More moving parts
• Impossible to do manually
©2018 Derek C. Ashmore, All Rights Reserved 27
Terraform vs CloudFormation
Terraform
• Scripting skills translate to Azure,
Google Cloud, etc.
• Less verbose (>50%)
• Data Lookups
• Custom Plug-ins possible
• Active Community Support
CloudFormation
• Quicker to follow AWS enhancements
• GUI support
• Automatic centralized state
• Vendor Support
©2018 Derek C. Ashmore, All Rights Reserved 28
Further Reading
• This slide deck
– http://www.slideshare.net/derekashmore
• The Gruntwork Blog
– https://blog.gruntwork.io/
• The hands-on-lab code
– https://github.com/Derek-Ashmore/terraform-hands-on-lab
©2018 Derek C. Ashmore, All Rights Reserved 29
Questions?
• Derek Ashmore:
– Blog: www.derekashmore.com
– LinkedIn: www.linkedin.com/in/derekashmore
• Connect Invites from attendees welcome
– Twitter: https://twitter.com/Derek_Ashmore
– GitHub: https://github.com/Derek-Ashmore
– Book: http://dvtpress.com/
©2018 Derek C. Ashmore, All Rights Reserved 30

More Related Content

What's hot (8)

Aws Lambda for Java Architects - JavaOne -2016-09-19
Aws Lambda for Java Architects - JavaOne -2016-09-19Aws Lambda for Java Architects - JavaOne -2016-09-19
Aws Lambda for Java Architects - JavaOne -2016-09-19
Derek Ashmore
 
Aws Lambda for Java Architects - Illinois JUG-Northwest -2016-08-02
Aws Lambda for Java Architects - Illinois JUG-Northwest -2016-08-02Aws Lambda for Java Architects - Illinois JUG-Northwest -2016-08-02
Aws Lambda for Java Architects - Illinois JUG-Northwest -2016-08-02
Derek Ashmore
 
Aws Lambda for Java Architects CJug-Chicago 2016-08-30
Aws Lambda for Java Architects CJug-Chicago 2016-08-30Aws Lambda for Java Architects CJug-Chicago 2016-08-30
Aws Lambda for Java Architects CJug-Chicago 2016-08-30
Derek Ashmore
 
Building a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for AnalystsBuilding a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for Analysts
Avere Systems
 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE Architectures
Alexander Penev
 
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your Mind
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your MindDeliver Best-in-Class HPC Cloud Solutions Without Losing Your Mind
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your Mind
Avere Systems
 
How to Design for High Availability & Scale with AWS
How to Design for High Availability & Scale with AWSHow to Design for High Availability & Scale with AWS
How to Design for High Availability & Scale with AWS
Blazeclan Technologies Private Limited
 
Template Languages for OpenStack - Heat and TOSCA
Template Languages for OpenStack - Heat and TOSCATemplate Languages for OpenStack - Heat and TOSCA
Template Languages for OpenStack - Heat and TOSCA
Cloud Native Day Tel Aviv
 
Aws Lambda for Java Architects - JavaOne -2016-09-19
Aws Lambda for Java Architects - JavaOne -2016-09-19Aws Lambda for Java Architects - JavaOne -2016-09-19
Aws Lambda for Java Architects - JavaOne -2016-09-19
Derek Ashmore
 
Aws Lambda for Java Architects - Illinois JUG-Northwest -2016-08-02
Aws Lambda for Java Architects - Illinois JUG-Northwest -2016-08-02Aws Lambda for Java Architects - Illinois JUG-Northwest -2016-08-02
Aws Lambda for Java Architects - Illinois JUG-Northwest -2016-08-02
Derek Ashmore
 
Aws Lambda for Java Architects CJug-Chicago 2016-08-30
Aws Lambda for Java Architects CJug-Chicago 2016-08-30Aws Lambda for Java Architects CJug-Chicago 2016-08-30
Aws Lambda for Java Architects CJug-Chicago 2016-08-30
Derek Ashmore
 
Building a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for AnalystsBuilding a Just-in-Time Application Stack for Analysts
Building a Just-in-Time Application Stack for Analysts
Avere Systems
 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE Architectures
Alexander Penev
 
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your Mind
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your MindDeliver Best-in-Class HPC Cloud Solutions Without Losing Your Mind
Deliver Best-in-Class HPC Cloud Solutions Without Losing Your Mind
Avere Systems
 
Template Languages for OpenStack - Heat and TOSCA
Template Languages for OpenStack - Heat and TOSCATemplate Languages for OpenStack - Heat and TOSCA
Template Languages for OpenStack - Heat and TOSCA
Cloud Native Day Tel Aviv
 

Similar to Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018 (20)

Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Derek Ashmore
 
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Derek Ashmore
 
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Derek Ashmore
 
AWS Lambda: Best Practices and Common Mistakes - Dev Ops West 2019
AWS Lambda: Best Practices and Common Mistakes - Dev Ops West 2019AWS Lambda: Best Practices and Common Mistakes - Dev Ops West 2019
AWS Lambda: Best Practices and Common Mistakes - Dev Ops West 2019
Derek Ashmore
 
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2019
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2019AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2019
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2019
Derek Ashmore
 
Microservices for Architects - Atlanta 2018-03-28
Microservices for Architects - Atlanta 2018-03-28Microservices for Architects - Atlanta 2018-03-28
Microservices for Architects - Atlanta 2018-03-28
Derek Ashmore
 
AWS Lambda: Best Practices and Common Mistakes - DevOps East 2019
AWS Lambda: Best Practices and Common Mistakes - DevOps East 2019AWS Lambda: Best Practices and Common Mistakes - DevOps East 2019
AWS Lambda: Best Practices and Common Mistakes - DevOps East 2019
Derek Ashmore
 
Terraform best-practices-and-common-mistakes-dev ops-west-2021
Terraform best-practices-and-common-mistakes-dev ops-west-2021Terraform best-practices-and-common-mistakes-dev ops-west-2021
Terraform best-practices-and-common-mistakes-dev ops-west-2021
Derek Ashmore
 
Aws lambda best practices - ignite - dev opsdays-charlotte
Aws lambda   best practices - ignite - dev opsdays-charlotteAws lambda   best practices - ignite - dev opsdays-charlotte
Aws lambda best practices - ignite - dev opsdays-charlotte
Derek Ashmore
 
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Cloudera, Inc.
 
Terrraform meet Oracle Cloud: Platform Provisioning Automation
Terrraform meet Oracle Cloud: Platform Provisioning AutomationTerrraform meet Oracle Cloud: Platform Provisioning Automation
Terrraform meet Oracle Cloud: Platform Provisioning Automation
Simon Haslam
 
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
Derek Ashmore
 
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Derek Ashmore
 
AWS Community Day - Derek C. Ashmore - AWS Lambda: Best Practices
AWS Community Day  - Derek C. Ashmore - AWS Lambda: Best Practices AWS Community Day  - Derek C. Ashmore - AWS Lambda: Best Practices
AWS Community Day - Derek C. Ashmore - AWS Lambda: Best Practices
AWS Chicago
 
AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019
AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019
AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019
Derek Ashmore
 
Microservices for java architects schamburg-2015-05-19
Microservices for java architects schamburg-2015-05-19Microservices for java architects schamburg-2015-05-19
Microservices for java architects schamburg-2015-05-19
Derek Ashmore
 
Writing microservices in Java -- Chicago-2015-11-10
Writing microservices in Java -- Chicago-2015-11-10Writing microservices in Java -- Chicago-2015-11-10
Writing microservices in Java -- Chicago-2015-11-10
Derek Ashmore
 
Writing microservices in java java one-2015-10-28
Writing microservices in java java one-2015-10-28Writing microservices in java java one-2015-10-28
Writing microservices in java java one-2015-10-28
Derek Ashmore
 
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2020
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2020AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2020
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2020
Derek Ashmore
 
Better Practices when Using Terraform to Manage Oracle Cloud Infrastructure
Better Practices when Using Terraform to Manage Oracle Cloud InfrastructureBetter Practices when Using Terraform to Manage Oracle Cloud Infrastructure
Better Practices when Using Terraform to Manage Oracle Cloud Infrastructure
Simon Haslam
 
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Microservices with Terraform, Docker and the Cloud. Chicago Coders Conference...
Derek Ashmore
 
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Microservices with Terraform, Docker and the Cloud. JavaOne 2017 2017-10-02
Derek Ashmore
 
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Microservices with Terraform, Docker and the Cloud. IJug Chicago 2017-06-06
Derek Ashmore
 
AWS Lambda: Best Practices and Common Mistakes - Dev Ops West 2019
AWS Lambda: Best Practices and Common Mistakes - Dev Ops West 2019AWS Lambda: Best Practices and Common Mistakes - Dev Ops West 2019
AWS Lambda: Best Practices and Common Mistakes - Dev Ops West 2019
Derek Ashmore
 
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2019
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2019AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2019
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2019
Derek Ashmore
 
Microservices for Architects - Atlanta 2018-03-28
Microservices for Architects - Atlanta 2018-03-28Microservices for Architects - Atlanta 2018-03-28
Microservices for Architects - Atlanta 2018-03-28
Derek Ashmore
 
AWS Lambda: Best Practices and Common Mistakes - DevOps East 2019
AWS Lambda: Best Practices and Common Mistakes - DevOps East 2019AWS Lambda: Best Practices and Common Mistakes - DevOps East 2019
AWS Lambda: Best Practices and Common Mistakes - DevOps East 2019
Derek Ashmore
 
Terraform best-practices-and-common-mistakes-dev ops-west-2021
Terraform best-practices-and-common-mistakes-dev ops-west-2021Terraform best-practices-and-common-mistakes-dev ops-west-2021
Terraform best-practices-and-common-mistakes-dev ops-west-2021
Derek Ashmore
 
Aws lambda best practices - ignite - dev opsdays-charlotte
Aws lambda   best practices - ignite - dev opsdays-charlotteAws lambda   best practices - ignite - dev opsdays-charlotte
Aws lambda best practices - ignite - dev opsdays-charlotte
Derek Ashmore
 
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Cloudera, Inc.
 
Terrraform meet Oracle Cloud: Platform Provisioning Automation
Terrraform meet Oracle Cloud: Platform Provisioning AutomationTerrraform meet Oracle Cloud: Platform Provisioning Automation
Terrraform meet Oracle Cloud: Platform Provisioning Automation
Simon Haslam
 
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
Refactoring Into Microservices. Chicago Coders Conference 2017-06-26
Derek Ashmore
 
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Microservices for Java Architects (Madison-Milwaukee, April 28-9, 2015)
Derek Ashmore
 
AWS Community Day - Derek C. Ashmore - AWS Lambda: Best Practices
AWS Community Day  - Derek C. Ashmore - AWS Lambda: Best Practices AWS Community Day  - Derek C. Ashmore - AWS Lambda: Best Practices
AWS Community Day - Derek C. Ashmore - AWS Lambda: Best Practices
AWS Chicago
 
AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019
AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019
AWS Lambda: Best Practices and Common Mistakes - AWS Community Days 2019
Derek Ashmore
 
Microservices for java architects schamburg-2015-05-19
Microservices for java architects schamburg-2015-05-19Microservices for java architects schamburg-2015-05-19
Microservices for java architects schamburg-2015-05-19
Derek Ashmore
 
Writing microservices in Java -- Chicago-2015-11-10
Writing microservices in Java -- Chicago-2015-11-10Writing microservices in Java -- Chicago-2015-11-10
Writing microservices in Java -- Chicago-2015-11-10
Derek Ashmore
 
Writing microservices in java java one-2015-10-28
Writing microservices in java java one-2015-10-28Writing microservices in java java one-2015-10-28
Writing microservices in java java one-2015-10-28
Derek Ashmore
 
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2020
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2020AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2020
AWS Lambda: Best Practices and Common Mistakes - Chicago Cloud Conference 2020
Derek Ashmore
 
Better Practices when Using Terraform to Manage Oracle Cloud Infrastructure
Better Practices when Using Terraform to Manage Oracle Cloud InfrastructureBetter Practices when Using Terraform to Manage Oracle Cloud Infrastructure
Better Practices when Using Terraform to Manage Oracle Cloud Infrastructure
Simon Haslam
 

Recently uploaded (20)

Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
officeiqai
 
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROIAutoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Udit Goenka
 
How AI Can Improve Media Quality Testing Across Platforms (1).pptx
How AI Can Improve Media Quality Testing Across Platforms (1).pptxHow AI Can Improve Media Quality Testing Across Platforms (1).pptx
How AI Can Improve Media Quality Testing Across Platforms (1).pptx
kalichargn70th171
 
Agentic AI Desgin Principles in five slides.pptx
Agentic AI Desgin Principles in five slides.pptxAgentic AI Desgin Principles in five slides.pptx
Agentic AI Desgin Principles in five slides.pptx
MOSIUOA WESI
 
Techdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk takerTechdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk taker
RajaNagendraKumar
 
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATIONAI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
miso_uam
 
Shortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome ThemShortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome Them
TECH EHS Solution
 
iOS Developer Resume 2025 | Pramod Kumar
iOS Developer Resume 2025 | Pramod KumariOS Developer Resume 2025 | Pramod Kumar
iOS Developer Resume 2025 | Pramod Kumar
Pramod Kumar
 
Intranet Examples That Are Changing the Way We Work
Intranet Examples That Are Changing the Way We WorkIntranet Examples That Are Changing the Way We Work
Intranet Examples That Are Changing the Way We Work
BizPortals Solutions
 
Custom Software Development: Types, Applications and Benefits.pdf
Custom Software Development: Types, Applications and Benefits.pdfCustom Software Development: Types, Applications and Benefits.pdf
Custom Software Development: Types, Applications and Benefits.pdf
Digital Aptech
 
Marketing And Sales Software Services.pptx
Marketing And Sales Software Services.pptxMarketing And Sales Software Services.pptx
Marketing And Sales Software Services.pptx
julia smits
 
War Story: Removing Offensive Language from Percona Toolkit
War Story: Removing Offensive Language from Percona ToolkitWar Story: Removing Offensive Language from Percona Toolkit
War Story: Removing Offensive Language from Percona Toolkit
Sveta Smirnova
 
Rebuilding Cadabra Studio: AI as Our Core Foundation
Rebuilding Cadabra Studio: AI as Our Core FoundationRebuilding Cadabra Studio: AI as Our Core Foundation
Rebuilding Cadabra Studio: AI as Our Core Foundation
Cadabra Studio
 
Optimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing SystemsOptimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing Systems
Insurance Tech Services
 
zOS CommServer support for the Network Express feature on z17
zOS CommServer support for the Network Express feature on z17zOS CommServer support for the Network Express feature on z17
zOS CommServer support for the Network Express feature on z17
zOSCommserver
 
Software Risk and Quality management.pptx
Software Risk and Quality management.pptxSoftware Risk and Quality management.pptx
Software Risk and Quality management.pptx
HassanBangash9
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdfBoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdfSecure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Northwind Technologies
 
Boost Student Engagement with Smart Attendance Software for Schools
Boost Student Engagement with Smart Attendance Software for SchoolsBoost Student Engagement with Smart Attendance Software for Schools
Boost Student Engagement with Smart Attendance Software for Schools
Visitu
 
Facility Management Solution - TeroTAM CMMS Software
Facility Management Solution - TeroTAM CMMS SoftwareFacility Management Solution - TeroTAM CMMS Software
Facility Management Solution - TeroTAM CMMS Software
TeroTAM
 
Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
Feeling Lost in the Blue? Exploring a New Path: AI Mental Health Counselling ...
officeiqai
 
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROIAutoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Autoposting.ai Sales Deck - Skyrocket your LinkedIn's ROI
Udit Goenka
 
How AI Can Improve Media Quality Testing Across Platforms (1).pptx
How AI Can Improve Media Quality Testing Across Platforms (1).pptxHow AI Can Improve Media Quality Testing Across Platforms (1).pptx
How AI Can Improve Media Quality Testing Across Platforms (1).pptx
kalichargn70th171
 
Agentic AI Desgin Principles in five slides.pptx
Agentic AI Desgin Principles in five slides.pptxAgentic AI Desgin Principles in five slides.pptx
Agentic AI Desgin Principles in five slides.pptx
MOSIUOA WESI
 
Techdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk takerTechdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk taker
RajaNagendraKumar
 
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATIONAI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
AI-ASSISTED METAMORPHIC TESTING FOR DOMAIN-SPECIFIC MODELLING AND SIMULATION
miso_uam
 
Shortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome ThemShortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome Them
TECH EHS Solution
 
iOS Developer Resume 2025 | Pramod Kumar
iOS Developer Resume 2025 | Pramod KumariOS Developer Resume 2025 | Pramod Kumar
iOS Developer Resume 2025 | Pramod Kumar
Pramod Kumar
 
Intranet Examples That Are Changing the Way We Work
Intranet Examples That Are Changing the Way We WorkIntranet Examples That Are Changing the Way We Work
Intranet Examples That Are Changing the Way We Work
BizPortals Solutions
 
Custom Software Development: Types, Applications and Benefits.pdf
Custom Software Development: Types, Applications and Benefits.pdfCustom Software Development: Types, Applications and Benefits.pdf
Custom Software Development: Types, Applications and Benefits.pdf
Digital Aptech
 
Marketing And Sales Software Services.pptx
Marketing And Sales Software Services.pptxMarketing And Sales Software Services.pptx
Marketing And Sales Software Services.pptx
julia smits
 
War Story: Removing Offensive Language from Percona Toolkit
War Story: Removing Offensive Language from Percona ToolkitWar Story: Removing Offensive Language from Percona Toolkit
War Story: Removing Offensive Language from Percona Toolkit
Sveta Smirnova
 
Rebuilding Cadabra Studio: AI as Our Core Foundation
Rebuilding Cadabra Studio: AI as Our Core FoundationRebuilding Cadabra Studio: AI as Our Core Foundation
Rebuilding Cadabra Studio: AI as Our Core Foundation
Cadabra Studio
 
Optimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing SystemsOptimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing Systems
Insurance Tech Services
 
zOS CommServer support for the Network Express feature on z17
zOS CommServer support for the Network Express feature on z17zOS CommServer support for the Network Express feature on z17
zOS CommServer support for the Network Express feature on z17
zOSCommserver
 
Software Risk and Quality management.pptx
Software Risk and Quality management.pptxSoftware Risk and Quality management.pptx
Software Risk and Quality management.pptx
HassanBangash9
 
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdfBoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
Ortus Solutions, Corp
 
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdfSecure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Northwind Technologies
 
Boost Student Engagement with Smart Attendance Software for Schools
Boost Student Engagement with Smart Attendance Software for SchoolsBoost Student Engagement with Smart Attendance Software for Schools
Boost Student Engagement with Smart Attendance Software for Schools
Visitu
 
Facility Management Solution - TeroTAM CMMS Software
Facility Management Solution - TeroTAM CMMS SoftwareFacility Management Solution - TeroTAM CMMS Software
Facility Management Solution - TeroTAM CMMS Software
TeroTAM
 

Microservices with Terraform, Docker and the Cloud. DevOps Wet 2018

  • 1. Managing Microservices using Terraform, Docker, and the Cloud Given by Derek C. Ashmore DevOps West – June 6, 2018 ©2018 Derek C. Ashmore, All Rights Reserved 1
  • 2. Who am I? • Professional Geek since 1987 • Java/J2EE/Java EE since 1999 • AWS since 2010 • Specialties • Refactoring • Performance Tuning • Yes – I still code! ©2018 Derek C. Ashmore, All Rights Reserved 2
  • 3. Discussion Resources • This slide deck – http://www.slideshare.net/derekashmore • The hands-on-lab code – https://github.com/Derek-Ashmore/terraform-hands-on-lab • The Moneta microservice (written in Java) – https://github.com/Derek-Ashmore/moneta • Slide deck has hyper-links! – Don’t bother writing down URLs ©2018 Derek C. Ashmore, All Rights Reserved 3
  • 4. Agenda Microservices, Docker, and the Cloud Cloud with Terraform Terraform’s Competitors Summary / Q&A ©2018 Derek C. Ashmore, All Rights Reserved 4
  • 5. What are Microservices? • No concrete definition • Common microservice traits – Single functional purpose • Most/all changes only impact one service • Not dependent on execution context – “loosely coupled” – Independent process/jvm – Stateless – Standard Interface (typically Web Service/REST) – Analogy: Stereo system, Linux utilities ©2018 Derek C. Ashmore, All Rights Reserved 5
  • 6. Microservices Application Architecture • Separate Databases • Eventual Consistency • More network activity ©2018 Derek C. Ashmore, All Rights Reserved 6
  • 7. Typical Microservice Library ©2018 Derek C. Ashmore, All Rights Reserved 7
  • 8. Microservice Development ©2018 Derek C. Ashmore, All Rights Reserved 8
  • 9. Docker • Is a “mini VM” • runs a linux kernal • Compare to shipping container • Standard “connections” to outside world • Supported formally by Oracle, Tomcat, Jboss, and many more 9©2018 Derek C. Ashmore, All Rights Reserved Package Once, Run Anywhere!
  • 10. Why Docker? • Docker is Win-Win – Easier for OPS and system administrators • All software looks the same • Standard interface for disk and network resources – Containers can be “linked” • Inherently automated – Easier for developers • Fewer environment difference issues • Less to communicate to OPS / system administrators • Easy to leverage work of others (docker-hub) ©2018 Derek C. Ashmore, All Rights Reserved 10
  • 11. Microservice Deployments ©2018 Derek C. Ashmore, All Rights Reserved 11
  • 12. Basic Microservice Install at AWS ©2018 Derek C. Ashmore, All Rights Reserved 12 • Horizontal scaling is supported • Multiple copies of microservice / web application running at the same time • Elastic Load Balancer distributes load across copies of your service • Sticky sessions available • ELB can use health checks • Autoscaling Groups scale number of copies up and down based on rules you give it • CPU Utilization or other metrics
  • 13. Infrastructure as Code • Manual changes – Increase errors – Increase unwanted differences between environments – Increase admin workload • Scripted/Coded changes – Larger upfront cost, but….. – Less busywork – Leverage Others Work – Decreases Errors – Errors fixed in one place – Eliminates unwanted differences – Change history (with source control) ©2018 Derek C. Ashmore, All Rights Reserved 13
  • 14. Agenda Microservices, Docker, and the Cloud Cloud with Terraform Terraform’s Competitors Summary / Q&A ©2018 Derek C. Ashmore, All Rights Reserved 14
  • 15. Terraform • Cloud Management – Open Source • Very active community – Extensible to any cloud vendor • AWS, Azure, GCP, AliCloud, Digital Ocean, OpenStack – Supported for Cloud Support products • Chef, Consul, Kubernetes, Datadog • 62 Providers as of April, 2017 and growing ©2018 Derek C. Ashmore, All Rights Reserved 15
  • 16. Terraform HCL • Declarative Language – Describe what the end product contains • Terraform figures out how to get there – Terraform Resources • Describes deployed artifacts – Network  Virtual Networks, Subnets, Network ACLs, Gateways, ELB/ALB – Hosts  Virtual Machines, Databases – Security  Security groups/policies/roles/groups/users – Much more ©2018 Derek C. Ashmore, All Rights Reserved 16
  • 17. Terraform Basics • Declarative Programming – All *.tf files loaded  Terraform decides execution order – No GUI  All command line and text editor • Terraform Command Flow ©2018 Derek C. Ashmore, All Rights Reserved 17
  • 18. Terraform Resources • AWS Subnet Resource – Count = 3  Three subnets created – Availability Zones come from a data source (lookup) – CIDR blocks are input variables • Sample source ©2018 Derek C. Ashmore, All Rights Reserved 18
  • 19. Terraform Data Sources • Example Data Sources (lookups) • Sample source ©2018 Derek C. Ashmore, All Rights Reserved 19
  • 20. Terraform Providers • Example Provider • Sample AWS source • Azure Provider ©2018 Derek C. Ashmore, All Rights Reserved 20
  • 21. Terraform Input Variables • Example Provider • Sample source ©2018 Derek C. Ashmore, All Rights Reserved 21
  • 22. Reusing Terraform Templates • Example Template Reuse • Sample source ©2018 Derek C. Ashmore, All Rights Reserved 22
  • 23. Typical Project Structure ©2018 Derek C. Ashmore, All Rights Reserved 23
  • 24. Terraform State • Terraform stores state – Local file terraform.tfstate • Teams need to manage state centrally – Terraform Backends • Locks so that only one person at a time can update • Remote storage – S3, Azure containers, Google cloud storage, etc. ©2018 Derek C. Ashmore, All Rights Reserved 24
  • 25. Agenda Microservices, Docker, and the Cloud Cloud with Terraform Terraform’s Competitors Summary / Q&A ©2018 Derek C. Ashmore, All Rights Reserved 25
  • 26. Terraform vs. Ansible/Chef • Terraform designed for infrastructure – Not designed for configuration management – Terraform deploys images • Not good at maintaining what’s on those images • If deployments update existing VMs – You need Ansible, Chef, or Puppet • If deployments are “new” VMs – Terraform can handle deployments too ©2018 Derek C. Ashmore, All Rights Reserved 26
  • 27. Paradigm Shift • Deployment as new infrastructure – New version  new VMs • Software versions baked into images – Advantages • Facilitates Canary Deployments – Route53 Routing Policies • Go-live operation has less risk – Deploy/Backout is just a load balancer switch – Disadvantages • More moving parts • Impossible to do manually ©2018 Derek C. Ashmore, All Rights Reserved 27
  • 28. Terraform vs CloudFormation Terraform • Scripting skills translate to Azure, Google Cloud, etc. • Less verbose (>50%) • Data Lookups • Custom Plug-ins possible • Active Community Support CloudFormation • Quicker to follow AWS enhancements • GUI support • Automatic centralized state • Vendor Support ©2018 Derek C. Ashmore, All Rights Reserved 28
  • 29. Further Reading • This slide deck – http://www.slideshare.net/derekashmore • The Gruntwork Blog – https://blog.gruntwork.io/ • The hands-on-lab code – https://github.com/Derek-Ashmore/terraform-hands-on-lab ©2018 Derek C. Ashmore, All Rights Reserved 29
  • 30. Questions? • Derek Ashmore: – Blog: www.derekashmore.com – LinkedIn: www.linkedin.com/in/derekashmore • Connect Invites from attendees welcome – Twitter: https://twitter.com/Derek_Ashmore – GitHub: https://github.com/Derek-Ashmore – Book: http://dvtpress.com/ ©2018 Derek C. Ashmore, All Rights Reserved 30