Skip to content

feat: add .NET Aspire integration for KubeOps operators#1135

Merged
kimpenhaus merged 2 commits into
dotnet:mainfrom
msexxeta:pr-1132-aspire-kubeops-publish
Jun 1, 2026
Merged

feat: add .NET Aspire integration for KubeOps operators#1135
kimpenhaus merged 2 commits into
dotnet:mainfrom
msexxeta:pr-1132-aspire-kubeops-publish

Conversation

@msexxeta

@msexxeta msexxeta commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add KubeOps.Aspire service defaults for operator telemetry, service discovery, resilience, and health checks
  • add KubeOps.Aspire.Hosting with AddKubeOps<TProject>, RunWithKubernetes(...), and PublishAsKubernetesOperator(...)
  • integrate KubeOps-generated CRDs, RBAC, and service accounts into Aspire Kubernetes publish/deploy output while keeping Aspire as the owner of the operator Deployment
  • document local, Azure/AKS, combined, and standalone publish-only scenarios

Validation

  • dotnet test test\KubeOps.Aspire.Hosting.Test\KubeOps.Aspire.Hosting.Test.csproj --no-restore
  • dotnet test test\KubeOps.Aspire.Test\KubeOps.Aspire.Test.csproj --no-restore
  • npm run build in docs succeeds; it still reports a pre-existing unrelated broken anchor in docs/operator/deployment
  • manually verified earlier against local Kubernetes from Podman/kind, standalone publish without a Kubernetes environment or Helm, and AKS deploy in tenant e98c800b-fa26-4a4e-85c1-cd4aafbf5fac with temporary resources cleaned up afterwards

closes #926

Comment thread examples/Operator/Operator.csproj Outdated
@msexxeta msexxeta force-pushed the pr-1132-aspire-kubeops-publish branch from bcc5a36 to 65fe4b5 Compare June 1, 2026 14:30
@msexxeta

msexxeta commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the sample separation feedback: examples/Operator is back to being a plain KubeOps operator, and the Aspire sample now uses a dedicated examples/AspireOperator project referenced by examples/AspireAppHost.

I also updated the Aspire docs/README snippets to use Projects.AspireOperator so the examples line up with the new structure.

@kimpenhaus kimpenhaus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that looks pretty good to me in general - there are some minor things I'd like to recover

  • the added debug processor in the operator sample as that fixes an unused using in release configuration.
  • the two comments on the readme which were more precisely than the original text segments

thanks for your time @msexxeta

Comment thread README.md Outdated
Comment thread README.md Outdated
Add Aspire service defaults, AppHost hosting integration, Kubernetes run/publish support, examples, tests, and docs for local, Azure, and standalone publish scenarios.

Co-authored-by: Marcus Kimpenhaus <kimpenhaus@devil-engineering.de>
@msexxeta msexxeta force-pushed the pr-1132-aspire-kubeops-publish branch from 65fe4b5 to dc246a6 Compare June 1, 2026 17:34
@msexxeta

msexxeta commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Restored the more precise README wording from the review:

  • dotnet new operator is described as scaffolding, while the console path is manual setup plus KubeOps.Operator.
  • Package targeting now distinguishes runtime libraries, build-time packages, and the Kubernetes client wording.

I also put the plain operator sample's KubeOps.Abstractions.Crds using back under #if DEBUG and verified the Release build is warning-free.

@kimpenhaus

Copy link
Copy Markdown
Collaborator

that's awesome - thanks 😄

@kimpenhaus kimpenhaus enabled auto-merge (squash) June 1, 2026 17:50
kimpenhaus
kimpenhaus previously approved these changes Jun 1, 2026
@kimpenhaus kimpenhaus changed the title Add .NET Aspire integration for KubeOps operators feat: add .NET Aspire integration for KubeOps operators Jun 1, 2026
@kimpenhaus kimpenhaus merged commit 194c930 into dotnet:main Jun 1, 2026
5 checks passed
@msexxeta

msexxeta commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Nice! This makes developing operaters much easier imo, especially when they are part of a bigger system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature]: Support for .NET Aspire

2 participants