Tanzu Platform SaaS

Publish accelerators

Last Updated February 19, 2025

This topic tells you how to publish new accelerators or sample accelerators from the Application Accelerator for VMware Tanzu samples repository.

Before you begin

Before you can publish accelerators, you must:

  • Install Tanzu CLI v1.5.3 or later.

  • Install the Tanzu CLI app-developer plug-in group, if it is not present, by running:

    tanzu plugin install --group vmware-tanzu/app-developer
    

    If the app-developer plug-in group is already installed, verify that you are using the latest version of the acceleratorv2 plug-in by running:

    tanzu plugin upgrade acceleratorv2
    
  • Log in from the Tanzu CLI by running:

    tanzu login
    
  • Set the Project to use by running:

    tanzu project use
    

Use Accelerator metadata

See the following content for making use of Accelerator metadata.

Publish new accelerator resources

You can use the Tanzu CLI accelerator plug-in apply command to publish accelerator and fragment resources defined in a local YAML file. The file can contain multiple resource definitions separated by a line with three dashes (---).

  1. Create a local YAML file that defines accelerator and fragment resources named my-resources.yaml. For example:

    apiVersion: accelerator.tanzu.vmware.com/v2
    kind: Accelerator
    metadata:
      name: simple-accelerator
    spec:
      displayName: Simple Accelerator
      description: Contains just a README
      iconURL: https://images.freecreatives.com/wp-content/uploads/2015/05/smiley-559124_640.jpg
      tags:
        - simple
        - getting-started
      git:
        ref:
          branch: main
        url: https://github.com/trisberg/simple-accelerator
    

    These spec properties from the accelerator resource definition are shown in accelerator listings in the IntelliJ IDE UI and the CLI:

    • displayName: A human-readable name.
    • description: A more detailed description.
    • iconURL: A URL pointing to an icon image or a data URL for an image.
    • tags: A list of tags used to filter accelerators.
  2. Publish resources defined in my-resources.yaml by running:

    tanzu accelerator apply -f ./my-resources.yaml
    

Publish the sample resources to the Tanzu Project

To publish the sample resources to the Tanzu Project:

  1. Ensure that you have an active Tanzu context for the Tanzu CLI and also have set the Tanzu Project to use.

  2. Download the sample resource definitions from the sample accelerators GitHub repository by running:

    wget https://raw.githubusercontent.com/vmware-tanzu/application-accelerator-samples/refs/tags/tp-10.1/tp-for-k8s-manifests/accelerator-resources.yaml
    
  3. Apply the resource definitions by running:

    tanzu accelerator apply -f accelerator-resources.yaml
    
  4. List the accelerators by running:

    tanzu accelerator list --from-context
    
  5. List the fragments by running:

    tanzu accelerator fragment list
    

You can list the accelerator resources from the Tanzu context or from the Local Accelerator Engine server. Therefore, in this case use the --from-context flag because you do not have a running Local Accelerator Engine server yet. There is no --from-context flag for this command because the fragment resources are always only available to list from the Tanzu context.

Accelerator custom resource definitions

This section tells you about the App Accelerators for the Tanzu Platform custom resource definition (CRD).

Custom resources

The Accelerator CRD defines any accelerator resources to be made available to the App Accelerators for Tanzu Platform.

The Fragment CRD defines any accelerator fragment resources to be made available to the App Accelerators for Tanzu Platform.

API definitions

The Accelerator CRD is defined with the following properties:

PropertyValue
NameAccelerator
Groupaccelerator.tanzu.vmware.com
Versionv2
ShortNameacc

Accelerator CRD specification

The Accelerator CRD spec defined in the AcceleratorSpec type has the following fields:

FieldDescriptionRequired/Optional
displayNameA short descriptive name used for an Accelerator.Optional
descriptionA longer description of an Accelerator.Optional
iconURLA URL for an image to represent the Accelerator in a UI.Optional
tagsAn array of strings defining attributes of the Accelerator that can be used in a search.Optional
gitDefines the accelerator source Git repository.Optional
git.urlThe repository URL, which can be an HTTP/S or SSH address.Optional
git.refGit reference to check out and monitor for changes. The default branch is main.Optional
git.ref.branchThe Git branch to check out. The default is main.Optional
git.ref.commitThe Git commit SHA to check out, if specified tag filters are ignored.Optional
git.ref.semverThe Git tag semver expression, which takes precedence over the tag.Optional
git.ref.tagThe Git tag to check out, which takes precedence over the branch.Optional
git.subPathSubPath is the folder inside the Git repository to consider as the root of the accelerator or fragment. The root of the repository is the default.Optional

The Fragment CRD is defined with the following properties:

PropertyValue
NameFragment
Groupaccelerator.tanzu.vmware.com
Versionv2
ShortNamefrag

Fragment CRD specification

The Fragment CRD spec defined in the FragmentSpec type has the following fields:

FieldDescriptionRequired/Optional
gitDefines the fragment source Git repository.Required
git.urlThe repository URL, which can be an HTTP/S or SSH address.Required
git.refGit reference to check out and monitor for changes. The default is main.Optional
git.ref.branchThe Git branch to check out. The default branch is main.Optional
git.ref.commitThe Git commit SHA to check out, if specified tag filters are ignored.Optional
git.ref.semverThe Git tag semver expression, which takes precedence over the tag.Optional
git.ref.tagThe Git tag to checkout, which takes precedence over the branch.Optional
git.subPathSubPath is the directory inside the Git repository to consider as the root of the accelerator or fragment. The root of the repository is the default.Optional