Version: v1.2

vela def init

Init a new definition

Synopsis

Init a new definition with given arguments or interactively

  • We support parsing a single YAML file (like kubernetes objects) into the cue-style template. However, we do not support variables in YAML file currently, which prevents users from directly feeding files like helm chart directly. We may introduce such features in the future.
  1. vela def init DEF_NAME [flags]

Examples

  1. # Command below initiate an empty TraitDefinition named my-ingress
  2. > vela def init my-ingress -t trait --desc "My ingress trait definition." > ./my-ingress.cue
  3. # Command below initiate a definition named my-def interactively and save it to ./my-def.cue
  4. > vela def init my-def -i --output ./my-def.cue
  5. # Command below initiate a ComponentDefinition named my-webservice with the template parsed from ./template.yaml.
  6. > vela def init my-webservice -i --template-yaml ./template.yaml
  7. # Command below initiate a typed ComponentDefinition named vswitch from Alibaba Cloud.
  8. > vela def init vswitch --type component --provider alibaba --desc xxx --git https://github.com/kubevela-contrib/terraform-modules.git --path alibaba/vswitch

Options

  1. -d, --desc string Specify the description of the new definition.
  2. --git string Specify which git repository the configuration(HCL) is stored in. Valid when --provider/-p is set.
  3. -h, --help help for init
  4. -i, --interactive Specify whether use interactive process to help generate definitions.
  5. -o, --output string Specify the output path of the generated definition. If empty, the definition will be printed in the console.
  6. --path string Specify which path the configuration(HCL) is stored in the Git repository. Valid when --git is set.
  7. -p, --provider alibaba Specify which provider the cloud resource definition belongs to. Only alibaba, `aws`, `azure` are supported.
  8. -y, --template-yaml string Specify the template yaml file that definition will use to build the schema. If empty, a default template for the given definition type will be used.
  9. -t, --type string Specify the type of the new definition. Valid types: component, trait, policy, workload, scope, workflow-step

SEE ALSO

Go Back to CLI Commands Homepage.

Auto generated by spf13/cobra on 12-Jan-2022, refer to script in KubeVela.