KubeOps.Aspire
KubeOps.Aspire is the .NET Aspire service defaults integration for KubeOps operators. It is the operator-side counterpart to the KubeOps.Aspire.Hosting AppHost integration.
A single call wires up the cross-cutting concerns that Aspire expects from a well-behaved resource:
- OpenTelemetry — logging, metrics and tracing, including the operator's
ActivitySource. - OTLP export — enabled automatically when
OTEL_EXPORTER_OTLP_ENDPOINTis set (Aspire injects this). - Service discovery — so the operator can call other Aspire resources by their logical name.
- HTTP resilience — a standard resilience handler on all
HttpClientinstances. - Health checks — a default
selfliveness check.
Usage
using KubeOps.Aspire;
var builder = Host.CreateApplicationBuilder(args);
builder.Services
.AddKubernetesOperator()
.RegisterComponents();
builder.AddKubeOpsServiceDefaults();
using var host = builder.Build();
await host.RunAsync();
Call AddKubeOpsServiceDefaults() after AddKubernetesOperator() so the OpenTelemetry service and tracing source names match OperatorSettings.Name and the operator's reconciliation traces are captured. If you must call it earlier, pass the name explicitly (and keep it in sync with OperatorSettings.Name):
builder.AddKubeOpsServiceDefaults("my-operator");
See the .NET Aspire guide for the full picture.
Related Packages
- KubeOps.Aspire.Hosting - AppHost integration for orchestrating the operator
- KubeOps.Operator - Main operator engine
See the .NET Aspire guide for the full walkthrough.