1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/modules/osdk-cli-reference-new.adoc
2019-07-18 13:26:33 +00:00

71 lines
1.8 KiB
Plaintext

[id="osdk-cli-reference-new_{context}"]
= new
The `operator-sdk new` command creates a new Operator application and generates
(or _scaffolds_) a default project directory layout based on the input
`<project_name>`.
.`new` arguments
[options="header",cols="1,3"]
|===
|Argument |Description
|`<project_name>`
|Name of the new project.
|===
.`new` flags
[options="header",cols="1,3"]
|===
|Flag |Description
|`--api-version`
|CRD `APIVersion` in the format `$GROUP_NAME/$VERSION`, for example `app.example.com/v1alpha1`. Used with `ansible` or `helm` types.
|`--dep-manager [dep\|modules]`
|Dependency manager the new project will use. Used with `go` type. (Default: `modules`)
|`--generate-playbook`
|Generate an Ansible playbook skeleton. Used with `ansible` type.
|`--header-file <string>`
|Path to file containing headers for generated Go files. Copied to `hack/boilerplate.go.txt`.
|`--helm-chart <string>`
|Initialize Helm operator with existing Helm chart: `<url>`, `<repo>/<name>`, or local path.
|`--helm-chart-repo <string>`
|Chart repository URL for the requested Helm chart.
|`--helm-chart-version <string>`
|Specific version of the Helm chart. (Default: latest version)
|`--help, -h`
|Usage and help output.
|`--kind <string>`
|CRD `Kind`, for example `AppService`. Used with `ansible` or `helm` types.
| `--skip-git-init`
|Do not initialize the directory as a Git repository.
|`--type`
|Type of Operator to initialize: `go`, `ansible` or `helm`. (Default: `go`)
|===
.Example usage for Go project
----
$ mkdir $GOPATH/src/github.com/example.com/
$ cd $GOPATH/src/github.com/example.com/
$ operator-sdk new app-operator
----
.Example usage for Ansible project
----
$ operator-sdk new app-operator \
--type=ansible \
--api-version=app.example.com/v1alpha1 \
--kind=AppService
----