如何使用命令行工具在命令行中创建项目

rancher版本:v2.4.17
部署方式:docker单机部署
如何使用命令行工具在rancher中创建项目,并且创建的namespace如何创建到指定的项目中

可以使用 rancher cli:GitHub - rancher/cli: Rancher CLI

# rancher projects -h
Operations on projects

Usage:
   rancher projects command [command options] [arguments...]

Commands:
     ls                  List projects
     create              Create a project
     delete, rm          Delete a project by ID
     add-member-role     Add a member to the project
     delete-member-role  Delete a member from the project
     list-roles          List all available roles for a project
     list-members        List current members of the project

Options:
   --help, -h  show help
# rancher namespace -h
Operations on namespaces

Usage:
   rancher namespaces command [command options] [arguments...]

Commands:
     ls          List namespaces
     create      Create a namespace
     delete, rm  Delete a namespace by name or ID
     move        Move a namespace to a different project

Options:
   --quiet, -q  Only display IDs or suppress help text
   --help, -h   show help

创建完项目后,也是使用rancher-cli创建namespace到指定的项目中吗

是的,你从 help 信息就能看得出来

好的,谢谢大佬,我去试下