官术网_书友最值得收藏!

Using Chef

Chef is a configuration management tool that provides a domain-specific language to model the configuration of our infrastructure. Each configuration item in our infrastructure is modeled as a resource. A resource is basically a Ruby method that accepts several parameters in a block. The following example resource describes installing the docker-engine package:

package 'docker-engine' do
  action :install
end

These resources are then written together in Ruby source files called recipes. When running a recipe against a server (a Docker host in our case), all the defined resources are executed to reach its desired state configuration.

Some Chef recipes may depend on other supplemental items, such as configuration templates and other recipes. All this information is gathered in cookbooks together with the recipes. A cookbook is a fundamental unit of distributing configuration and policy to our servers.

We will write Chef recipes to represent the desired state configuration of our Docker hosts. Our recipes will be organized in Chef cookbooks to distribute them to our infrastructure. However, first, let's prepare our Chef environment so that we can start describing our Docker-based infrastructure in recipes. A Chef environment consists of three things:

  • A Chef server
  • A workstation
  • A node

The next few subsections will give you a detailed description of each component. Then, we will set them up to prepare our Chef environment to be able to manage our Docker host.

There are more details of setting up a Chef environment that are outside this chapter's scope. More information can be found at the Chef documentation website at http://docs.chef.io.
主站蜘蛛池模板: 谢通门县| 城市| 青阳县| 安陆市| 新闻| 寿阳县| 铜山县| 武川县| 吉林省| 玉田县| 镶黄旗| 绥宁县| 扬州市| 辽宁省| 台中市| 新田县| 湘潭县| 白银市| 亚东县| 邵阳市| 锡林浩特市| 法库县| 张家界市| 闽清县| 大厂| 滨海县| 中山市| 宣武区| 武夷山市| 班戈县| 乌恰县| 公安县| 清河县| 上虞市| 郁南县| 永善县| 西藏| 鄂托克旗| 汤阴县| 大厂| 德格县|