Skip to content

Latest commit

Β 

History

History
52 lines (36 loc) Β· 1.39 KB

File metadata and controls

52 lines (36 loc) Β· 1.39 KB

Project

A project stores task templates to be executed, consisting of a series of YAML files. For easy understanding and quick adoption, KubeKey's task orchestration follows the conventions of Ansible.

Directory Structure

project/
β”œβ”€β”€ playbooks/          # Optional: store playbook files
β”‚   β”œβ”€β”€ playbook1.yaml
β”‚   └── playbook2.yaml
β”œβ”€β”€ playbook1.yaml      # Or place playbooks directly in the project root
β”œβ”€β”€ playbook2.yaml
└── roles/
    β”œβ”€β”€ roleName1/
    └── roleName2/
  • playbooks: Execution entry point, storing playbooks. A playbook can define multiple tasks or roles, which run in the defined order during execution.
  • roles: Collection of roles. A role is a group of tasks.

Storage Locations

Projects can be stored in builtin, local, or Git.

Builtin

Builtin projects are located in the builtin directory and are integrated into the KubeKey command.

kk precheck

Executes playbooks/precheck.yaml in the builtin directory.

Local

kk run demo.yaml

Executes demo.yaml in the current directory.

Git

kk run playbooks/demo.yaml \
  --project-addr="$(GIT_URL)" \
  --project-branch="$(GIT_BRANCH)"

Executes playbooks/demo.yaml on the specified Git URL and branch.