# K3sClusterResource.AddK8sManifest

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

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
type K3sClusterResource interface {
    // ... omitted for brevity
    AddK8sManifest(
        name string,
        path string,
    ) K8sManifestResource
}
```

## Signature

```go
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()`.

## Defined on

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