kubekey/docs/en/001-project.md
liujian 192af7bb7e
feat: add Chinese README and documentation updates (#2791)
- 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>
2025-09-30 10:00:07 +08:00

1.4 KiB
Raw Blame History

Project

The project stores task templates to be executed, consisting of a series of YAML files.
To help users quickly understand and get started, kks task abstraction is inspired by ansibles 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).