Infrastructure as Code
(IaC)
Jennifer Strejevitch jenniferstrej@gmail.com
IaC enables you to
- Treat infrastructure as Software
- Quickly re-provision any 'broken' resource (crashed server, etc.)
- Scale up and down your infrastructure through Cloud providers
- Spin up/down an exact replica stack for testing
Popular tools that helps us achieve that
- Terraform
- Kubernetes cluster management tools (kops, tectonic) - if you're using docker
- Configuration Management tools (ansible, saltstack)
Pros
- Supported by many providers
- Friendly JSON configuration interface
- Preview of changes
- Versioned infrastructure
- Quick to learn and produce something
Cons
- a bit hard to debug when trying to refactor as it gets more complex
- error messages can be difficult to interpret
- still version 0.x.x
Terraform
kops (Kubernetes)
CM tools
Although a lot of the job once done by Configuration Management tools is being better handled with IaC tools, they are still one of the best option for gluing things together
Permissions
Network
Databases
Servers
Clusters
(Container) scheduling
Load Balancers
Package installation
Configuration files
Environment variables
Iac Provisioning
Configuration Management
Abstration and separation
Containers
Quick demo
- Containerised Node app
- Use terraform to create a user for kops with required permissions
- Use kops to create a k8s cluster
- Deploy the application to k8s
- Expose it to world through a LB
- Associate DNS name to LB
- Destroy everything
Infrastructure as Code(IaC)
By Jennifer Strejevitch
Infrastructure as Code(IaC)
- 55