DevOps Classroom Series – 07/Jan/2021
Lets bring up the hosted chef
- Navigate to https://manage.chef.io/login and create account if you down thave.
- Login into hosted chef
- Ensure you have organization created
- We have the chef infra server which is hosted and free of usage till 5 nodes
- Now lets move to workstation and install chef dk (chef development kit)
- Refer Here for the chef dk
- Installing chefdk using chocolatey on windows (choco install chefdk -y)
- Once installation is complete close and relaunch powershell terminal and execute
chef --version
- Once installation is complete close and relaunch powershell terminal and execute
- Chef Server has to be linux machine
- Chef Workstation can be linux/mac/windows
- Chef node can be linux/mac/windows/network switch/router
- Now we need to configure nodes. Configuring nodes is
- install chef-client software on the node
- setting up private/public key communication b/w chef server and node
- Now we need to install chef-client and setup authentication b/w server and node. This process is called as bootstrapping
- Generally bootstrapping is done from workstations.
- To bootstrap from chef workstation we need
- chefdk to be installed
- chef starter kit to be downloaded on workstation
- Download the chef repo and extract it. The basic folder structure will be as shown below
- Now lets look into .chef folder there will be a
- .pem file which is a private key for enabling authentication with chef server
- config.rb which has information about server
- Chef dk has many tools, one of the tool which we start with is knife
- If you are executing any chef dk tool which requires you to interact with chef server, ensure you are operating from extracted chef starter kit (chef-repo)
- Create one ubuntu 18.04 server in aws (which will be node 1)
- Ensure you are able to connect to node from workstation
- Basic workflow of bootstrap
- find the help from command line
knife --help
knife bootstrap --help
![Preview](https://i2.wp.com/directdevops.blog/wp-content/uploads/2021/01/chef21.png?w=800&ssl=1)
- Finding help from chef documentation Refer Here
- Build a bootstrap command and execute
knife bootstrap ec2-54-214-197-70.us-west-2.compute.amazonaws.com -U ubuntu -i ~/Downloads/cheflearning.pem --sudo -N awsnode1
![Preview](https://i1.wp.com/directdevops.blog/wp-content/uploads/2021/01/chef22.png?w=800&ssl=1)
![Preview](https://i1.wp.com/directdevops.blog/wp-content/uploads/2021/01/chef23.png?w=800&ssl=1)
![Preview](https://i0.wp.com/directdevops.blog/wp-content/uploads/2021/01/chef24.png?w=800&ssl=1)
![Preview](https://i2.wp.com/directdevops.blog/wp-content/uploads/2021/01/chef25.png?w=800&ssl=1)
![Preview](https://i2.wp.com/directdevops.blog/wp-content/uploads/2021/01/chef26.png?w=800&ssl=1)
- Exercise: Bootstrap atleast one linux node (Centos/Ubuntu/Redhat)
- Next Steps:
- We will bootstrap one redhat family linux node (From azure)