DevOps Classroom Series – 26/Aug/2020

Chef Architecture

  • Chef architecturally has 3 different kinds of systems
    • Chef Server:
      • This is Chef Configuration Management Server
      • Has to be a linux instance
    • Chef Clients
      • This is node where you want to deploy applications. The software/agent which we install on these nodes is called as chef_client
      • Can be a
        • Linux
        • Windows
        • Mac
        • Unix
        • Network Switches or Routers
    • Chef Workstation:
      • This is system used by engineers who develop/author chef configurations (cookbooks)
      • This system will have all the necessary tools to upload the configurations to chef server, test the configurations etc
      • Can be
        • Linux
        • Windows
        • Mac
      • The software installed on chef workstation is referred as chefdk (Chef development kit) which comes with all the necessary tools Preview
  • Basic workflow
    • DevOps Engineer develops chef configuration on workstation
    • Uploads the chef configuration to Chef Server
    • Informs on which clients this configuration has to be applied to Chef Server
    • When the chef_client (node) speaks with chef server, server responds with configuration developed by DevOps Engineers

One-Level Deeper into Chef Architecture

  • Chef-Server will be communicated by the node or chef_client. To do this chef_client software has to be installed on the node. This process is called as bootstrapping
  • Bootstrapping will be done from chef workstation initially, once we are comfortable we can automate bootstrapping
  • Initially we will be installing and configuring chefdk on the workstation, Then we will be using this workstation to help in bootstrapping the node.
  • Once bootstrapped the chef_client agent software on the node will communicate to chef server asking for any configurations to be applied. This is called as convergance. The default Convergence period is every 30 mins (Which can be changed) Preview

What will the configuration of Chef look like?

  • Chef uses terminologies of a chef cooking so that others can re use or re cook using the books he develops. Preview
  • We will be developing cookbooks which is collection of recipes
  • Recipe will have a sequence of resources
  • Resource in chef is a smallest unit of automation where you express desired state

Our Lab Setup

  • Workstation:
    • This would be your laptop
    • Here we need softwares which are
      • GitBash
      • Visual Studio Code
    • For installing them refer here
  • Chef Server:
    • We will be using hosted chef server which is free till 5 nodes/chef_clients initially & Then we will install our own chef server.
    • Create an account in here Preview
  • Chef Clients
    • We will be using AWS or Azure free trail cloud accounts to create chef-clients
    • For creating Azure free Account Refer Here or AWS Free TierRefer Here
    • Here we will start with ubuntu, RedHat and then to windows instances

Next Steps

  • Setting up workstation
  • Configuring workstation to use hosted chef as chef server
  • Bootstrapping a node
  • Create a simple cookbook

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin