This document discusses using Chef and Vagrant to build cloud computing infrastructure. It introduces infrastructure as code and configuration tools like Chef for automating infrastructure provisioning and configuration. It outlines the workflow for setting up Chef including installing prerequisites, configuring a Chef server, uploading cookbooks, and using tools like Vagrant and knife plugins to test recipes locally and deploy to clouds.
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
IaaS with Chef
1. Build Cloud Computing
Infrastructure with Chef and VagrantInfrastructure with Chef and Vagrant
General Discussion
Richard Kuo, Professional-Technical Architect,
Cloud Realization, New Technology Product Development Engineering
2. Outline
• Infrastructure As Code
• Configuration Tools
• Cookbook Structure
• Local Cloud and Remote Cloud• Local Cloud and Remote Cloud
• Sample Code
• References
6/21/12 Creative Common BY-NC-SA 2
3. Infrastructure As Code
• Modularized, reusable document
• Change control
• Reflect the change of business environment
• Programmatically provisioning & configuration• Programmatically provisioning & configuration
6/21/12 Creative Common BY-NC-SA 3
5. Why Configuration Tools
• Automation
• Reduce management complexity
• Version control programs
• Generate configuration• Generate configuration
• Maintain the state of resources
6/21/12 Creative Common BY-NC-SA 5
6. Work Flow
• Install version control - git; https://github.com/
• Install RVM then Ruby;
• Install RubyGems;
• Register an Hosted-Chef Platform account, and download credentials and default configuration file:
knife.rb; (optional-local chef-solo)
• Register account on cloud provider and download the credentials.
• Install configuration tool - Chef; http://wiki.opscode.com/display/chef/Installation
• Move credentials .chef directory and modify knife.rb; and test connectivity to chef-server;
• Setup client-configuation, by executing “knife configure client ./client-config”, and check it diff• Setup client-configuation, by executing “knife configure client ./client-config”, and check it diff
between ORGNAME-validator.pem and validation.pem; make a copy to /etc/chef/; copy ORGNAME-
validator.pem to ~/.ssh/validation.pem;
• Install knife plugins for different cloud providers, i.e. knife-ec2, knife-rackspace, etc;
• Install Vagrant;
• Create a workspace by cloning chef-repo; go under chef-repo, create .chef directory; git init with
github;
• Download/clone cookbooks, modify recipes;
• Upload cookbooks to (Hosted-)Chef Server;
• Test recipe locally with Vagrant;
• Create node per image #; bootstrap node and create infrastructure.
6/21/12 Creative Common BY-NC-SA 6
7. Install Chef with Hosted-Chef Server
6/21/12 Creative Common BY-NC-SA 7
13. Create a Server in EC2
knife ec2 server create #use knife-ec2 to create a server
- r “role[webserver]” #use recipe in role “webserver”
- i ami-2d4aa444 –flavor m1.small #use image and settings here
- g TestChef, default #use security group defined in ec2
- x ubuntu #user name is ubuntu
- n server01 #server name is server01- n server01 #server name is server01
6/21/12 Creative Common BY-NC-SA 13