operator-sdk generate packagemanifests

operator-sdk generate packagemanifests

Generates package manifests data for the operator

Synopsis

Note: while the package manifests format is not yet deprecated, the operator-framework is migrated towards using bundles by default. Run ‘operator-sdk generate bundle -h’ for more information.

Running ‘generate packagemanifests’ is the first step to publishing your operator to a catalog and/or deploying it with OLM. This command generates a set of manifests in a versioned directory and a package manifest file for your operator. Typically one would run ‘generate kustomize manifests’ first to (re)generate kustomize bases consumed by this command.

Set ‘–version’ to supply a semantic version for your new package. This is a required flag when running ‘generate packagemanifests –manifests’.

More information on the package manifests format: https://github.com/operator-framework/operator-registry/#manifest-format

  1. operator-sdk generate packagemanifests [flags]

Examples

  1. # Generate manifests then create the package manifests base:
  2. $ make manifests
  3. /home/user/go/bin/controller-gen "crd:trivialVersions=true" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases
  4. $ operator-sdk generate kustomize manifests
  5. Display name for the operator (required):
  6. > memcached-operator
  7. ...
  8. $ tree config/manifests
  9. config/manifests
  10. ├── bases
  11. └── memcached-operator.clusterserviceversion.yaml
  12. └── kustomization.yaml
  13. $ kustomize build config/manifests | operator-sdk generate packagemanifests --manifests --version 0.0.1
  14. Generating package manifests version 0.0.1
  15. ...
  16. # After running the above commands, you should see this directory structure:
  17. $ tree packagemanifests
  18. packagemanifests
  19. ├── 0.0.1
  20. ├── cache.my.domain_memcacheds.yaml
  21. └── memcached-operator.clusterserviceversion.yaml
  22. └── memcached-operator.package.yaml

Options

  1. --channel string Channel name for the generated package
  2. --crds-dir string Root directory for CustomResoureDefinition manifests
  3. --default-channel Use the channel passed to --channel as the package manifest file's default channel
  4. --deploy-dir string Root directory for operator manifests such as Deployments and RBAC, ex. 'deploy'. This directory is different from that passed to --input-dir
  5. --from-version string Semantic version of the operator being upgraded from
  6. -h, --help help for packagemanifests
  7. --input-dir string Directory to read existing package manifests from. This directory is the parent of individual versioned package directories, and different from --deploy-dir
  8. --kustomize-dir string Directory containing kustomize bases and a kustomization.yaml for operator-framework manifests (default "config/manifests")
  9. --output-dir string Directory in which to write package manifests
  10. -q, --quiet Run in quiet mode
  11. --stdout Write package to stdout
  12. --update-objects Update non-CSV objects in this package, ex. CustomResoureDefinitions, Roles (default true)
  13. -v, --version string Semantic version of the packaged operator

Options inherited from parent commands

  1. --verbose Enable verbose logging

SEE ALSO

Last modified July 31, 2020: generate: consider service accounts when generating a CSV (#3610) (3270033b)