# AddK6

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

Adds a Grafana k6 container resource to the application model. The default image is and the tag is .

## Remarks

Add an Grafana k6 container to the application model and reference it in a .NET project.
```
var builder = DistributedApplication.CreateBuilder(args);
var api = builder.AddProject<Projects.Api>("api")
var k6 = builder.AddK6("k6");
.WithReference(api);
builder.Build().Run();
```

## Definition

```go
func (DistributedApplicationBuilder) AddK6(
    name string,
    options ...*AddK6Options,
) K6Resource
```

## Parameters

- `name` (`string`) -- The name of the resource. This name will be used as the connection string name when referenced in a dependency.
- `options` (`...*AddK6Options`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*AddK6Options` argument.

- `EnableBrowserExtensions` (`*bool`) -- Enables browser automation and end-to-end web testing to k6.
- `Port` (`*float64`) -- The host port to bind the underlying container to.

## Returns

[`K6Resource`](/reference/api/go/communitytoolkit.aspire.hosting.k6/k6resource.md) -- A reference to the `IResourceBuilder`.

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

## Applies to

- `DistributedApplicationBuilder`
