Creating and maintaining different environments can be difficult and a real time-sink. We'll see in this talk how you can automate this tasks by building and updating your development and production environments on demand using Chef, Vagrant, Docker and Amazon Web Services.
2. Who I am
● Oswald De Riemaecker
● Continuous S.A. CEO & Co-Founder
o Agile Delivery specialist
o Editor of the continuousphp PaaS
● « Agilist », Cloud Architect
3. Agile Culture
● Improvement in the development team
o Better collaboration
o Continuous improvement
o All skills / No silos
o Testing Framework and continuous integration
● Improvement in Agile product management
o Iterative development
o Features driven
o Maximizing Value
o MVP/Lean Startup
4. DevOps Culture
● Agile + Operation
● 3 main pillars:
o Infrastructure as Code (IaC)
o Continuous Delivery / Deployment
o Culture of cooperation
5. Infrastructure as Code
● Coding machines resources of the infrastructure
● Coding and versioning the infrastructure
● Testing both resources and infrastructure
● On demand rebuilding machines and infrastructure
10. Complexity
● Maintaining infrastructure is complex
● It lives and evolves, so you have to
o Add new resources
o Update resources
o Apply Security Patches
o Change/Update OS
o ...
12. Chef
● Chef is an open-source tool
● Management of automation systems and infrastructure
● Chef is based on Ruby
13. Chef
● Nodes represent the servers within your infrastructure
● Nodes can be:
o physical servers
o virtual servers
o instances in the cloud
● Each node belongs to:
o an organization
o an environment
o has one or more role(s)
Node
NodeNodeNode
Node Node
14. Chef Client / Server
Node
NodeNodeNode
Node Node
Chef
Server
chef-client
Resources
15. Chef Cookbooks
● The cookbooks contain artifacts of our resources
Recipes
Templates
Files
Attributes State of the resources
16. Chef Cookbooks
● The cookbooks contain artifacts of our resources
Recipes
Templates
Files
Attributes State of the resources
Installation / configuration of resources
17. Chef Cookbooks
● The cookbooks contain artifacts of our resources
Recipes
Templates
Files
Attributes State of the resources
Installation / configuration of resources
Configuration templates
18. Chef Cookbooks
● The cookbooks contain artifacts of our resources
Recipes
Templates
Files
Attributes State of the resources
Installation / configuration of resources
Configuration templates
Configuration/script files
23. Apache Cookbook Analysis
● Support many platforms
● Support different Apache versions
● Attributes:
o dir, docroot_dir
o log_dir, error_log, access_log
o default_modules
o version
o ...
24. Cookbook support and dependencies
Recipes
Templates
Attributs
Files
Metadata
Dependancies
50. ● Cookbooks by role of our infrastructure
● Specific Cookbook for our development environment
o uses the cookbooks of our infrastructure roles
● We can reliably reproduce our infrastructure roles, it is:
o Coded
o Versioned
o Tested
o Deployed
Provisioning Summary
53. Vagrant
● Create and set up development environments
● Providers (Drivers)
o Virtualbox/VMWare
o Docker
o Instance EC2
● Provisioning with:
o Chef Client/Solo
o Docker
o Puppet Agent
o …
57. Immutable Infrastructure
● Benefits:
o Saving time when supplying
o No more maintenance of the servers => Replacement
o Static machine Image pre-built and tested
o Easy rollback to a previous version
V1
V2
V3
Data
58. Packer
● Packer
o Builders (Amazon AMI, Microsoft Azure, DigitalOcean, Docker,
Google Compute Engine, …)
o Provisioners (Shell script, Chef client, Ansible, Puppet, Salt, …)
o Post-processor (Docker-push, Vagrant, Atlas, …)
65. AWS CloudFormation
● Easy way to create and manage an AWS resource
● CloudFormation takes care of dependencies
● Once the resources are deployed, you can edit and update in a predictable and
controlled manner
● AWS CloudFormation supports the following resources:
o Auto Scaling/Elastic Load Balancing
o VPC
o EC2
o RDS
o IAM
o …
77. ● Machines Provisioning
● Immutable Infrastructure
o Static Machine Images
● Using Machine Images in AWS Cloud Formation
● Cloud Formation environment parameters
● We can now use our artifacts to build our different environments
Infrastructure Summary