K3sManifestBuilderExtensions Methods
AddK8sManifest(IResourceBuilder<K3sClusterResource>, string, string)Section titled AddK8sManifest(IResourceBuilder<K3sClusterResource>, string, string)extensionIResourceBuilder<K8sManifestResource>public static class K3sManifestBuilderExtensions{ public static IResourceBuilder<K8sManifestResource> AddK8sManifest( this IResourceBuilder<K3sClusterResource> builder, string name, string path) { // ... }}Parameters
builderIResourceBuilder<K3sClusterResource>The k3s cluster resource builder.namestringThe Aspire resource name for this manifest application.pathstring Path to a single .yaml / .yml file, a directory of YAML files, or a Kustomize overlay directory (containing kustomization.yaml). Relative paths are resolved against the AppHost project directory. Returns
IResourceBuilder<K8sManifestResource>A builder for the K8sManifestResource.Exceptions
ArgumentNullExceptionbuilder, name, or path is null. Remarks
The apply mode is detected automatically from path: kubectl apply -f.kustomization.yaml) — all .yaml / .yml files in the directory are applied with kubectl apply -f.kustomization.yaml or kustomization.yml) — applied with kubectl apply -k. The directory is bind-mounted so that relative references to base manifests are preserved.
The container exits with code 0 after all manifests are applied and any CRDs have reached the Established condition. No host-side kubectl binary is required. Use WaitForCompletion(manifest) on resources that must start only after the manifests are applied.