A machine-readable index of this documentation for AI agents is available at https://kubevela.io/llms.txt. Markdown versions of documentation pages are available by appending .md to their URLs.
Skip to main content
Version: Next

Built-in Sources

Eight SourceDefinitions are installed in vela-system with the vela-core chart. They read data a platform commonly needs, so most Applications bind one of these instead of authoring a definition. To read the definitions themselves, see vela-templates/definitions/internal/source/ in the kubevela repository.

TypeReads
configmap-localThe data of a ConfigMap in the namespace the component is rendered into
git-fileA file from an addon registry configured in the cluster
http-getA URL
vela-configA KubeVela Config's properties and the references it produced
vela-appThe status of another Application
vela-componentThe status of one placement of one component
vela-addonWhether an addon is installed and running
vela-envThe environment the Application is deployed into

The tables below list the parameters you put in spec.sources[].properties, the fields you can read as source.<name>.<field>, and the default cache lifetime.

configmap-local​

Reads a ConfigMap's data from the namespace the component is rendered into, on the cluster being rendered for, and nowhere else. That is the Application's own namespace unless a topology or override policy places the component in another one. Values are strings, as Kubernetes stores them.

ParameterTypeDescription
namestring, requiredName of the ConfigMap

Output: data (map of string to string). Cache: 5m, use-stale.

sources:
- name: settings
type: configmap-local
properties:
name: app-settings
components:
- name: api
type: webservice
properties:
env:
- name: LOG_LEVEL
value: '$(has(source.settings.data.logLevel) ? source.settings.data.logLevel : "info")'

A key of data may be absent from the ConfigMap, and an unguarded read of an absent key fails the render, so guard it with has(...) wherever you read it, see Optional fields.

There is deliberately no source that reads a ConfigMap from another namespace or cluster. When definition permission validation is enabled, RBAC on the SourceDefinition controls who may bind it, so the reach of a source belongs in the definition and not in a parameter that an application author can change. A platform that needs cross-namespace reads can write its own definition, starting from configmap-local.

git-file​

Reads a file from an addon registry configured in this cluster (vela addon registry list). YAML and JSON files are parsed, and any other file comes back as a string.

ParameterTypeDescription
registrystring, requiredName of an addon registry configured in the cluster
pathstring, requiredPath of the file within the registry
refstringBranch, tag or commit. Defaults to whatever the registry pinned
requiredbool, default trueWhen false, a missing file resolves with found: false and content: null instead of failing

Output: content (parsed value or string) and found (bool). Cache: 30m, use-stale.

http-get​

Sends a GET request to a URL. The response is parsed when its Content-Type is JSON or YAML. A response outside the 2xx range fails the source rather than becoming its value.

ParameterTypeDescription
urlstring, requiredThe URL to GET

Output: content (parsed value or string) and statusCode (int). Cache: 5m, use-stale.

The request is made by the controller process, so the controller needs outbound access to the URL. It goes through the controller's outbound HTTP guard: the deny policy applies, private addresses are blocked when that is enabled, and loopback addresses are always refused. The request is cut at the controller's maximum HTTP timeout (60s by default) and a response body over the workflow.http.maxResponseBytes limit (1 MiB by default) fails the source. The request carries no credentials.

vela-config​

Reads a KubeVela Config: its properties, the ConfigTemplate it satisfies, and references to the resources that template produced. Values of the generated resources are never returned, only their references, and a Config marked sensitive is refused.

ParameterTypeDescription
namestring, requiredName of the Config
namespacestringNamespace of the Config. Defaults to vela-system

Output: properties, template.name, template.namespace, output and outputs, where the last two are {apiVersion, kind, name, namespace} references. Cache: 5m, use-stale. The properties output field carries the // +sensitive marker, so its values show as *** in the Application status and vela status --sources. This is unrelated to a Config's own sensitive flag. The workload still receives the values.

An Application reads Configs in its own namespace, and shared system Configs in vela-system. Any other Config is refused, unless the AuthenticateApplication gate is on and the Application's user may read it. The value is cached per consuming namespace.

vela-app​

Reads the status of another Application: phase, health, workflow state, and per-component status broken down by the cluster each component is placed in. It never returns the Application's spec.

ParameterTypeDescription
namestring, requiredName of the Application
namespacestringDefaults to the namespace being rendered for, normally the Application's own

Output: name, namespace, phase, healthy, optional revision, optional workflow (mode, phase, suspend, terminated, finished, message), components, clusters, and services, which maps each component to its healthy flag and a clusters map of {healthy, message, namespace}. Cache: 1m, fail. healthy is false while the Application reports no services.

vela-component​

Reads the status of one placement of one component: health, message, details, and traits keyed by type. It never returns the spec.

ParameterTypeDescription
appstring, requiredName of the Application
componentstring, requiredName of the component
namespacestringDefaults to the namespace being rendered for, normally the Application's own
clusterstringWhich placement to read. Defaults to the hub (local)

Output: name, healthy, workloadHealthy, message, details, cluster, namespace, and traits, which maps each trait type to {healthy, pending, message, details}. Cache: 1m, fail. Traits are keyed by type. When a component carries two traits of one type, only the first is returned.

vela-addon​

Reports whether an addon is installed and running, and the name and namespace of the Application that built it. Chain it into vela-app for detail.

ParameterTypeDescription
namestring, requiredAddon name, as vela addon list shows it
namespacestring, default vela-systemNamespace addon Applications are installed into. Set it if the chart was installed with a non-default systemDefinitionNamespace

Output: installed, running, app, namespace. Cache: 1m, fail.

sources:
- name: fluxcd
type: vela-addon
properties: {name: fluxcd}
- name: fluxApp # chained: reads the Application the addon created
type: vela-app
properties:
name: '$(source.fluxcd.app)'
namespace: '$(source.fluxcd.namespace)'

vela-env​

Reads the Namespace being rendered for, normally the Application's own. The Namespace is always read from the hub cluster, even when the component is placed on a managed cluster. It takes no parameters.

Output: name (the namespace.oam.dev/env label if set, otherwise the namespace name), namespace, managed (whether the namespace is a managed environment), labels and annotations. Cache: 5m, use-stale.

Why the application-state sources return status only​

A component can reach for the Kubernetes API itself, but that needs credentials, gets no caching and cannot be type-checked at admission. The vela-app, vela-component, vela-addon, and vela-env sources give the same answer with all three. They return status, never spec: a spec is its author's intent and can hold properties they never meant to publish, while a status is observable state. That makes them a health signal and not a way to read someone else's configuration. The read is the controller's, not the binder's: vela-app and vela-component take a namespace, so an author can read the status of an Application in a namespace they cannot kubectl get. A platform that wants to limit that restricts who may bind these definitions, see Restrict where a definition is usable. vela-config is different: it deliberately returns a non-sensitive Config's declared properties, while returning only references for resources generated from them.