1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/osdk-cli-reference-new.adoc

90 lines
2.0 KiB
Plaintext
Raw Normal View History

2019-05-13 08:55:00 +10:00
[id="osdk-cli-reference-new_{context}"]
2018-11-20 09:27:37 -05:00
= 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
2019-06-27 10:01:29 -04:00
|`--api-version`
|CRD `APIVersion` in the format `$GROUP_NAME/$VERSION`, for example `app.example.com/v1alpha1`. Used with `ansible` or `helm` types.
|`--crd-version`
|CRD version to generate, like `v1`. Default setting is `v1beta1`.
2019-06-27 10:01:29 -04:00
|`--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 is latest version.
2019-06-27 10:01:29 -04:00
|`--help, -h`
|Usage and help output.
|`--kind <string>`
|CRD `Kind`, for example `AppService`. Used with `ansible` or `helm` types.
2018-11-20 09:27:37 -05:00
| `--skip-git-init`
|Do not initialize the directory as a Git repository.
|`--type`
|Type of Operator to initialize: `go`, `ansible` or `helm`. Default is `go`.
2018-11-20 09:27:37 -05:00
|===
2019-12-04 21:35:43 -05:00
[NOTE]
====
Starting with Operator SDK v0.12.0, the `--dep-manager` flag and support for
`dep`-based projects have been removed. Go projects are now scaffolded to use Go
modules.
====
2018-11-20 09:27:37 -05:00
.Example usage for Go project
[source,terminal]
2018-11-20 09:27:37 -05:00
----
$ mkdir $GOPATH/src/github.com/example.com/
----
[source,terminal]
----
2018-11-20 09:27:37 -05:00
$ cd $GOPATH/src/github.com/example.com/
----
[source,terminal]
----
2018-11-20 09:27:37 -05:00
$ operator-sdk new app-operator
----
.Example usage for Ansible project
[source,terminal]
2018-11-20 09:27:37 -05:00
----
$ operator-sdk new app-operator \
--type=ansible \
--api-version=app.example.com/v1alpha1 \
--kind=AppService
----