Skip to content

Commit ab82858

Browse files
authored
Rework providers docs for ManagedProviders (#236)
Signed-off-by: Mangirdas Judeikis <mangirdas@judeikis.lt>
1 parent cdec8d9 commit ab82858

4 files changed

Lines changed: 51 additions & 19 deletions

File tree

concepts/provider-bootstrap.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Platform Mesh provisions a dedicated kcp workspace for each service provider. Cr
66

77
## The provider workspace
88

9-
Each provider workspace lives under `root:providers` and is identified by the `Provider` name combined with a unique identifier for that particular `Provider` object. The identifier is stable for the lifetime of the resource and prevents name collisions across tenants or after deletion and recreation.
9+
Each provider workspace lives under `root:providers` and is identified by the `Provider` name combined with the logical cluster ID of the workspace where the `Provider` object was created. The name is deterministic: two tenants can create a `Provider` with the same name without colliding, and deleting and recreating a `Provider` in the same workspace maps back to the same provider workspace.
1010

11-
The workspace is the provider's exclusive domain. Platform Mesh creates it and issues credentials but does not manage the resources inside it.
11+
The workspace is the provider's exclusive domain. Platform Mesh creates it and provisions the access credentials inside it — a ServiceAccount, its RBAC binding, and a token, from which the kubeconfig is generated — but manages nothing else there; the provider owns the contents.
1212

1313
## Provider
1414

@@ -23,9 +23,9 @@ With the workspace bootstrapped, service controllers use the kubeconfig to watch
2323

2424
## ManagedProvider
2525

26-
`ManagedProvider` is a Platform Mesh runtime resource, reconciled by the platform-mesh controller. Platform admins use it as a convenience API to onboard platform-owned services: a single resource handles workspace provisioning, kubeconfig distribution, and operator deployment end-to-end.
26+
`ManagedProvider` is a Platform Mesh runtime resource, reconciled by the Platform Mesh operator. Platform admins use it as a convenience API to onboard platform-owned services: a single resource handles workspace provisioning, kubeconfig distribution, and operator deployment end-to-end.
2727

28-
On the kcp side, a `ManagedProvider` creates a `Provider` in `root:providers:system` and waits for it to be ready. On the runtime side, it copies the resulting kubeconfig into Platform Mesh's runtime cluster and deploys the service operator components.
28+
On the kcp side, a `ManagedProvider` creates a `Provider` and waits for it to be ready — by default named after the `ManagedProvider` in `root:providers:system`, or created/adopted at an explicit path via a provider reference. On the runtime side, it copies the resulting kubeconfig into Platform Mesh's runtime cluster and deploys the service operator components, declared as Helm charts delivered either directly via Flux or resolved from an OCM component.
2929

3030
The split between `Provider` and `ManagedProvider` reflects the split between kcp-level and runtime-level effects: a `Provider` can only affect kcp, while a `ManagedProvider` is owned and operated by the platform admin on Platform Mesh's runtime cluster.
3131

how-to-guides/onboard-managed-service.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Use `ManagedProvider` when the platform team owns and operates the service. For
1515

1616
- A running Platform Mesh environment with a `PlatformMesh` resource in the `Ready` state
1717
- `kubectl` access to the Platform Mesh runtime cluster
18-
- The service operator published as an OCM component in an accessible registry
18+
- The service operator published as a Helm chart in an accessible OCI registry or Helm repository — or, if you deploy via OCM, published as an OCM component (this additionally requires the ocm-controller in the runtime cluster)
1919

2020
## Step 1: Create the ManagedProvider resource
2121

22-
Apply a `ManagedProvider` in the same namespace as the `PlatformMesh` instance. Set `platformMeshRef.name` to the name of your `PlatformMesh` resource and list each operator component under `runtimeDeployments`:
22+
Apply a `ManagedProvider` in the same namespace as the `PlatformMesh` instance. Set `platformMeshRef.name` to the name of your `PlatformMesh` resource and list each operator component under `runtimeDeployments`. Each entry sets exactly one of `flux` (Helm chart fetched directly from an OCI registry or Helm repository) or `ocm` (chart resolved from an OCM component descriptor):
2323

2424
```yaml
2525
apiVersion: providers.platform-mesh.io/v1alpha1
@@ -31,10 +31,21 @@ spec:
3131
platformMeshRef:
3232
name: platform-mesh
3333
runtimeDeployments:
34+
- flux:
35+
registry: ghcr.io/my-org/charts
36+
chart: my-service-operator
37+
version: "1.0.0"
38+
```
39+
40+
To deploy from an OCM component instead, replace the `flux` entry with:
41+
42+
```yaml
43+
runtimeDeployments:
3444
- ocm:
35-
componentName: my-service-operator
36-
registry: ghcr.io/my-org/ocm
45+
registry: ghcr.io/my-org
46+
component: github.com/my-org/my-service
3747
version: "1.0.0"
48+
resourceName: chart
3849
```
3950

4051
```bash
@@ -99,7 +110,7 @@ kubectl get pods -n platform-mesh-system -l app.kubernetes.io/name=my-service-op
99110
| Stuck at `WaitingForProvider` | The associated `Provider` has not yet reached `Ready` — check the Provider controller logs for workspace or kubeconfig provisioning errors |
100111
| Stuck at `CopyingKubeconfig` | The Provider controller has not yet populated the kubeconfig Secret — check the Provider controller logs |
101112
| Stuck at `CopyingKubeconfigFailed` | The `providerKubeconfigSecret` spec on the `Provider` does not match what the `ManagedProvider` expects — ensure the `providerKubeconfigSecret` fields are aligned between both resources |
102-
| Stuck at `Deploying` | The OCM component version does not exist in the registry, or FluxCD is not reconciling — check HelmRelease status in the namespace |
113+
| Stuck at `Deploying` | The chart or OCM component version does not exist in the registry, FluxCD is not reconciling, or (for `ocm` entries) the ocm-controller is not installed — check HelmRelease and OCM resource status in the namespace |
103114
| `Ready` but pods not running | The operator chart values may be misconfigured — check the HelmRelease events and operator pod logs |
104115

105116
## Related

reference/resources/managed-provider-resource.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ For the conceptual overview, see [Provider bootstrap](/concepts/provider-bootstr
88

99
## Schema
1010

11-
A minimal `ManagedProvider` requires a `platformMeshRef` and at least one `runtimeDeployments` entry:
11+
A minimal `ManagedProvider` requires a `platformMeshRef` and at least one `runtimeDeployments` entry. Each entry deploys one Helm chart and sets exactly one of `flux` (chart fetched directly from an OCI registry or Helm repository) or `ocm` (chart resolved from an OCM component descriptor):
1212

1313
```yaml
1414
apiVersion: providers.platform-mesh.io/v1alpha1
@@ -20,22 +20,43 @@ spec:
2020
platformMeshRef:
2121
name: platform-mesh
2222
runtimeDeployments:
23+
- flux:
24+
registry: ghcr.io/my-org/charts
25+
chart: my-service-operator
26+
version: "1.0.0"
27+
```
28+
29+
The same deployment resolved from an OCM component instead:
30+
31+
```yaml
32+
runtimeDeployments:
2333
- ocm:
24-
componentName: my-service-operator
25-
registry: ghcr.io/platform-mesh/ocm
34+
registry: ghcr.io/my-org
35+
component: github.com/my-org/my-service
2636
version: "1.0.0"
37+
resourceName: chart
2738
```
2839
2940
### Spec fields
3041
3142
| Field | Required | Default | Description |
3243
| --- | --- | --- | --- |
3344
| `platformMeshRef.name` | Yes | — | Name of the `PlatformMesh` instance this `ManagedProvider` belongs to. |
34-
| `runtimeDeployments` | Yes | — | List of OCM components to deploy on the runtime cluster. |
35-
| `runtimeDeployments[].ocm.componentName` | Yes | — | Fully qualified OCM component name. |
36-
| `runtimeDeployments[].ocm.registry` | Yes | — | OCM registry host. |
37-
| `runtimeDeployments[].ocm.version` | Yes | — | Component version to deploy. |
38-
| `runtimeDeployments[].ocm.values` | No | — | Helm values passed to the deployed chart. |
45+
| `runtimeDeployments` | Yes | — | List of components to deploy on the runtime cluster. Each entry sets exactly one of `flux` or `ocm`. |
46+
| `runtimeDeployments[].flux.type` | No | `oci` | How the chart is fetched: `oci` (OCI artifact via a Flux `OCIRepository`) or `helm` (HTTP(S) Helm repository via a Flux `HelmRepository`). |
47+
| `runtimeDeployments[].flux.registry` | Yes | — | Chart source: for `type: oci`, the OCI registry host and base path (e.g. `ghcr.io/my-org/charts`); for `type: helm`, the Helm repository URL. |
48+
| `runtimeDeployments[].flux.chart` | Yes | — | Chart name: the OCI repository path under the registry, or the chart name within the Helm repository. |
49+
| `runtimeDeployments[].flux.version` | Yes | — | Chart version to deploy (the OCI tag for `type: oci`). |
50+
| `runtimeDeployments[].flux.values` | No | — | Helm values passed to the deployed chart. |
51+
| `runtimeDeployments[].flux.insecure` | No | `false` | Allow plain-HTTP access to the OCI repository. |
52+
| `runtimeDeployments[].ocm.registry` | Yes | — | OCM/OCI registry root that holds the component (e.g. `ghcr.io/my-org`). |
53+
| `runtimeDeployments[].ocm.component` | Yes | — | Fully qualified OCM component name (e.g. `github.com/my-org/my-service`). |
54+
| `runtimeDeployments[].ocm.version` | Yes | — | OCM component version (semver). |
55+
| `runtimeDeployments[].ocm.resourceName` | No | `chart` | OCM resource name within the component to deploy. |
56+
| `runtimeDeployments[].ocm.referencePath` | No | — | List of `{name: ...}` elements navigating nested component references to reach the resource. |
57+
| `runtimeDeployments[].ocm.name` | No | Derived from `resourceName`, `referencePath`, or the component name | Name for the generated deployment objects. Set it explicitly when several entries share the same component name. |
58+
| `runtimeDeployments[].ocm.values` | No | — | Helm values passed to the resolved chart. |
59+
| `runtimeDeployments[].ocm.insecure` | No | `false` | Allow plain-HTTP access to the registry. |
3960
| `provider.path` | No | `root:providers:system` | kcp workspace path where the `Provider` is created or adopted. |
4061
| `provider.name` | No | `<ManagedProvider.name>` | Name of the `Provider` to create or adopt at `provider.path`. |
4162
| `providerKubeconfigSecret.name` | No | `<ManagedProvider.name>-provider-kubeconfig` | Name of the Secret to store the copied kubeconfig in the runtime cluster. |
@@ -70,7 +91,7 @@ The **ManagedProvider controller**, part of the [Platform Mesh operator](/refere
7091
2. The controller waits for the referenced `PlatformMesh` to be ready.
7192
3. It creates (or adopts) a `Provider` at the target kcp path, defaulting to `root:providers:system`.
7293
4. Once the `Provider` is ready, it copies the resulting kubeconfig into a Secret on the runtime cluster.
73-
5. It deploys each component listed in `runtimeDeployments` via OCM and FluxCD.
94+
5. It deploys each component listed in `runtimeDeployments`: `flux` entries go straight to Flux (`OCIRepository`/`HelmRepository` + `HelmRelease`); `ocm` entries first have their component descriptor resolved by the ocm-controller (which must be installed in the runtime cluster), and the resolved chart is then deployed via Flux.
7495

7596
By default, deleting a `ManagedProvider` removes the runtime deployments and the copied kubeconfig but leaves the kcp `Provider` and its workspace intact. Set `cleanupOnDelete: true` to also remove the `Provider` and cascade to the workspace.
7697

reference/resources/provider-resource.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The **Provider controller**, part of the [Platform Mesh operator](/reference/com
5454
## What happens when you apply one
5555

5656
1. Finalizers are added for ordered cleanup.
57-
2. A workspace (WorkspaceType **`root:provider`**) is created under `root:providers`. Its name is `<Provider.name>-<random-suffix>`.
57+
2. A workspace (WorkspaceType **`provider`**, declared in `root`) is created under `root:providers`. Its name is `<Provider.name>-<cluster-id>`, where `<cluster-id>` is the logical cluster ID (the `kcp.io/cluster` annotation) of the workspace holding the `Provider`. The name is deterministic: recreating the same `Provider` in the same workspace maps back to the same provider workspace, while equal names created by different tenants do not collide.
5858
3. Inside that workspace, a ServiceAccount, ClusterRoleBinding, and token Secret are created.
5959
4. A kubeconfig is generated from those credentials and written to the Secret specified by `providerKubeconfigSecret` (or the default location). The Secret is placed in the workspace where the `Provider` object lives, not in the provider workspace itself.
6060
5. `status.phase` transitions to `Ready` once provisioning completes.

0 commit comments

Comments
 (0)