# AddK8sManifest

- Module: [CommunityToolkit.Aspire.Hosting.K3s](/reference/api/go/communitytoolkit.aspire.hosting.k3s.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: [`K3sClusterResource`](/reference/api/go/communitytoolkit.aspire.hosting.k3s/k3sclusterresource.md)
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Applies Kubernetes YAML manifests or a Kustomize overlay to the cluster.

## Remarks

The apply mode is detected automatically from `path`:
-
-
-
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.

## Definition

```go
func (K3sClusterResource) AddK8sManifest(
    name string,
    path string,
) K8sManifestResource
```

## Parameters

- `name` (`string`) -- The Aspire resource name for this manifest application.
- `path` (`string`) -- 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

[`K8sManifestResource`](/reference/api/go/communitytoolkit.aspire.hosting.k3s/k8smanifestresource.md) -- A builder for the `K8sManifestResource`.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`K3sClusterResource`](/reference/api/go/communitytoolkit.aspire.hosting.k3s/k3sclusterresource.md)
