Component Handlers

OAM Built-in Component Handlers

Go Reference Go Reference

Package components implements oam.ComponentHandler for the built-in component types. Each handler parses a typed config from a component’s properties and produces the corresponding Kubernetes resources via kure’s builders. Handlers are registered with the transformer in pkg/cmd/kurel (newBuiltinTransformer), each mapping a component type string to a handler implementing CanHandle + ToApplicationConfig.

Component types

typeProducesSummary
webserviceDeployment, Service, ServiceAccount (+PVC)HTTP service with replicas, probes, env, volumes.
workerDeployment, ServiceAccount (+PVC)Background workload (no Service/port).
statefulsetStatefulSet, headless Service, SAStateful workload with volumeClaimTemplates.
daemonsetDaemonSet, SA (+Service if port)Per-node daemon; honors tolerations.
cronjobCronJob, SAScheduled job; cron schedule + history limits.
helmchartHelmRelease + Helm/OCIRepository, or rendered manifestsHelm via Flux (native) or client-side template.
ociOCIRepository, KustomizationSync manifests from an OCI artifact (Flux).
postgresqlCNPG Cluster, Pooler, ObjectStore, DatabaseCloudNativePG database (backup/monitoring/pooling).
passthroughany (verbatim)Emit an arbitrary object as-declared (clusterScoped opt).
crdCustomResourceDefinition(s)CRDs from inline/url; rejects non-CRD docs.
manifestsanyRaw manifests from inline/url with namespace stamping + scopeOverrides.

Common config

Most workload types (webservice, worker, statefulset, daemonset, cronjob) share these fields: image (validated — no untagged/latest), env (with valueFrom secret/configMap refs), resources (requests/limits, defaults 100m/128Mi), command/args, probes (httpGet/tcpSocket/exec/grpc), volumes, initContainers, sidecars, and affinity.

Per-type highlights

  • webservice / workerimage, replicas (default 1), port (webservice).
  • statefulsetvolumeClaimTemplates (name, size, storageClass, accessModes, mountPath), serviceName (headless).
  • daemonsettolerations (key/operator/value/effect); port optionally adds a Service.
  • cronjobschedule (5-field cron), restartPolicy (default OnFailure), successfulJobsHistoryLimit/failedJobsHistoryLimit.
  • helmchartchart, version, delivery (native|template), source (inline url or {name,kind} ref), values/valuesFrom, driftDetection, install.crds/upgrade.crds.
  • ocisource.url (oci://…), version (tag or sha256:…), path, prune, interval, targetNamespace.
  • postgresqlprovider: cnpg, version (default 16), storageSize, replicas, backup.*, monitoring.enabled, pooler.enabled, managedRoles, databases.
  • passthroughobject (full apiVersion/kind/metadata/spec), clusterScoped.
  • crd / manifestsinline xor url; manifests adds scopeOverrides (apiVersion/kind/scope) for unknown kinds.

Extending

Custom component types implement oam.ComponentHandler (CanHandle + ToApplicationConfig) and are registered alongside the built-ins. Exported helpers: ValidateImageRef (image policy) and BuildPVC (PVC from a PVCConfig).

See pkg.go.dev for the full type/field reference, the OAM model for the handler interfaces, and examples/ for runnable applications.