# KindDeployedResource.WithNamespace

- Module: [CommunityToolkit.Aspire.Hosting.Kind](/reference/api/go/communitytoolkit.aspire.hosting.kind.md)
- Defined on: [KindDeployedResource](/reference/api/go/communitytoolkit.aspire.hosting.kind/kinddeployedresource.md)
- Version: `13.5.1-beta.895`
- Kind: `method`

Sets the Kubernetes namespace for the deployment.

## Remarks

Helm chart resources pass `--create-namespace`. Manifest resources only pass
`--namespace` to `kubectl apply`; they do not create the namespace.

## Definition

```go
type KindDeployedResource interface {
    // ... omitted for brevity
    WithNamespace(namespace string) KindDeployedResource
}
```

## Signature

```go
WithNamespace(namespace string) KindDeployedResource
```

## Parameters

- `namespace` (`string`) -- The Kubernetes namespace.

## Returns

[`KindDeployedResource`](/reference/api/go/communitytoolkit.aspire.hosting.kind/kinddeployedresource.md) -- A reference to the `IResourceBuilder`.

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

## Defined on

- [KindDeployedResource](/reference/api/go/communitytoolkit.aspire.hosting.kind/kinddeployedresource.md) -- `handle`
