operator-sdk new

operator-sdk new

Creates a new operator application

Synopsis

The operator-sdk new command creates a new operator application and generates a default directory layout based on the input .

is the project name of the new operator. (e.g app-operator)

  1. operator-sdk new <project-name> [flags]

Examples

  1. # Create a new project directory
  2. $ mkdir $HOME/projects/example.com/
  3. $ cd $HOME/projects/example.com/
  4. # Go project
  5. $ operator-sdk new app-operator
  6. # Ansible project
  7. $ operator-sdk new app-operator --type=ansible \
  8. --api-version=app.example.com/v1alpha1 \
  9. --kind=AppService
  10. # Helm project
  11. $ operator-sdk new app-operator --type=helm \
  12. --api-version=app.example.com/v1alpha1 \
  13. --kind=AppService
  14. $ operator-sdk new app-operator --type=helm \
  15. --api-version=app.example.com/v1alpha1 \
  16. --kind=AppService \
  17. --helm-chart=myrepo/app
  18. $ operator-sdk new app-operator --type=helm \
  19. --helm-chart=myrepo/app
  20. $ operator-sdk new app-operator --type=helm \
  21. --helm-chart=myrepo/app \
  22. --helm-chart-version=1.2.3
  23. $ operator-sdk new app-operator --type=helm \
  24. --helm-chart=app \
  25. --helm-chart-repo=https://charts.mycompany.com/
  26. $ operator-sdk new app-operator --type=helm \
  27. --helm-chart=app \
  28. --helm-chart-repo=https://charts.mycompany.com/ \
  29. --helm-chart-version=1.2.3
  30. $ operator-sdk new app-operator --type=helm \
  31. --helm-chart=/path/to/local/chart-directories/app/
  32. $ operator-sdk new app-operator --type=helm \
  33. --helm-chart=/path/to/local/chart-archives/app-1.2.3.tgz

Options

  1. --api-version string Kubernetes apiVersion and has a format of $GROUP_NAME/$VERSION (e.g app.example.com/v1alpha1) - used with "ansible" or "helm" types
  2. --crd-version string CRD version to generate (Only used for --type=ansible|helm) (default "v1beta1")
  3. --generate-playbook Generate a playbook skeleton. (Only used for --type ansible)
  4. --git-init Initialize the project directory as a git repository (default false)
  5. --header-file string Path to file containing headers for generated Go files. Copied to hack/boilerplate.go.txt
  6. --helm-chart string Initialize helm operator with existing helm chart (<URL>, <repo>/<name>, or local path)
  7. --helm-chart-repo string Chart repository URL for the requested helm chart
  8. --helm-chart-version string Specific version of the helm chart (default is latest version)
  9. -h, --help help for new
  10. --kind string Kubernetes CustomResourceDefintion kind. (e.g AppService) - used with "ansible" or "helm" types
  11. --repo string Project repository path for Go operators. Used as the project's Go import path. This must be set if outside of $GOPATH/src (e.g. github.com/example-inc/my-operator)
  12. --skip-validation Do not validate the resulting project's structure and dependencies. (Only used for --type go)
  13. --type string Type of operator to initialize (choices: "go", "ansible" or "helm") (default "go")
  14. --vendor Use a vendor directory for dependencies

SEE ALSO

Last modified January 1, 0001