You can, for example, to deploy an an Auto Scaling groups consists of web severs, ELB and DB using AWS CloudFormation (with Chef server): http://aws.amazon.com/cloudformation/aws-cloudformation-templates/
But, you need to initially create a CF template, is it possible to do it only using Chef Server and Knife? We don't want to rely much on the CloudFormation and seems the hosted Chef server at (http://www.opscode.com/) is able to do so.
Any opensource alternative?
Thanks.
You can auto scale your EC2 instance. Check this post, but before doing it have read this discussion. I am currently using chef for configure my ec2 instaces and cloudformation for amazon resources set up. Recetly CloudFormation has integrated chef. I am using Cloud formation and chef both and it works well for me.
You could use the knife ec2 plugin to create and delete ec2 instances, but it won't create the full range of resources (ELB, Route 53 RecordSet, security groups, etc.) that you can use cloud formation to support. So you would either need to create these manually, or build your own policy based scaling code that would respond to alerts by your monitoring infrastructure that would cause ec2 instances to be provisioned and de-provisioned using chef.
There is also a knife cfn plugin that allows you to create and delete cloud formation stacks using knife.
If you are relying on AWS, I think cloud formation templates will help you orchestrate your chef deployments nicely. Beyond that, the templates fit nicely into the "infrastructure as code" mantra. Using Chef your infrastructure will be specified in code. It would be a shame to keep all the scaling policies which could be turned into code/CFN templates out of your source code control system. The template format has also been adopted by third parties such as Cloudsidekick so it could be relevant for deploying to other cloud providers beyond AWS.
From I have gleaned, you should be able to do this:
Create a custom AMI that has
chef-client
installed, and have your organization's validation cert, but not a client cert, that will auto-register on the first invocation ofchef-client
, and register the new node.Use this custom AMI with a new Auto Scaling Launch Config, and then proceed with the rest of regular Auto Scaling steps.
The challenge, I think, is how do you have a newly created and registered instance inform Chef Server that "I want to be a new type of XXXX server". It doesn't look like there's a flag from chef-client to send that to chef server, and automatically associate itself with roles, etc.
So it seems that Auto Scaling can indeed be done without the use of a CloudFormation template, I just don't see how the Auto Scaling would work with Chef.