1. 程式人生 > >Using AWS OpsWorks for Chef Automate in a federated environment

Using AWS OpsWorks for Chef Automate in a federated environment

Many large enterprises operate on a federated model. That is, they are separated into different business units or organizations, with different goals, procedures, and skill sets. These enterprises typically use a system to manage their infrastructure configuration and changes.

You might ask, “Can we apply a federated model to configuration management? If so, what are the pros and cons and how does AWS OpsWorks for Chef Automate fit into that model?”

In this blog post we discuss how to approach configuration management in a federated enterprise.  The main focus is on how you can leverage AWS OpsWorks for Chef Automate to achieve this goal.

Single Chef server to serve all parts of your organization

Approaching configuration management in a non-federated way involves using a single Chef server across many different business units.

But, I hear you say, “Different business units have their own Chef nodes, cookbooks, and environments. How do we separate those?”

The way you can achieve this with Chef is to use the concept of Chef Organizations, which is a core part of the Chef Server software.

Chef Organizations allows you to separate the following items among different business units, but they still reside on a single Chef server:

  • Permissions
  • Nodes
  • Roles
  • Environments
  • Cookbooks
  • Data bags

The main benefits of this approach is that each business unit can independently manage its own nodes, access permissions, and can perform maintenance/updates on its infrastructure on its own schedule. Having this type of isolation allows the business units/organizations to have access to their own unique environments, roles, data bags, and cookbooks. Additionally, by hosting all of this on a single server you reduce the amount of effort required to set up and maintain a separate Chef server for each business unit.

Single Chef Server Model

Single Chef server per business unit

When we speak about a model for a true federated approach to configuration management, we imply that each of the company’s business units/organizations has its own separate Chef server. This brings us the same benefits that we get when we use Chef Organizations, but with even greater isolation between the business units. This brings more benefits when in the cloud.

“What are these new benefits you speak of?”

Well, it is very common to have different business units, each with its own respective AWS Account, for all of their resources. This approach is used for billing. It gives us a clear separation of resource usage per business unit. If each business unit uses a Chef server in a centralized AWS account, billing and management of that resource can get out of hand. Another major benefit, which is not strictly cloud related, is that the maintenance of the Chef server and the potential downtime it experiences, does not cause disruptions across all organizations and their infrastructure. By having a Chef server for each business unit you can mitigate the issue of having a single point of failure. If you rely on a single Chef server throughout your enterprise, that server’s failure would cause potential down time across all business units. By using multiple Chef servers you reduce the blast radius of potential Chef server down time.

Federated model/Multi Chef Server

Additionally, the concept of Chef Organizations can be fully utilized even in a federated model. For example, if a certain business unit wants to separate even further, it can split its own Chef Automate server into organizations. The nodes from all organizations will be visible on the Chef Automate dashboard because you can filter nodes based on Chef Organizations.

“But what happens to our cookbooks? Does each business unit need to write its own?” To answer these questions, let’s take a look at Centralized Cookbook repositories.

Centralized Cookbook repositories

A great way to make all of your configurations as consistent as possible is to have a companywide Cookbook repository. This means that teams/business units can use cookbooks created by other parts of the company to configure their infrastructure – on their respective Chef Servers. This, in turn, reduces the effort required to start using Chef as a configuration management system in a business unit because most of the required code base is already present. So, for example, let’s say that business unit A writes its own cookbook for setting up an application, and business unit B also uses the same application in their own environment. Business unit B does not have to write its own cookbook from scratch, but can use the cookbooks already created by business unit A. The main obstacle to having a shared cookbook system is properly writing cookbooks in the first place. Each cookbook must be as dynamic as possible. When you write a cookbook, leverage attributes, templates, and data-bags as much as possible so you can be flexible and help other teams use the same cookbook for,  their use cases.

“So what kind of Cookbook repos can we use?”

Git repo

