diff --git a/README.md b/README.md index 96904e51..e68ad151 100644 --- a/README.md +++ b/README.md @@ -102,49 +102,6 @@ aspire run --project src/MyApp.AppHost/MyApp.AppHost.csproj aspire publish --project src/MyApp.AppHost/MyApp.AppHost.csproj --output-path ./artifacts/k8s ``` -Common AppHost shapes: - -Local development only: - -```csharp -var dev = builder.AddKubernetesEnvironment("dev"); - -builder.AddKubeOps("operator") - .RunWithKubernetes(dev, run => run.WithPersistentCrds()); -``` - -Azure publish/deploy only: - -```csharp -var aks = builder.AddAzureKubernetesEnvironment("aks"); - -builder.AddKubeOps("operator") - .PublishAsKubernetesOperator(aks, publish => publish.WithServiceAccount("operator")); -``` - -Local run and Azure deploy: - -```csharp -var dev = builder.AddKubernetesEnvironment("dev"); -var aks = builder.AddAzureKubernetesEnvironment("aks"); - -builder.AddKubeOps("operator") - .RunWithKubernetes(dev) - .PublishAsKubernetesOperator(aks); -``` - -Publish only without an Aspire Kubernetes environment: - -```csharp -builder.AddKubeOps("operator") - .PublishAsKubernetesOperator(publish => - { - publish.Namespace = "operator-system"; - publish.WithServiceAccount("operator"); - }); -``` - -Without `RunWithKubernetes(...)`, `AddKubeOps(...)` keeps the operator in explicit-start mode for local Aspire runs. Standalone manifest publish does not require `AddKubernetesEnvironment(...)`, Helm, or a live cluster; publishing with a Kubernetes environment generates an Aspire Helm chart, while `aspire deploy` installs that chart into the selected environment. ## Packages @@ -201,4 +158,4 @@ In short: ## Motivation -KubeOps aims to provide a first-class experience for developing Kubernetes operators within the .NET ecosystem, offering an alternative to Go-based SDKs like Kubebuilder and Operator SDK, while embracing familiar C# patterns and tooling. +KubeOps aims to provide a first-class experience for developing Kubernetes operators within the .NET ecosystem, offering an alternative to Go-based SDKs like Kubebuilder and Operator SDK, while embracing familiar C# patterns and tooling. \ No newline at end of file diff --git a/docs/docs/operator/aspire.mdx b/docs/docs/operator/aspire.mdx index c1d51cce..972f85aa 100644 --- a/docs/docs/operator/aspire.mdx +++ b/docs/docs/operator/aspire.mdx @@ -54,7 +54,7 @@ await host.RunAsync(); - **HTTP resilience** — the standard resilience handler (retries, circuit breaker, timeouts) is applied to all `HttpClient` instances. - **Health checks** — a default `self` liveness check tagged `live`. -:::tip Operator name +:::tip[Operator name] The OpenTelemetry service name and the tracing source name must match `OperatorSettings.Name` — otherwise the operator's reconciliation traces are never captured. Call `AddKubeOpsServiceDefaults()` **after** `AddKubernetesOperator()` so KubeOps can resolve the configured name automatically. If you must call it earlier, pass the name explicitly (and keep it in sync with `OperatorSettings.Name`): ```csharp @@ -96,7 +96,7 @@ builder.Build().Run(); - `RunWithKubernetes(k8s)` opts the operator into local execution against a Kubernetes target. - `PublishAsKubernetesOperator(k8s)` includes the operator, CRDs, RBAC, and service account in the Aspire Kubernetes publish/deploy output. -:::note Project reference +:::note[Project reference] When referencing `KubeOps.Aspire.Hosting` from an AppHost, mark it as a normal code reference so the AppHost SDK does not treat it as a resource: ```xml @@ -233,4 +233,4 @@ builder.AddKubeOps("operator") .PublishAsKubernetesOperator(aks, publish => publish.WithServiceAccount("operator")); ``` -For the deeper run/publish model, see [Aspire Kubernetes Operator Model](./aspire-kubernetes-model). +For the deeper run/publish model, see [Aspire Kubernetes Operator Model](./aspire-kubernetes-model). \ No newline at end of file