Bootstrapping EC2 Instances with Chef
This is a guest post from 47Line TechnologiesIn the previous blogs, we introduced Chef and set up the Chef Server, Workstation on EC2 instances...Learn More
This is a guest post from 47Line Technologies
As explained in the last blog post, Chef comprises of three main elements – a server, one or more nodes, and at least one workstation.
In this blog post, we will set up
Download the Chef server from the main website, and select the appropriate package as shown below
Launch an instance of Ubuntu Server 12.04 LTS (PV) – ami-3c39686e (64-bit) in your AWS account and SSH to the server with the key file and username ubuntu
# switch to home folder cd ~ # Download the Chef Server Package wget https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef-server_11.0.10-1.ubuntu.12.04_amd64.deb # Install the Chef Server sudo dpkg -i chef-server* # reconfigure the service for your machine sudo chef-server-ctl reconfigure
After the above step, you can access the web interface by typing https:// from your browser. Because the SSL certificate is signed by an authority not recognized by your browser, you will get a warning. Click on the “Proceed anyway” button. Ensure port 443 is open in the security group associated with the server.
Login with the default admin credentials
username: admin password: p@ssw0rd1
Kindly change the default password immediately after logging in for the first time!
The first step in setting up the workstation is to install git or any other VCS of your choice. Chef community heavily uses git.
sudo apt-get update sudo apt-get install git # Download and run the client installation script from the Chef website. curl -L https://www.opscode.com/chef/install.sh | sudo bash
The Chef package is now installed. The next step is to clone the chef-repo skeleton directory.
cd ~ git clone https://github.com/opscode/chef-repo.git
This will create a directory called chef-repo in your home directory. This is where the entire configuration will be contained.
Create a .chef directory inside chef-repo to save the authentication and configuration files.
Login to the Chef Server (https://<<ElasticIP of the Chef Server>>) with the admin credentials.
Click on the “Clients” tab in the top navigation bar.
Click on the “Edit” button associated with the chef-validator client. Regenerate the private key by selecting that check box and clicking “Save Client”
Copy the private key and save it in the chef-validator.pem file in ~/chef-repo/.chef directory.
Similarly Click on the Users tab in the Navigation bar, Click on the Edit hyperlink associated with admin user and regenerate the private key.
Copy the private key and save it in admin.pem file in ~/chef-repo/.chef directory
Next step is to configure the knife command
Knife is a command-line tool that provides an interface between a local chef-repo and the Chef server. Knife helps provisioning resources, manage recipes/cookbooks, nodes & more.
knife configure –initial
The command will prompt you for the path to pem files, server URL, username and password.
Add the .chef directory to be ignored in the .gitignore list.
Setup your email and name with git and add the ruby embedded with chef path to PATH variable.
To ensure everything is fine, run the “knife user list” command. It will list all the users.
In the next blog, we will look into bootstrapping EC2 instances with Chef.
Learn how Aviatrix’s intelligent orchestration and control eliminates unwanted tradeoffs encountered when deploying Palo Alto Networks VM-Series Firewalls with AWS Transit Gateway.Deploying any next generation firewall in a public cloud environment is challenging, not because of the f...
Use AWS Config the Right Way for Successful ComplianceIt’s well-known that AWS Config is a powerful service for monitoring all changes across your resources. As AWS Config has constantly evolved and improved over the years, it has transformed into a true powerhouse for monitoring your...
Cloud Academy is a proud sponsor of the 2019 AWS Summits in Atlanta, London, and Chicago. We hope you plan to attend these free events that bring the cloud computing community together to connect, collaborate, and learn about AWS. These events are all about learning. You can learn how t...
The AWS cloud platform has made it easier than ever to be flexible, efficient, and cost-effective. However, monitoring your AWS infrastructure is the key to getting all of these benefits. Realizing these benefits requires that you follow AWS best practices which constantly change as AWS...
Amazon Web Services’ resource offerings are constantly changing, and staying on top of their evolution can be a challenge. Elastic Cloud Compute (EC2) instances are one of their core resource offerings, and they form the backbone of most cloud deployments. EC2 instances provide you with...
Before migrating domains to Amazon's Route53, we should first make sure we properly understand how DNS worksWhile we'll get to AWS's Route53 Domain Name System (DNS) service in the second part of this series, I thought it would be helpful to first make sure that we properly understand...
As businesses expand their footprint on AWS and utilize more services to build and deploy their applications, it becomes apparent that multiple AWS accounts are required to manage the environment and infrastructure. A multi-account strategy is beneficial for a number of reasons as ...
AWS's WaitCondition can be used with CloudFormation templates to ensure required resources are running.As you may already be aware, AWS CloudFormation is used for infrastructure automation by allowing you to write JSON templates to automatically install, configure, and bootstrap your ...
Massive migration to the public cloud is changing architecture patterns, operating principles, and governance models. That means new approaches are vital to get a handle on soaring cloud spend. Because the cloud’s short-term billing cycles call for financial discipline, you must empower...
As companies increasingly shift workloads to the public cloud, cloud computing has moved from a nice-to-have to a core competency in the enterprise. This shift requires a new set of skills to design, deploy, and manage applications in cloud computing.As the market leader and most ma...
As Head of Content at Cloud Academy I work closely with our customers and my domain leads to prioritize quarterly content plans that will achieve the best outcomes for our customers.We started 2018 with two content objectives: To show customer teams how to use Cloud Services to solv...
“Add GPU acceleration to any Amazon EC2 instance for faster inference at much lower cost (up to 75% savings)”So you’ve just kicked off the training phase of your multilayered deep neural network. The training phase is leveraging Amazon EC2 P3 instances to keep the training time to a...