The simplest approach to centrally managing your cookbooks is to use  Git repositories. Yes, simple as that. You can use the Berkshelf tool to manage the cookbooks, but instead of pulling them from the Chef supermarket, it pulls from the Git repo. With Berkshelf, you can specify a certain cookbook version to be pulled. In addition, because Berkshelf supports specifying a repository branch, you can even select a specific branch of your cookbook repo, for example, a certain testing branch to be used in a Dev environment.

Berksfile example:

cookbook "buk-cookbook", "~>; 0.9.3", git: "https://github.com/example/buk-cookbook.git"
cookbook "jinar-cookbook", "~>; 0.2.4", git: "https://github.com/example/jinar-cookbook.git", branch: "my-test-branch"

As mentioned before – you can have centralized Cookbook Git repositories across the entire company. Then each team could create its own repositories and push cookbooks – which could, in turn, be used by everyone in the company.

Common GIT repositories for cookbooks

“But–hey – at the beginning of this blog post you mentioned that one of the benefits of using a single Chef server is not needing to configure and maintain each server separately. Doesn’t having too many Chef servers give us a lot of overhead?”

How does OpsWorks for Chef automate fit into all of this?

AWS OpsWorks for Chef Automate (OWCA) provides a fully managed Chef server and suite of automation tools, which compose Chef Automate. OpsWorks for Chef Automate offers you a consistent Chef server configuration throughout all deployed servers. All servers are deployed and bootstrapped by OpsWorks, so this means that each new server will be configured in the same way. Additionally, OpsWorks takes care of the Chef server maintenance in the form of server patching, minor Chef updates, and backups. That means that you do not have to spend time and effort in order to set-up and configure a Chef Automate server. You can just let OpsWorks handle that for you, and have your business units focus all their energy on writing or using Chef cookbooks in their environments.

The fact that OpsWorks handles patching means that you don’t need to connect to the Chef server using SSH. You only  need to use knife to manage your Chef server software. With backup and restore in place, you can easily revert back to a working version of your server if something goes wrong.

A 10 000 foot view of setting up OWCA for a business unit would look something like this:

  • Launch an OWCA server in the desired Region with the desired instance size.
  • Take the starter kit provided with the Chef Automate server to be used on a Chef Workstation.
  • Once the server is fully running, dministrators can use the Chef Workstation to create all the required resources:
    • Environments
    • Roles
  • Set Berkshelf to get the needed Cookbooks from a common repository, and have them installed on the Chef Automate server.
  • Finally, bootstrap nodes in the appropriate roles. The usage of AWS API can be applied here, as OpsWorks can handle node bootstrapping for you.

Simple as that! You don’t need to manually configure Chef servers. You  just  launch an OpsWorks for Chef Automate server, and the rest is just Cookbook and node management.

Summary

Here we have discussed how to implement a federated model for configuration management using Chef and OpsWorks. We described how simple it is to set up and maintain a Chef server with OpsWorks. Many of our customers are actually taking this direction when using OpsWorks for Chef Automate because it allows them to separate their teams but still maintain a common set of configuration rules across the entire enterprise. With the assistance of the AWS API to bootstrap nodes this allows you to spend less time worrying about setting up the configuration management infrastructure and more on creating and using Cookbooks and any other Chef resources you need.

About the Author


Darko Meszaros is a Cloud Support Engineer who supports customers that use various AWS automation tools, such as AWS OpsWorks, AWS CodeDeploy, and AWS CloudFormation. He is a subject matter expert for OpsWorks and CodeDeploy. Outside of work, he loves collecting video games and old computers.

相關推薦

Using AWS OpsWorks for Chef Automate in a federated environment

Many large enterprises operate on a federated model. That is, they are separated into different business units or organizations, with different go

Distributing your AWS OpsWorks for Chef Automate infrastructure

Organizations that manage many nodes over larger geographical AWS Regions may wish to reduce latency and load between nodes in their AWS OpsWorks

AWS OpsWorks for Chef Automate Features

