syntasso / kratix-cli

CLI-based tool to build Promises
Apache License 2.0
2 stars 2 forks source link

kratix init from operator #10

Closed ChunyiLyu closed 4 months ago

ChunyiLyu commented 5 months ago

Context

kratix init from an operator. Output of the command will be a working promise with api, dependencies, and resource configure workflow image generated based on the input operator that people can kubectl apply without any further customization.

Design

$> kratix init operator-promise --help
Generates a Promise from an Kubernetes Operator.

Examples
  # generate a promise
  kratix init operator-promise PROMISENAME --group myorg.com --version v1 --kind database

Flags:
...

The command:

kratix init operator-promise PROMISENAME \
   --group myorg.com \
   --version v1 \
   --kind database \
   --plural postgreses \
   --operator-manifests path/to/manifests/ \
   --api-from CRD-FULLNAME \
   --output-dir mypromise

Outputs:

api.yaml                     # this is the operator crd with the promise gvk 
dependencies.yaml  # this is the operator manifests, bundled
resource-request.yaml 
resources/
  configure/
    workflow.yaml       # this contains the copy-object pipeline definition
    instance-configure/
      from-api-to-operator/
        Dockerfile
        pipeline.sh         # this is the deploy script

Tasks

kirederik commented 4 months ago