RedPandaBuilderExtensions Methods
ClassMethods8 members
Provides extension methods for adding Redpanda resources to an
Hosting.IDistributedApplicationBuilder . AddRedPanda(IDistributedApplicationBuilder, string, int?) Section titled AddRedPanda(IDistributedApplicationBuilder, string, int?)extensionIResourceBuilder<RedPandaServerResource> Adds a Redpanda container resource to the application. Redpanda is a Kafka API compatible streaming platform, so the resource can be referenced by any Kafka client integration.
public static class RedPandaBuilderExtensions{ public static IResourceBuilder<RedPandaServerResource> AddRedPanda( this IDistributedApplicationBuilder builder, string name, int? port = null) { // ... }}Parameters
builderIDistributedApplicationBuilder The Hosting.IDistributedApplicationBuilder to add the resource to.namestringThe name of the resource. This name is used as the connection string name when referenced in a dependency.portint?optionalThe host port that the Kafka API is exposed on. If null a random port is assigned.Returns
IResourceBuilder<RedPandaServerResource> A reference to the ApplicationModel.IResourceBuilder`1 .Remarks
This version of the package defaults to the tag of the container image.
AddRedPanda(IDistributedApplicationBuilder, string, Action<RedPandaServerOptions>, int?) Section titled AddRedPanda(IDistributedApplicationBuilder, string, Action<RedPandaServerOptions>, int?)extensionIResourceBuilder<RedPandaServerResource> Adds a Redpanda container resource to the application, using a delegate to configure broker options such as the CPU and memory limits. Redpanda is a Kafka API compatible streaming platform, so the resource can be referenced by any Kafka client integration.
public static class RedPandaBuilderExtensions{ public static IResourceBuilder<RedPandaServerResource> AddRedPanda( this IDistributedApplicationBuilder builder, string name, Action<RedPandaServerOptions> configureOptions, int? port = null) { // ... }}Parameters
builderIDistributedApplicationBuilder The Hosting.IDistributedApplicationBuilder to add the resource to.namestringThe name of the resource. This name is used as the connection string name when referenced in a dependency.configureOptions Action<RedPandaServerOptions> A delegate that configures the RedPandaServerOptions for the broker.portint?optionalThe host port that the Kafka API is exposed on. If null a random port is assigned.Returns
IResourceBuilder<RedPandaServerResource> A reference to the ApplicationModel.IResourceBuilder`1 .Remarks
This version of the package defaults to the tag of the container image.
WithConsole(IResourceBuilder<RedPandaServerResource>, Action<IResourceBuilder<RedPandaConsoleContainerResource>>, string?) Section titled WithConsole(IResourceBuilder<RedPandaServerResource>, Action<IResourceBuilder<RedPandaConsoleContainerResource>>, string?)extensionIResourceBuilder<RedPandaServerResource> Adds a Redpanda Console container to the application, configured to connect to the Redpanda broker.
public static class RedPandaBuilderExtensions{ public static IResourceBuilder<RedPandaServerResource> WithConsole( this IResourceBuilder<RedPandaServerResource> builder, Action<IResourceBuilder<RedPandaConsoleContainerResource>>? configureContainer = null, string? containerName = null) { // ... }}Parameters
builderIResourceBuilder<RedPandaServerResource> The Redpanda server resource builder.configureContainer Action<IResourceBuilder<RedPandaConsoleContainerResource>> optionalAn optional callback to configure the Redpanda Console container resource.containerName string?optionalThe name of the container (optional).Returns
IResourceBuilder<RedPandaServerResource> A reference to the ApplicationModel.IResourceBuilder`1 for the Redpanda server resource.Remarks
This version of the package defaults to the tag of the container image.
WithDataBindMount(IResourceBuilder<RedPandaServerResource>, string, bool) Section titled WithDataBindMount(IResourceBuilder<RedPandaServerResource>, string, bool)extensionIResourceBuilder<RedPandaServerResource> Adds a bind mount for the data folder to a Redpanda container resource.
public static class RedPandaBuilderExtensions{ public static IResourceBuilder<RedPandaServerResource> WithDataBindMount( this IResourceBuilder<RedPandaServerResource> builder, string source, bool isReadOnly = false) { // ... }}Parameters
builderIResourceBuilder<RedPandaServerResource> The resource builder.sourcestringThe source directory on the host to mount into the container.isReadOnly booloptionalA flag that indicates if this is a read-only mount.Returns
IResourceBuilder<RedPandaServerResource> A reference to the ApplicationModel.IResourceBuilder`1 .WithDataVolume(IResourceBuilder<RedPandaServerResource>, string?, bool) Section titled WithDataVolume(IResourceBuilder<RedPandaServerResource>, string?, bool)extensionIResourceBuilder<RedPandaServerResource> Adds a named volume for the data folder to a Redpanda container resource.
public static class RedPandaBuilderExtensions{ public static IResourceBuilder<RedPandaServerResource> WithDataVolume( this IResourceBuilder<RedPandaServerResource> builder, string? name = null, bool isReadOnly = false) { // ... }}Parameters
builderIResourceBuilder<RedPandaServerResource> The resource builder.namestring?optionalThe name of the volume. Defaults to an auto-generated name based on the application and resource names.isReadOnly booloptionalA flag that indicates if this is a read-only volume.Returns
IResourceBuilder<RedPandaServerResource> A reference to the ApplicationModel.IResourceBuilder`1 .WithHostPort(IResourceBuilder<RedPandaConsoleContainerResource>, int?) Section titled WithHostPort(IResourceBuilder<RedPandaConsoleContainerResource>, int?)extensionIResourceBuilder<RedPandaConsoleContainerResource> Configures the host port that the Redpanda Console resource is exposed on instead of using a randomly assigned port.
public static class RedPandaBuilderExtensions{ public static IResourceBuilder<RedPandaConsoleContainerResource> WithHostPort( this IResourceBuilder<RedPandaConsoleContainerResource> builder, int? port) { // ... }}Parameters
builderIResourceBuilder<RedPandaConsoleContainerResource> The resource builder for the Redpanda Console.portint?The port to bind on the host. If null a random port is assigned.Returns
IResourceBuilder<RedPandaConsoleContainerResource> A reference to the ApplicationModel.IResourceBuilder`1 .WithHostPort(IResourceBuilder<RedPandaKafkaUiContainerResource>, int?) Section titled WithHostPort(IResourceBuilder<RedPandaKafkaUiContainerResource>, int?)extensionIResourceBuilder<RedPandaKafkaUiContainerResource> Configures the host port that the Kafka UI resource is exposed on instead of using a randomly assigned port.
public static class RedPandaBuilderExtensions{ public static IResourceBuilder<RedPandaKafkaUiContainerResource> WithHostPort( this IResourceBuilder<RedPandaKafkaUiContainerResource> builder, int? port) { // ... }}Parameters
builderIResourceBuilder<RedPandaKafkaUiContainerResource> The resource builder for the Kafka UI.portint?The port to bind on the host. If null a random port is assigned.Returns
IResourceBuilder<RedPandaKafkaUiContainerResource> A reference to the ApplicationModel.IResourceBuilder`1 .WithKafkaUI(IResourceBuilder<RedPandaServerResource>, Action<IResourceBuilder<RedPandaKafkaUiContainerResource>>, string?) Section titled WithKafkaUI(IResourceBuilder<RedPandaServerResource>, Action<IResourceBuilder<RedPandaKafkaUiContainerResource>>, string?)extensionIResourceBuilder<RedPandaServerResource> Adds a Kafka UI container to the application, configured to connect to the Redpanda broker. This is the same Kafka management UI (the
kafbat/kafka-ui image) used by the official Aspire Kafka integration, so it works against any Kafka API compatible broker. public static class RedPandaBuilderExtensions{ public static IResourceBuilder<RedPandaServerResource> WithKafkaUI( this IResourceBuilder<RedPandaServerResource> builder, Action<IResourceBuilder<RedPandaKafkaUiContainerResource>>? configureContainer = null, string? containerName = null) { // ... }}Parameters
builderIResourceBuilder<RedPandaServerResource> The Redpanda server resource builder.configureContainer Action<IResourceBuilder<RedPandaKafkaUiContainerResource>> optionalAn optional callback to configure the Kafka UI container resource.containerName string?optionalThe name of the container (optional).Returns
IResourceBuilder<RedPandaServerResource> A reference to the ApplicationModel.IResourceBuilder`1 for the Redpanda server resource.Remarks
This version of the package defaults to the tag of the container image.