Skip to content

Commit a93865e

Browse files
authored
docs: update Aspire operator docs (#1149)
- Adjusted Markdown syntax for note and tip blocks.
1 parent 371dcae commit a93865e

2 files changed

Lines changed: 4 additions & 47 deletions

File tree

README.md

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -102,49 +102,6 @@ aspire run --project src/MyApp.AppHost/MyApp.AppHost.csproj
102102
aspire publish --project src/MyApp.AppHost/MyApp.AppHost.csproj --output-path ./artifacts/k8s
103103
```
104104

105-
Common AppHost shapes:
106-
107-
Local development only:
108-
109-
```csharp
110-
var dev = builder.AddKubernetesEnvironment("dev");
111-
112-
builder.AddKubeOps<Projects.AspireOperator>("operator")
113-
.RunWithKubernetes(dev, run => run.WithPersistentCrds());
114-
```
115-
116-
Azure publish/deploy only:
117-
118-
```csharp
119-
var aks = builder.AddAzureKubernetesEnvironment("aks");
120-
121-
builder.AddKubeOps<Projects.AspireOperator>("operator")
122-
.PublishAsKubernetesOperator(aks, publish => publish.WithServiceAccount("operator"));
123-
```
124-
125-
Local run and Azure deploy:
126-
127-
```csharp
128-
var dev = builder.AddKubernetesEnvironment("dev");
129-
var aks = builder.AddAzureKubernetesEnvironment("aks");
130-
131-
builder.AddKubeOps<Projects.AspireOperator>("operator")
132-
.RunWithKubernetes(dev)
133-
.PublishAsKubernetesOperator(aks);
134-
```
135-
136-
Publish only without an Aspire Kubernetes environment:
137-
138-
```csharp
139-
builder.AddKubeOps<Projects.AspireOperator>("operator")
140-
.PublishAsKubernetesOperator(publish =>
141-
{
142-
publish.Namespace = "operator-system";
143-
publish.WithServiceAccount("operator");
144-
});
145-
```
146-
147-
Without `RunWithKubernetes(...)`, `AddKubeOps<TProject>(...)` 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.
148105

149106
## Packages
150107

@@ -201,4 +158,4 @@ In short:
201158
202159
## Motivation
203160
204-
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.
161+
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.

docs/docs/operator/aspire.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ await host.RunAsync();
5454
- **HTTP resilience** &mdash; the standard resilience handler (retries, circuit breaker, timeouts) is applied to all `HttpClient` instances.
5555
- **Health checks** &mdash; a default `self` liveness check tagged `live`.
5656

57-
:::tip Operator name
57+
:::tip[Operator name]
5858
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`):
5959

6060
```csharp
@@ -96,7 +96,7 @@ builder.Build().Run();
9696
- `RunWithKubernetes(k8s)` opts the operator into local execution against a Kubernetes target.
9797
- `PublishAsKubernetesOperator(k8s)` includes the operator, CRDs, RBAC, and service account in the Aspire Kubernetes publish/deploy output.
9898

99-
:::note Project reference
99+
:::note[Project reference]
100100
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:
101101

102102
```xml
@@ -233,4 +233,4 @@ builder.AddKubeOps<Projects.AspireOperator>("operator")
233233
.PublishAsKubernetesOperator(aks, publish => publish.WithServiceAccount("operator"));
234234
```
235235

236-
For the deeper run/publish model, see [Aspire Kubernetes Operator Model](./aspire-kubernetes-model).
236+
For the deeper run/publish model, see [Aspire Kubernetes Operator Model](./aspire-kubernetes-model).

0 commit comments

Comments
 (0)