By expanding support to newer platforms and plugins, Chef Workstation not only replaces ChefDK but also adds on to its functionality, and now provides a comprehensive solution that merges all the previous features along with new ones.
But what does this mean? Why should one switch?
- Simplicity. Intended to be a single tool for managing infrastructure in its entirety unlike ChefDK which provides a collection of tools. Easily create and upload cookbooks, manage nodes, run chef client or any task required manage the chef infrastructure. Workstation also makes it easy for new users to learn and get used to the product quicker.
- Productivity. With the all-inclusive approach,
you need not juggle between various tools to complete tasks. By using a single interface, users can save time on finishing tasks. Built in tools like ChefSpec unit testing framework aids users in conducting faster cookbook tests.
- Better security. Using encrypted data bags by default, storing sensitive data in an encrypted format using chef-vault, encrypting data transmissions between Chef and its clients using SSL/TLS makes workstation a safer, secured option
in contrast to ChefDK.
- Improved collaboration. Features such as ‘berks’, which manages cookbook dependencies, allowing users to easily share cookbooks with others, make it easier to collaborate with others on chef infrastructure. In addition,
Git and other source control management systems are supported natively by Workstation, allowing users to collaborate on infrastructure modifications.
- Easier upgrades. Chef Workstation makes updating to new versions of Chef easier by enabling users to do it with a single command. The latest version of Chef and all necessary dependencies are downloaded and installed by Workstation automatically after the update command has been executed. Users can stay up to date with the newest security updates and functionalities thanks to this simplified technique.
Follow these steps to upgrade from ChefDK
Step 1 - Download and install Chef Workstation from the Chef website. You will be led through the installation process by the installer, which will also install all necessary components.
1.1 You can verify the version by running
Step 2 - If you were using ChefDK prior to this, upon installing Chef Workstation, all of your existing projects will be migrated.
If you are setting up chef for the first time however, you will need a Chef Infra repository for saving your cookbooks and projects.
Follow these steps to do the same or alternatively, refer to the official documentation on Getting started with Chef Workstation.
Step 1 - Download and install the Chef Workstation on your system.
Step 2 - If ruby is primarily being used for developing Chef policy, it is recommended to use the Chef workstation ruby as your default system ruby. Skip this step otherwise.
echo 'eval "$(chef shell-init <shell rc>)"' >> ~/.<shell rc>rc
Step 3 - If you are setting up chef for the first time in your organization, set up a chef infra repository by using the command
chef generate repo chef-repo
.pemformat using the RSA encryption algorithm.
Step 5 - The
.chef directory is important for Chef users as it contains the credentials file that allows them to communicate with the Chef Infra Server. To create this file, they need to run the knife configure command and provide specific details such as the Chef Server URL and Client Name, which are usually provided by the server administrator. Users can find this information in the Starter Kit file, which is available for download in the Administration tab for Hosted Chef or Chef Manage users. The Starter Kit also contains the
config.rb file that users can use to configure their connection:
Step 6 - Run
cp ~/Downloads/MY_NAME.pem ~/.chef/to copy the
client.pemfile to the .chef directory
knife client list
knife ssl fetch