The Chef server acts as the hub for configuration data and distributes information about desired configurations to nodes. It stores your cookbook

AWS OpsWorks for Chef Automate FAQs

Q: What is AWS OpsWorks for Chef Automate? AWS OpsWorks for Chef Automate provides a fully managed Chef server and suite of autom

AWS OpsWorks for Chef Automate Pricing

You pay an hourly rate for each running EC2 instance or on-premises server that is registered with your Chef server as a node. For example, if you

AWS OpsWorks for Chef Automate Resources

API REFERENCES Describes the API operations for AWS OpsWorks for Chef Automate in detail. In addition, it provides sample requests, re

AWS OpsWorks for Chef Automate 定價

對於作為節點註冊到您的 Chef 伺服器的各個正在執行的 EC2 例項或本地伺服器,您可以按小時費率付費。例如,如果您使用 Chef 伺服器管理 10 個 EC2 例項 24 個小時,則您將支付 240 個節點小時的費用。登出、關閉或終止作為 Chef 節點註冊的 EC2 例項或本地伺服器後

Restore OpsWorks for Chef Automate Servers From a Backup

Amazon Web Services is Hiring. Amazon Web Services (AWS) is a dynamic, growing business unit within Amazon.com. We are currently hiring So

[GeeksForGeeks] Populate inorder successor for all nodes in a binary search tree

stack iter pro get root following sin ice nod Given a binary search tree with the following tree node definition. next points to a node‘s

40、inner mate distance for paired reads in a bam file

ins it is unknown IT ner left tle size hat 參考:https://www.biostars.org/p/106291/#106344 1、inner mate distance : the distance from the r

How can I use different pipelines for different spiders in a single Scrapy project

2012-11-28 Hi vitsin, You can’t override settings like this in your spiders like your code does: class FirstSpide

USING DEEP LEARNING FOR ANOMALY DETECTION IN RADIOLOGICAL IMAGES

關注Deep Learning在醫療資料中的應用,指出了Deep Learning在醫療資料應用中遇到的問題,即不能像處理圖片資料那樣,輸入大量訓練資料,而是相對資料量的缺乏;注意到人類的學習過程,當教小孩讀和寫的時候,它是一個學生和老師互動反饋的過程,受此啟發

AWS OpsWorks for Puppet Enterprise – Managed Puppet Master

AWS OpsWorks for Puppet Enterprise is a fully managed configuration management service that hosts Puppet Enterprise, a set of automation tools fr

AWS OpsWorks for Puppet Enterprise Features

Puppet uses SSL and a certification approval process when communicating to ensure that the Puppet master responds only to requests made by truste

AWS OpsWorks for Puppet Enterprise Pricing

You pay an hourly rate for each running EC2 instance or on-premises server that is registered with your Puppet master as a node. For example, if y

Using AWS IoT for Predictive Maintenance

The interest in machine learning for industrial and manufacturing use cases on the edge is growing. Manufacturers need to know when a machine is a

A use case for Go Generics in a Go compiler

This is a (very) rare work-related entry. I mostly work on the compiler for a programming language named “Go”, and one of the problems we face is if an

解決 Error:Unable to find encoder for type stored in a Dataset

Error: Unable to find encoder for type stored in a Dataset.  Primitive types (Int, String, etc) and Product t

Spark 2.0 DataFrame map操作中Unable to find encoder for type stored in a Dataset.問題的分析與解決

隨著新版本的spark已經逐漸穩定,最近擬將原有框架升級到spark 2.0。還是比較興奮的,特別是SQL的速度真的快了許多。。 然而,在其中一個操作時卻卡住了。主要是dataframe.map操作,這個之前在spark 1.X是可以執行的,然而在spark 2.0上卻無

Launch an Amazon EMR Cluster in a VPC Environment

Amazon Web Services is Hiring. Amazon Web Services (AWS) is a dynamic, growing business unit within Amazon.com. We are currently hiring So