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 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 theacceleratorv2
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 (---
).
-
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.
-
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:
-
Ensure that you have an active Tanzu context for the Tanzu CLI and also have set the Tanzu Project to use.
-
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
-
Apply the resource definitions by running:
tanzu accelerator apply -f accelerator-resources.yaml
-
List the accelerators by running:
tanzu accelerator list --from-context
-
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:
Property | Value |
---|---|
Name | Accelerator |
Group | accelerator.tanzu.vmware.com |
Version | v2 |
ShortName | acc |
Accelerator CRD specification
The Accelerator
CRD spec
defined in the AcceleratorSpec
type has the following fields:
Field | Description | Required/Optional |
---|---|---|
displayName | A short descriptive name used for an Accelerator. | Optional |
description | A longer description of an Accelerator. | Optional |
iconURL | A URL for an image to represent the Accelerator in a UI. | Optional |
tags | An array of strings defining attributes of the Accelerator that can be used in a search. | Optional |
git | Defines the accelerator source Git repository. | Optional |
git.url | The repository URL, which can be an HTTP/S or SSH address. | Optional |
git.ref | Git reference to check out and monitor for changes. The default branch is main . | Optional |
git.ref.branch | The Git branch to check out. The default is main . | Optional |
git.ref.commit | The Git commit SHA to check out, if specified tag filters are ignored. | Optional |
git.ref.semver | The Git tag semver expression, which takes precedence over the tag. | Optional |
git.ref.tag | The Git tag to check out, which takes precedence over the branch. | Optional |
git.subPath | SubPath 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:
Property | Value |
---|---|
Name | Fragment |
Group | accelerator.tanzu.vmware.com |
Version | v2 |
ShortName | frag |
Fragment CRD specification
The Fragment
CRD spec
defined in the FragmentSpec
type has the following fields:
Field | Description | Required/Optional |
---|---|---|
git | Defines the fragment source Git repository. | Required |
git.url | The repository URL, which can be an HTTP/S or SSH address. | Required |
git.ref | Git reference to check out and monitor for changes. The default is main . | Optional |
git.ref.branch | The Git branch to check out. The default branch is main . | Optional |
git.ref.commit | The Git commit SHA to check out, if specified tag filters are ignored. | Optional |
git.ref.semver | The Git tag semver expression, which takes precedence over the tag. | Optional |
git.ref.tag | The Git tag to checkout, which takes precedence over the branch. | Optional |
git.subPath | SubPath 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 |
Content feedback and comments