Rationale 理由
Ignition is a distribution-agnostic provisioning utility. When a machine boots for the first time, Ignition will manipulate it in various ways to set up the machine for operations.
点火是一个与发行版无关的配置实用程序。当一台机器首次启动时,Ignition 将以各种方式操纵它,为操作设置机器。
There are several principles that have guided Ignition’s design. This document will explain the principles used, and the impact they have had on Ignition’s design.
有几个原则指导了 Ignition 的设计。本文档将解释使用的原则以及它们对 Ignition 设计的影响。
Ignition runs only on the first boot
Ignition 仅在第一次启动时运行。
Ignition is designed to be used as a provisioning tool, not as a configuration management tool. Ignition encourages immutable infrastructure, in which machine modification requires that users discard the old node and re-provision the machine. This maintains the user’s machines in a well known state with relatively simple tooling. (Ignition can be used to set up configuration management tools, if required, but that is not the best use of this utility.)
Ignition 旨在作为一个供应工具使用,而不是作为配置管理工具。Ignition 鼓励使用不可变基础架构,即机器修改需要用户丢弃旧节点并重新配置机器。这样可以通过相对简单的工具维护用户的机器处于良好的已知状态。(如果需要,Ignition 可以用于设置配置管理工具,但这并不是此实用程序的最佳用途。)
To this end, Ignition runs on the first boot of a machine. Being a general provisioning utility however, there’s nothing stopping a user from using Ignition to set up some configuration management tool. This may even make a lot of sense depending on the organization and requirements the user is trying to meet.
为此,Ignition 在机器首次启动时运行。然而,作为一个通用的供应工具,没有任何阻止用户使用 Ignition 来设置一些配置管理工具。根据组织和用户试图满足的需求,这甚至可能是有意义的。
From the user’s perspective this first boot is not special in any way. The system is fully provisioned and ready for use once fully booted.
从用户的角度来看,这次首次启动并没有任何特殊之处。一旦完全启动,系统就已完全配置好并准备就绪。
Ignition produces the machine specified or no machine at all
点火会产生指定的机器或根本没有机器
Ignition does what it needs to make the system match the state described in the Ignition config. If for any reason Ignition cannot deliver the exact machine that the config asked for, Ignition prevents the machine from booting successfully.
点火会执行必要的操作,使系统与点火配置中描述的状态匹配。如果由于任何原因点火无法提供配置要求的确切机器,点火将阻止机器成功启动。
For example, if the user wanted to fetch the document hosted at https://example.com/foo.conf
and write it to disk, Ignition would prevent the machine from booting if it were unable to resolve the given URL.
例如,如果用户想要获取托管在 https://example.com/foo.conf
上的文档并将其写入磁盘,如果无法解析给定的 URL,点火将阻止机器启动。
Ignition configs are declarative
点火配置是声明性的
Ignition configs describe the state of a system. Ignition configs do not list a series of steps that Ignition should take.
点火配置描述系统的状态。点火配置不列出 Ignition 应该执行的一系列步骤。
Ignition configs do not allow users to provide arbitrary logic (including scripts for Ignition to run). Users describe which filesystems must exist, which files must be created, which users must exist, and etc. Any further customization must use systemd services, created by Ignition.
点火配置不允许用户提供任意逻辑(包括要运行的 Ignition 脚本)。用户描述必须存在哪些文件系统,必须创建哪些文件,必须存在哪些用户等。任何进一步的定制都必须使用由 Ignition 创建的 systemd 服务。
Ignition does not guess how the system should be configured. For example, it does not automatically select a disk to hold any requested partitions. Users must specify the configuration explicitly.
点火不会猜测系统应该如何配置。例如,它不会自动选择磁盘来保存任何请求的分区。用户必须明确指定配置。
Ignition configs should not be written by hand
点火配置不应该手动编写
Ignition configs were designed to be human readable, but difficult to write, to discourage users from attempting to write configs by hand. Ignition configs support basic primitives such as files, directories, filesystems, and partitions, but do not provide higher-level functionality for configuring specific system services.
点火配置旨在便于人类阅读,但难以编写,以阻止用户尝试手动编写配置。点火配置支持基本原语,如文件、目录、文件系统和分区,但不提供用于配置特定系统服务的更高级功能。
Use Butane, or a similar tool, to generate Ignition configs. Butane reads Butane configs, which are YAML files containing distribution-independent Ignition directives and optional distribution-specific directives that provide an easier way to perform certain configuration tasks. Butane validates a Butane config for common errors and produces an Ignition config ready to be passed to a machine.
使用丁烷或类似工具生成点火配置。丁烷读取丁烷配置,这些配置是包含独立于发行版的点火指令和可选的特定于发行版的指令的 YAML 文件,提供了执行某些配置任务的更简单方式。丁烷会验证丁烷配置中的常见错误,并生成一个准备传递给机器的点火配置。
Ignition is distro-independent
点火是独立于发行版的
Ignition provides functionality that is broadly applicable to image-based Linux distributions. It does not provide distro-specific functionality such as package management.
点火提供的功能广泛适用于基于镜像的 Linux 发行版。它不提供特定于发行版的功能,如软件包管理。