operator-sdk init

operator-sdk init

Initialize a new project

Synopsis

Initialize a new project including vendor/ directory and Go package directories.

Writes the following files:

  • a boilerplate license file
  • a PROJECT file with the domain and repo
  • a Makefile to build the project
  • a go.mod with project dependencies
  • a Kustomization.yaml for customizating manifests
  • a Patch file for customizing image for manager manifests
  • a Patch file for enabling prometheus metrics
  • a main.go to run

project will prompt the user to run ‘dep ensure’ after writing the project files.

  1. operator-sdk init [flags]

Examples

  1. # Scaffold a project using the apache2 license with "The Kubernetes authors" as owners
  2. operator-sdk init --project-version=2 --domain example.org --license apache2 --owner "The Kubernetes authors"

Options

  1. --component-config create a versioned ComponentConfig file, may be 'true' or 'false'
  2. --domain string domain for groups (default "my.domain")
  3. --fetch-deps ensure dependencies are downloaded (default true)
  4. -h, --help help for init
  5. --license string license to use to boilerplate, may be one of 'apache2', 'none' (default "apache2")
  6. --owner string owner to add to the copyright
  7. --plugins strings Name and optionally version of the plugin to initialize the project with. Available plugins: ("ansible.sdk.operatorframework.io/v1", "go.kubebuilder.io/v2", "go.kubebuilder.io/v3", "helm.sdk.operatorframework.io/v1")
  8. --project-name string name of this project
  9. --project-version string project version, possible values: ("2", "3-alpha") (default "3-alpha")
  10. --repo string name to use for go module (e.g., github.com/user/repo), defaults to the go package of the current working directory.
  11. --skip-go-version-check if specified, skip checking the Go version

Options inherited from parent commands

  1. --verbose Enable verbose logging

SEE ALSO

  • operator-sdk - Development kit for building Kubernetes extensions and tools.

Last modified December 16, 2020: *: make go/v3 the default plugin (#4307) (f89a2c33)