- Introduced a new Chinese version of the README file (README_zh-CN.md) to enhance accessibility for Chinese-speaking users. - Updated the English README to reflect new features and installation instructions. - Added detailed documentation for project structure, playbooks, roles, tasks, and modules to improve user understanding and usability. Signed-off-by: [Your Name] <[Your Email]> Signed-off-by: redscholar <blacktiledhouse@gmail.com>
1.4 KiB
Project
The project stores task templates to be executed, consisting of a series of YAML files.
To help users quickly understand and get started, kk’s task abstraction is inspired by ansible’s playbook specification.
Directory Structure
|-- project
| |-- playbooks/
| |-- playbook1.yaml
| |-- playbook2.yaml
| |-- roles/
| | |-- roleName1/
| | |-- roleName2/
...
playbooks: The execution entry point. Stores a series of playbooks. A playbook can define multiple tasks or roles. When running a workflow template, the defined tasks are executed in order.
roles: A collection of roles. A role is a group of tasks.
Storage Locations
Projects can be stored as built-in, local, or on a Git server.
Built-in
Built-in projects are stored in the builtin directory and integrated into kubekey commands.
Example:
kk precheck
This runs the playbooks/precheck.yaml workflow file in the builtin directory.
Local
Example:
kk run demo.yaml
This runs the demo.yaml workflow file in the current directory.
Git
Example:
kk run playbooks/demo.yaml \
--project-addr=$(GIT_URL) \
--project-branch=$(GIT_BRANCH)
This runs the playbooks/demo.yaml workflow file from the Git repository at $(GIT_URL), branch $(GIT_BRANCH).