This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.5.11.9. new
使用 operator-sdk new
命令可创建新的 Operator 应用程序,并根据输入的 <project_name>
生成(或构建)默认项目目录布局。
参数 | 描述 |
---|---|
| 新项目的名称。 |
标记 | 描述 |
---|---|
|
Kubernetes API 版本的格式是 |
|
要生成的 CRD 版本。默认: |
|
生成 Ansible playbook 框架。与 |
|
使用现有 Helm Chart: |
| 用于所请求 Helm Chart 的 Chart 存储库 URL。 |
|
Helm Chart 的特定版本。仅用于 |
| 使用方法和帮助输出。 |
|
CRD kind,如 |
| 跳过生成深度复制、OpenAPI 代码和 OpenAPI CRD 规格。 |
|
要初始化的 Operator 类型: |
从 Operator SDK v0.12.0 开始,删除了 --dep-manager
标签以及对基于 dep
的项目的支持。现在,Go 项目被构建为使用 Go 模块。
Go 项目使用方法示例
$ mkdir $GOPATH/src/github.com/example.com/
$ cd $GOPATH/src/github.com/example.com/
$ operator-sdk new app-operator
Ansible 项目使用方法示例
$ operator-sdk new app-operator \ --type=ansible \ --api-version=app.example.com/v1alpha1 \ --kind=AppService