diff --git a/.vitepress/config.mts b/.vitepress/config.mts index 284f694e6..a6e089d61 100644 --- a/.vitepress/config.mts +++ b/.vitepress/config.mts @@ -98,11 +98,17 @@ export default withMermaid({ sidebar: { '/tutorials/': [ + { + text: 'Quickstarts', + items: [ + { text: 'No-code provider (HttpBin)', link: '/tutorials/provider-quick-start' }, + { text: 'Code-based provider (Wild West)', link: '/tutorials/code-based-provider-quick-start' }, + ] + }, { text: 'Tutorials', items: [ { text: 'Explore the example MSP', link: '/tutorials/explore-example-msp' }, - { text: 'Provider quick start', link: '/tutorials/provider-quick-start' }, { text: 'Consume a service from a controller', link: '/tutorials/consume-service-from-controller' }, { text: 'Build a multicluster-runtime provider', link: '/tutorials/build-multicluster-runtime-provider' }, ] diff --git a/package-lock.json b/package-lock.json index 95933eda2..bae01ed85 100644 --- a/package-lock.json +++ b/package-lock.json @@ -998,9 +998,6 @@ "arm" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1015,9 +1012,6 @@ "arm" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1032,9 +1026,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1049,9 +1040,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1066,9 +1054,6 @@ "loong64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1083,9 +1068,6 @@ "loong64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1100,9 +1082,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1117,9 +1096,6 @@ "ppc64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1134,9 +1110,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1151,9 +1124,6 @@ "riscv64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1168,9 +1138,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1185,9 +1152,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1202,9 +1166,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ diff --git a/public/img/quickstart/pm-account-create.png b/public/img/quickstart/pm-account-create.png new file mode 100644 index 000000000..6fb80252e Binary files /dev/null and b/public/img/quickstart/pm-account-create.png differ diff --git a/public/img/quickstart/pm-download-kubeconfig.png b/public/img/quickstart/pm-download-kubeconfig.png new file mode 100644 index 000000000..b55a7561c Binary files /dev/null and b/public/img/quickstart/pm-download-kubeconfig.png differ diff --git a/public/img/quickstart/pm-login.png b/public/img/quickstart/pm-login.png new file mode 100644 index 000000000..ee3336c41 Binary files /dev/null and b/public/img/quickstart/pm-login.png differ diff --git a/tutorials/code-based-provider-quick-start.md b/tutorials/code-based-provider-quick-start.md new file mode 100644 index 000000000..9b13d2682 --- /dev/null +++ b/tutorials/code-based-provider-quick-start.md @@ -0,0 +1,56 @@ +# Code-based provider quick start + +This quickstart is for cases where your provider ships its own controller (operator), CRDs, and optionally a custom UI microfrontend. It is the companion to the [No-code provider quick start](./provider-quick-start.md), which uses api-syncagent to expose an existing CRD with no provider-specific code. + +The reference implementation is the **Wild West provider**, which exposes a `Cowboys` API under the `wildwest.platform-mesh.io` group. The full walkthrough lives next to the code, in the [provider-quickstart](https://github.com/platform-mesh/provider-quickstart) repository — we keep it there rather than duplicating it here so the steps stay in sync with the code, charts, and `make` targets you actually run. + +::: tip Requires a local clone +Unlike the no-code quickstart, this one builds and runs code from the `provider-quickstart` repo. Clone it first — every step in the upstream guide is executed from inside that directory: + +```bash +git clone https://github.com/platform-mesh/provider-quickstart.git +cd provider-quickstart +``` +::: + +## Follow the walkthrough + +Run through the upstream guide end-to-end: + +**→ [provider-quickstart: Usage](https://github.com/platform-mesh/provider-quickstart#usage)** + +It covers: + +1. Setting the admin and compute kubeconfigs. +2. Creating the provider workspace hierarchy (`root:providers:quickstart`). +3. Bootstrapping provider resources (`make init`) — applies the `APIExport`, `APIResourceSchema`, `ProviderMetadata`, `ContentConfiguration`, and RBAC. +4. Building and loading container images into the local kind cluster. +5. Deploying the `wild-west` controller, `armament-sync` syncer, and portal microfrontend. +6. Trying it out — creating `Cowboy` resources with secret refs and using the `Armament` catalog (a kcp `CachedResource`) from a consumer workspace. +7. Debugging via the `marketplace` and `contentconfigurations` virtual workspaces. + +## Prerequisites + +- A local Platform Mesh setup from [Set up Platform Mesh locally](/how-to-guides/set-up-platform-mesh-locally.md). +- A local clone of [provider-quickstart](https://github.com/platform-mesh/provider-quickstart) (see the tip above). +- `kubectl` with the `kubectl-kcp` plugin, Helm 3, Go, and `make`. + +::: warning Admin kubeconfig required +Providers live in a dedicated workspace tree, so you need the **admin kubeconfig** to create the provider workspace and bootstrap resources. Regular user kubeconfigs will not have the required permissions today. +::: + +## How it relates to Platform Mesh concepts + +The four building blocks the upstream walkthrough exercises are documented here: + +| Building block | Reference | +| --- | --- | +| `APIExport` / `APIResourceSchema` | [API sharing](/concepts/api-sharing.md) | +| `ProviderMetadata` (Marketplace registration) | [Marketplace](/reference/components/marketplace.md) | +| `ContentConfiguration` (portal UI) | [ContentConfiguration](/reference/resources/content-configuration.md) | +| `CachedResource` (read-only catalogs to consumers) | [Virtual workspaces](/reference/components/kcp/virtual-workspaces.md) | + +## Next + +- Use the `provider-quickstart` repo as a template — fork it, replace `wildwest.platform-mesh.io` with your API group, define your CRD schema, and update `ProviderMetadata` and `ContentConfiguration`. +- Continue with [Consume a service from a controller](./consume-service-from-controller.md) to write the consumer side. diff --git a/tutorials/provider-quick-start.md b/tutorials/provider-quick-start.md index 98c507cb7..97f771c6f 100644 --- a/tutorials/provider-quick-start.md +++ b/tutorials/provider-quick-start.md @@ -2,6 +2,11 @@ This tutorial walks you through building your first service provider in Platform Mesh with api-syncagent. You will publish the HttpBin custom resource from a Kubernetes service cluster into kcp, then verify that a consumer workspace can create an HttpBin resource and receive status back. +::: tip No code provider +This provider is considered "no code", as all components are built and deployed. +It is using generic UI of Platform-Mesh and api-syncagent, without any custom provider-specific code. You will deploy the HttpBin operator as a black box and use api-syncagent to publish its CRD into kcp and synchronize resources. +::: + By the end of this tutorial, you will have: - a provider workspace in kcp with an APIExport for the HttpBin API @@ -10,7 +15,6 @@ By the end of this tutorial, you will have: - a PublishedResource that tells api-syncagent which CRD to expose - a consumer workspace that can bind the API and create an HttpBin resource -The full source code is available in [`platform-mesh/provider-quickstart`](https://github.com/platform-mesh/provider-quickstart). ::: warning Development preview The local setup is under active development. Commands and component versions may change. @@ -85,17 +89,17 @@ You will use two kubeconfigs: Run this from `helm-charts/local-setup`: ```bash -export KCP_KUBECONFIG=$(pwd)/.secret/kcp/admin.kubeconfig +export PM_KUBECONFIG=$(pwd)/.secret/kcp/admin.kubeconfig kind export kubeconfig --name platform-mesh -export KIND_KUBECONFIG=$HOME/.kube/config +export COMPUTE_KUBECONFIG=$HOME/.kube/config ``` Verify both connections: ```bash -KUBECONFIG=$KCP_KUBECONFIG kubectl kcp workspace use :root -kubectl --kubeconfig $KIND_KUBECONFIG get nodes +KUBECONFIG=$PM_KUBECONFIG kubectl kcp workspace use :root +kubectl --kubeconfig $COMPUTE_KUBECONFIG get nodes ``` ## Create the provider workspace @@ -103,21 +107,9 @@ kubectl --kubeconfig $KIND_KUBECONFIG get nodes Provider workspaces are organized under `root:providers`. Create the container workspace and the HttpBin provider workspace: ```bash -KUBECONFIG=$KCP_KUBECONFIG kubectl create-workspace providers \ - --type=root:providers \ - --ignore-existing \ - --server="https://localhost:8443/clusters/root" - -KUBECONFIG=$KCP_KUBECONFIG kubectl create-workspace httpbin-provider \ - --type=root:provider \ - --ignore-existing \ - --server="https://localhost:8443/clusters/root:providers" -``` - -Switch to the provider workspace: - -```bash -KUBECONFIG=$KCP_KUBECONFIG kubectl kcp workspace use :root:providers:httpbin-provider +KUBECONFIG=$PM_KUBECONFIG kubectl ws use : +KUBECONFIG=$PM_KUBECONFIG kubectl create-workspace providers --type=root:providers --enter --ignore-existing +KUBECONFIG=$PM_KUBECONFIG kubectl create-workspace httpbin-provider --type=root:provider --enter --ignore-existing ``` Expected output: @@ -131,11 +123,13 @@ Current workspace is "root:providers:httpbin-provider" (type root:provider). The APIExport makes the service API visible to consumers. Create it in the provider workspace: ```bash -KUBECONFIG=$KCP_KUBECONFIG kubectl apply -f - <