|
| 1 | +# ManagedProvider resource |
| 2 | + |
| 3 | +## Definition |
| 4 | + |
| 5 | +`ManagedProvider` is a namespace-scoped custom resource in the `providers.platform-mesh.io/v1alpha1` API group. It is a convenience API for platform admins to onboard platform-owned services end-to-end: it creates and manages a `Provider` on the kcp side, then copies the resulting kubeconfig and deploys service operator components on the runtime side. |
| 6 | + |
| 7 | +For the conceptual overview, see [Provider bootstrap](/concepts/provider-bootstrap.md). |
| 8 | + |
| 9 | +## Schema |
| 10 | + |
| 11 | +A minimal `ManagedProvider` requires a `platformMeshRef` and at least one `runtimeDeployments` entry: |
| 12 | + |
| 13 | +```yaml |
| 14 | +apiVersion: providers.platform-mesh.io/v1alpha1 |
| 15 | +kind: ManagedProvider |
| 16 | +metadata: |
| 17 | + name: my-service |
| 18 | + namespace: platform-mesh-system |
| 19 | +spec: |
| 20 | + platformMeshRef: |
| 21 | + name: platform-mesh |
| 22 | + runtimeDeployments: |
| 23 | + - ocm: |
| 24 | + componentName: my-service-operator |
| 25 | + registry: ghcr.io/platform-mesh/ocm |
| 26 | + version: "1.0.0" |
| 27 | +``` |
| 28 | +
|
| 29 | +### Spec fields |
| 30 | +
|
| 31 | +| Field | Required | Default | Description | |
| 32 | +| --- | --- | --- | --- | |
| 33 | +| `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. | |
| 39 | +| `provider.path` | No | `root:providers:system` | kcp workspace path where the `Provider` is created or adopted. | |
| 40 | +| `provider.name` | No | `<ManagedProvider.name>` | Name of the `Provider` to create or adopt at `provider.path`. | |
| 41 | +| `providerKubeconfigSecret.name` | No | `<ManagedProvider.name>-provider-kubeconfig` | Name of the Secret to store the copied kubeconfig in the runtime cluster. | |
| 42 | +| `providerKubeconfigSecret.key` | No | `kubeconfig` | Key in the Secret's data map. | |
| 43 | +| `runtimeKubeconfigSecretName` | No | Hosting cluster | Name of the Secret containing the kubeconfig for the target runtime cluster. | |
| 44 | +| `providerHostOverride` | No | Operator-configured front-proxy URL | Overrides the kcp front-proxy host in the generated kubeconfig. | |
| 45 | +| `cleanupOnDelete` | No | `false` | When `true`, also deletes the `Provider` on the kcp side when this resource is deleted, cascading to workspace deletion. | |
| 46 | + |
| 47 | +### Status fields |
| 48 | + |
| 49 | +| Field | Description | |
| 50 | +| --- | --- | |
| 51 | +| `phase` | Current lifecycle phase. See [Lifecycle](#lifecycle). | |
| 52 | +| `providerKubeconfigSecretRef` | Reference to the Secret in the runtime cluster containing the copied kubeconfig. | |
| 53 | +| `conditions` | Standard Kubernetes conditions, including `Ready`. | |
| 54 | + |
| 55 | +## Who creates it |
| 56 | + |
| 57 | +Platform admins create `ManagedProvider` resources to onboard platform-owned services. |
| 58 | + |
| 59 | +::: tip |
| 60 | +For service providers managing their own onboarding, see [`Provider`](./provider-resource.md). |
| 61 | +::: |
| 62 | + |
| 63 | +## Who reconciles it |
| 64 | + |
| 65 | +The **ManagedProvider controller**, part of the [Platform Mesh operator](/reference/components/platform-mesh-operator.md), orchestrates the full provider lifecycle — from platform readiness checks through `Provider` creation, kubeconfig distribution, and operator deployment. |
| 66 | + |
| 67 | +## What happens when you apply one |
| 68 | + |
| 69 | +1. Finalizers are added for ordered cleanup. |
| 70 | +2. The controller waits for the referenced `PlatformMesh` to be ready. |
| 71 | +3. It creates (or adopts) a `Provider` at the target kcp path, defaulting to `root:providers:system`. |
| 72 | +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. |
| 74 | + |
| 75 | +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. |
| 76 | + |
| 77 | +## Lifecycle |
| 78 | + |
| 79 | +```mermaid |
| 80 | +stateDiagram-v2 |
| 81 | + [*] --> Pending |
| 82 | + Pending --> WaitingForPlatformMesh |
| 83 | + WaitingForPlatformMesh --> WaitingForProvider |
| 84 | + WaitingForProvider --> CopyingKubeconfig |
| 85 | + CopyingKubeconfig --> CopyingKubeconfigFailed : spec mismatch |
| 86 | + CopyingKubeconfigFailed --> CopyingKubeconfig |
| 87 | + CopyingKubeconfig --> Deploying |
| 88 | + Deploying --> Ready |
| 89 | + Ready --> Deploying : spec change |
| 90 | + Ready --> Deleting |
| 91 | + CopyingKubeconfigFailed --> Deleting |
| 92 | + Deleting --> [*] |
| 93 | +``` |
| 94 | + |
| 95 | +## Related |
| 96 | + |
| 97 | +- [Provider bootstrap](/concepts/provider-bootstrap.md) |
| 98 | +- [Provider resource](./provider-resource.md) |
| 99 | +- [Platform Mesh operator](/reference/components/platform-mesh-operator.md) |
| 100 | +- [Platform owner persona](/concepts/personas/platform-owner.md) |
0 commit comments