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. # Ansible project
  5. $ operator-sdk new app-operator --type=ansible \
  6. --api-version=app.example.com/v1alpha1 \
  7. --kind=AppService
  8. # Helm project
  9. $ operator-sdk new app-operator --type=helm \
  10. --api-version=app.example.com/v1alpha1 \
  11. --kind=AppService
  12. $ operator-sdk new app-operator --type=helm \
  13. --api-version=app.example.com/v1alpha1 \
  14. --kind=AppService \
  15. --helm-chart=myrepo/app
  16. $ operator-sdk new app-operator --type=helm \
  17. --helm-chart=myrepo/app
  18. $ operator-sdk new app-operator --type=helm \
  19. --helm-chart=myrepo/app \
  20. --helm-chart-version=1.2.3
  21. $ operator-sdk new app-operator --type=helm \
  22. --helm-chart=app \
  23. --helm-chart-repo=https://charts.mycompany.com/
  24. $ operator-sdk new app-operator --type=helm \
  25. --helm-chart=app \
  26. --helm-chart-repo=https://charts.mycompany.com/ \
  27. --helm-chart-version=1.2.3
  28. $ operator-sdk new app-operator --type=helm \
  29. --helm-chart=/path/to/local/chart-directories/app/
  30. $ operator-sdk new app-operator --type=helm \
  31. --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)
  2. --crd-version string CRD version to generate (default "v1")
  3. --generate-playbook Generate a playbook skeleton. (Only used for --type ansible)
  4. --helm-chart string Initialize helm operator with existing helm chart (<URL>, <repo>/<name>, or local path). Valid only for --type helm
  5. --helm-chart-repo string Chart repository URL for the requested helm chart, Valid only for --type helm
  6. --helm-chart-version string Specific version of the helm chart (default is latest version). Valid only for --type helm
  7. -h, --help help for new
  8. --kind string Kubernetes resource Kind name. (e.g AppService)
  9. --skip-generation Skip generation of deepcopy and OpenAPI code and OpenAPI CRD specs
  10. --type string Type of operator to initialize (choices: "ansible" or "helm")

SEE ALSO

Last modified June 17, 2020: deprecate git-init flag in the new cmd (#3241) (771d1714)