Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions docs/docs/04-crossplane-101/02-first-composition.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ title: Your first Composition

import PairId from '@site/src/components/PairId';
import ValidateCheck from '@site/src/components/ValidateCheck';
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Your first Composition ⏱️ 22m

Expand All @@ -22,26 +24,16 @@ You're using **Crossplane v2**, so the resources Crossplane composes can be plai

### What's about to happen, in one picture

```mermaid
flowchart TB
user(["You"])
xrd["XRD<br/>hellos.workshop.example.io"]
crd["CRD<br/>hellos.workshop.example.io<br/>(generated)"]
comp["Composition<br/>hellos.workshop.example.io"]
fn["function-patch-and-transform"]
xr["Hello XR<br/>hello-world"]
cm["ConfigMap<br/>hello-world"]

user -- "kubectl apply" --> xrd
xrd == "Crossplane generates" ==> crd
user -- "kubectl apply" --> comp
user -- "kubectl apply" --> xr
xr == "kind matches XRD ⟶ runs" ==> comp
comp == "pipeline step" ==> fn
fn == "emits desired state" ==> cm
```
<ThemedImage
alt="The platform team applies an XRD and Composition; the user applies a Hello XR; Crossplane runs the Composition and produces a ConfigMap."
sources={{
light: useBaseUrl('/diagrams/first-composition-overview-light.svg'),
dark: useBaseUrl('/diagrams/first-composition-overview-dark.svg'),
}}
style={{ maxWidth: '100%', height: 'auto' }}
/>

The thick arrows are work Crossplane does for you; the thin arrows are things you `kubectl apply` yourself. Each step in the rest of this module is one of the thin arrows.
Yellow boxes are things the **platform team** owns (XRD, Composition) — applied once. The blue box is what a **user** `kubectl apply`s — per request. The green box is what **Crossplane produces** in response. In this module *you wear both hats*; in a real platform the two roles live on different teams.

### The pieces in the picture, defined

Expand Down
36 changes: 13 additions & 23 deletions docs/docs/04-crossplane-101/03-define-application.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ title: Define an Application

import PairId from '@site/src/components/PairId';
import ValidateCheck from '@site/src/components/ValidateCheck';
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Define an Application ⏱️ 35m

Expand Down Expand Up @@ -107,30 +109,18 @@ The Composition is the recipe — it creates six resources when an `Application`

#### The fan-out, in one picture

```mermaid
flowchart TB
xr["Application XR<br/>spec.message<br/>spec.color"]
comp["Composition<br/>applications.workshop.example.io"]
fn["function-patch-and-transform"]

subgraph composed["Composed resources (default namespace)"]
direction TB
fcm["ConfigMap<br/>frontend"]
fd["Deployment<br/>frontend / nginx"]
fs["Service<br/>frontend :80"]
bcm["ConfigMap<br/>backend<br/>data.message=…patched…"]
bd["Deployment<br/>backend / nginx"]
bs["Service<br/>backend :5678"]
end

xr == "triggers" ==> comp ==> fn
fn ==> fcm & fd & fs & bcm & bd & bs
xr -. "CombineFromComposite<br/>spec.message + spec.color<br/>→ data.message" .-> bcm
fd -. "volumeMounts" .-> fcm
bd -. "volumeMounts" .-> bcm
```
Same XRD-Composition-XR shape as [module 4](./first-composition), now with six composed resources instead of one:

<ThemedImage
alt="One Application XR fans out into six native Kubernetes resources: a ConfigMap, Deployment, and Service for the frontend, and the same three for the backend."
sources={{
light: useBaseUrl('/diagrams/define-application-fanout-light.svg'),
dark: useBaseUrl('/diagrams/define-application-fanout-dark.svg'),
}}
style={{ maxWidth: '100%', height: 'auto' }}
/>

The dashed arrow from the XR is the patch — the only place the XR's `message` and `color` fields actually flow into one of the composed resources. Everything else in the Composition is static template content. The two `volumeMounts` arrows are plain Kubernetes references (each Deployment mounts its ConfigMap by name) — nothing Crossplane-specific.
The XRD and Composition sit upstream (same yellow/platform boxes from module 4, omitted here to avoid repetition). The XR's `spec.message` and `spec.color` flow into one of the six composed resources — the **backend ConfigMap** — via a `CombineFromComposite` patch; everything else in the Composition is static template content. The frontend and backend Deployments each `volumeMount` their respective ConfigMap (plain Kubernetes wiring, not Crossplane-specific).

#### Walk through the recipe

Expand Down
54 changes: 30 additions & 24 deletions docs/docs/04-crossplane-101/05-add-a-provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ title: Add a Provider

import PairId from '@site/src/components/PairId';
import ValidateCheck from '@site/src/components/ValidateCheck';
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Add a Provider ⏱️ 25m

Expand Down Expand Up @@ -48,31 +50,35 @@ You've now seen most of the components a Crossplane platform is built from. Thre
| **ProviderConfig** ← *new this module* | Per-Provider runtime config (credentials, target endpoint). Namespaced flavor (in `*.m.crossplane.io` for providers that have caught up to v2). | You | Namespaced | — |
| **ClusterProviderConfig** ← *new this module* | Per-Provider runtime config — v2's cluster-scoped flavor, shared across namespaces. | You | Cluster | — |

### A Provider at runtime, in one picture

```mermaid
flowchart TB
user(["You"])
prov["Provider<br/>provider-helm:v1.2.0<br/>(package)"]
pod["Provider Pod<br/>(crossplane-system)"]
cpc["ClusterProviderConfig<br/>default"]
pc["ProviderConfig<br/>workshop-helm"]
rel["Release MR<br/>podinfo"]
helm[("OCI registry<br/>ghcr.io/stefanprodan/charts")]
cluster[("Kubernetes API<br/>(this cluster)")]

user -- "kubectl apply" --> prov
prov == "Crossplane installs" ==> pod
user -- "kubectl apply" --> cpc
user -- "kubectl apply" --> pc
user -- "kubectl apply" --> rel
rel -- "providerConfigRef" --> pc
pod == "watches" ==> rel
pod == "pulls chart" ==> helm
pod == "applies chart resources to" ==> cluster
```
### A Provider, in two pictures

A Provider has two phases worth seeing separately — **install-time** (platform engineer wires it up) and **runtime** (user applies an MR; Provider Pod reconciles it).

#### Install-time — what the platform engineer applies

<ThemedImage
alt="The platform engineer applies a Provider package; Crossplane core installs it by spawning a long-running Provider Pod."
sources={{
light: useBaseUrl('/diagrams/add-a-provider-install-light.svg'),
dark: useBaseUrl('/diagrams/add-a-provider-install-dark.svg'),
}}
style={{ maxWidth: '100%', height: 'auto' }}
/>

The Provider package is what spawns the long-running Pod. The two ProviderConfigs (cluster-scoped and namespaced) tell that Pod *how to authenticate* to the external API — they don't trigger any reconciliation on their own.

#### Runtime — what happens when a user applies an MR

<ThemedImage
alt="A user applies a Release managed resource. The Provider Pod watches it, pulls the chart from an OCI registry, and applies the resulting Kubernetes resources to the cluster apiserver."
sources={{
light: useBaseUrl('/diagrams/add-a-provider-runtime-light.svg'),
dark: useBaseUrl('/diagrams/add-a-provider-runtime-dark.svg'),
}}
style={{ maxWidth: '100%', height: 'auto' }}
/>

A Provider is a package whose install spawns a long-running Pod (thick arrows: Crossplane-managed work). The Pod watches MRs of its kinds — `Release.helm.m.crossplane.io` here — and translates each one into calls against an external API (for `provider-helm` that "API" is the Helm SDK pulling charts and applying them to the cluster's own apiserver).
The Pod watches MRs of its kinds — `Release.helm.m.crossplane.io` here — and translates each one into calls against an external API. For `provider-helm` that "API" is the Helm SDK pulling charts and applying them to the cluster's own apiserver. For `provider-aws-s3` it would be the AWS SDK; the shape is identical.

You're about to: install a Provider, configure it (with both flavors of `ProviderConfig`), and apply one Managed Resource that installs a Helm chart.

Expand Down
12 changes: 12 additions & 0 deletions docs/docs/05-crossplane-2xx/04-provider-setup-pattern.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,24 @@ sidebar_position: 4
title: Provider setup pattern
---

import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Provider setup pattern

Every Provider in Crossplane follows the same three-step shape: install the package, give it credentials through a ProviderConfig, then reference the config from your MRs. The 101 path walked you through it once with `provider-helm`. This page collects the variations — credential sources, cluster vs namespaced ProviderConfig, version pinning, where to find providers — so you don't have to re-derive them every time.

## 5.1 The shape

<ThemedImage
alt="A Provider spawns a Pod, a ProviderConfig points the Pod at a Secret, and a Managed Resource references the ProviderConfig. The Pod watches the MR and calls the External API."
sources={{
light: useBaseUrl('/diagrams/provider-setup-pattern-light.svg'),
dark: useBaseUrl('/diagrams/provider-setup-pattern-dark.svg'),
}}
style={{ maxWidth: '100%', height: 'auto' }}
/>

Three objects, in order:

1. **`Provider`** (`pkg.crossplane.io/v1`). A package whose install spawns a long-running Pod in `crossplane-system`. The Pod registers CRDs and reconciles MRs of those kinds.
Expand Down
13 changes: 13 additions & 0 deletions docs/docs/05-crossplane-2xx/05-composition-functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ title: Compose with other functions
---

import PairId from '@site/src/components/PairId';
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Compose with other functions

Expand All @@ -23,6 +25,17 @@ You're about to rewrite one of your 101 Compositions with a different function a

## 5.2 What you can achieve

A Composition's pipeline is a list of function steps. Each step receives the previous step's desired state — so a real Composition can mix functions:

<ThemedImage
alt="An XR enters a pipeline of one or more functions. Step 1 (e.g. function-go-templating) produces a first version of desired state; step 2 (e.g. function-patch-and-transform) receives that desired state and adds final patches. The final desired state is the set of composed resources."
sources={{
light: useBaseUrl('/diagrams/composition-functions-pipeline-light.svg'),
dark: useBaseUrl('/diagrams/composition-functions-pipeline-dark.svg'),
}}
style={{ maxWidth: '100%', height: 'auto' }}
/>

- **Templated YAML with conditionals and loops.** [`function-go-templating`](https://github.com/crossplane-contrib/function-go-templating) lets you write the desired-state manifests as Go templates over the XR spec. `range` over a list, `if` on a flag, `include` partials — the same primitives you have in Helm charts.
- **A typed config language for composition.** [`function-kcl`](https://github.com/crossplane-contrib/function-kcl) runs [KCL](https://www.kcl-lang.io/) programs that read the observed pipeline state and emit desired resources. Schemas, type checking, and lambdas without dropping into a general-purpose language.
- **Python for composition logic.** [`function-python`](https://github.com/crossplane-contrib/function-python) runs Python inside the pipeline. Useful when the transform is easier to express as a few lines of code than as patches — and lets you reuse libraries you already trust.
Expand Down
14 changes: 13 additions & 1 deletion docs/docs/06-crossplane-3xx/02-configurations.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
sidebar_position: 2
title: Package as a Configuration
ai_edit: locked
---

import PairId from '@site/src/components/PairId';
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Package as a Configuration ⏱️ 20m

Expand All @@ -24,6 +25,17 @@ Three reasons this matters:

You're about to read three short upstream pages, then decide whether to actually build and push your `Application` API as a Configuration.

The full lifecycle, end to end:

<ThemedImage
alt="The platform engineer's YAML sources (XRD + Composition) plus a crossplane.yaml metadata file are built into a .xpkg OCI artifact, pushed to an OCI registry, then installed on a target cluster by applying a Configuration MR. Crossplane resolves and pulls the Providers and Functions declared in dependsOn."
sources={{
light: useBaseUrl('/diagrams/configurations-packaging-light.svg'),
dark: useBaseUrl('/diagrams/configurations-packaging-dark.svg'),
}}
style={{ maxWidth: '100%', height: 'auto' }}
/>

## 6.2 Hints ⏱️ 15m

This is a 3XX module — pointers, not a recipe. Open the upstream docs and work through them in this order:
Expand Down
12 changes: 12 additions & 0 deletions docs/docs/08-journeys/02-microservice-templates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ sidebar_position: 2
title: Microservice templates
---

import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Microservice templates

> You're a platform engineer. Your developers should be able to request a new `Application` and get an opinionated golden path back: a managed database, a GitHub repo wired up for CI, the workloads it needs in the cluster, and the glue between them. Everything they don't want to think about is decided for them.
Expand All @@ -11,6 +14,15 @@ title: Microservice templates

An XR — call it `Application` — that takes a handful of inputs (name, team, database flavour) and composes everything a new microservice needs. One XR per service. Developers never write a Deployment, a Bucket MR, or a GitHub Repository directly; they edit one short YAML and push it.

<ThemedImage
alt="One Application XR fans out into in-cluster native resources (two Deployments and a ConfigMap) and external resources via Providers (a managed database and a GitHub repository)."
sources={{
light: useBaseUrl('/diagrams/microservice-templates-scope-light.svg'),
dark: useBaseUrl('/diagrams/microservice-templates-scope-dark.svg'),
}}
style={{ maxWidth: '100%', height: 'auto' }}
/>

## Suggested steps

1. Start from the [Define an Application](../crossplane-101/define-application) module — the namespaced XRD + Composition that emits frontend/backend Deployments and a ConfigMap. That is the shape you'll grow into a full platform XR.
Expand Down
14 changes: 14 additions & 0 deletions docs/docs/79-cheatsheet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ sidebar_position: 79
title: Cheatsheet
---

import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# Cheatsheet

A reference you keep open. Every term, command, and link you'll need during the workshop is on this page. Skim it once, then come back whenever a module uses a word you don't remember.
Expand Down Expand Up @@ -142,6 +145,17 @@ You don't need any of these to finish the workshop — plain `kubectl` is enough

You'll do the second of these in modules 4-6 of this workshop, then add a Provider in module 7.

**One picture for the whole loop:**

<ThemedImage
alt="Users apply either an XR (which triggers a Composition that emits native resources or MRs) or an MR directly (which a Provider Pod watches and reconciles by calling an external API). The two halves of Crossplane meet when a Composition emits an MR."
sources={{
light: useBaseUrl('/diagrams/cheatsheet-crossplane-loop-light.svg'),
dark: useBaseUrl('/diagrams/cheatsheet-crossplane-loop-dark.svg'),
}}
style={{ maxWidth: '100%', height: 'auto' }}
/>

### Core objects

The `Scope` column has a subtle split. CRDs and XRDs are themselves cluster-scoped *objects* — but they *define a kind* whose own scope (Namespaced vs Cluster) is set in the definition's `spec.scope`. The "Defines a kind that is" column captures that.
Expand Down
13 changes: 3 additions & 10 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ const config = {
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Enable Mermaid diagrams in MDX (```mermaid fenced blocks).
// Used in the 101 modules to visualise XRD/Composition/XR fan-out
// and Provider runtime architecture.
markdown: {
mermaid: true,
},

// English is the source of truth (see AGENTS.md §Localization).
// The `it` build is generated by translating English MDX; CI enforces
// that every English file has a matching, in-sync Italian translation.
Expand All @@ -46,10 +39,10 @@ const config = {
],
],

// Site-wide themes: mermaid (for ```mermaid fenced blocks in 101) plus
// `@easyops-cn/docusaurus-search-local` for client-side full-text search.
// Site-wide themes: `@easyops-cn/docusaurus-search-local` for client-side
// full-text search. (Architecture diagrams in the 101 modules ship as
// pre-rendered SVGs under docs/static/diagrams/ — no theme needed.)
themes: [
'@docusaurus/theme-mermaid',
[
require.resolve('@easyops-cn/docusaurus-search-local'),
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
sidebar_position: 5
title: La tua prima Composition
translation_source_commit: b9740d8f59a6d14db97207972119970ee1df640e
translation_source_commit: cd9ca7f3ee5014b1e43c7eb101d326386c866423
---

import PairId from '@site/src/components/PairId';
import ValidateCheck from '@site/src/components/ValidateCheck';
import ThemedImage from '@theme/ThemedImage';
import useBaseUrl from '@docusaurus/useBaseUrl';

# La tua prima Composition ⏱️ 22m

Expand All @@ -23,26 +25,18 @@ Stai usando **Crossplane v2**, quindi le risorse che Crossplane compone possono

### Cosa sta per succedere, in un'immagine

```mermaid
flowchart TB
user(["You"])
xrd["XRD<br/>hellos.workshop.example.io"]
crd["CRD<br/>hellos.workshop.example.io<br/>(generated)"]
comp["Composition<br/>hellos.workshop.example.io"]
fn["function-patch-and-transform"]
xr["Hello XR<br/>hello-world"]
cm["ConfigMap<br/>hello-world"]

user -- "kubectl apply" --> xrd
xrd == "Crossplane generates" ==> crd
user -- "kubectl apply" --> comp
user -- "kubectl apply" --> xr
xr == "kind matches XRD ⟶ runs" ==> comp
comp == "pipeline step" ==> fn
fn == "emits desired state" ==> cm
```
<ThemedImage
alt="Il platform team applica un XRD e una Composition; l'utente applica un Hello XR; Crossplane esegue la Composition e produce una ConfigMap."
sources={{
light: useBaseUrl('/diagrams/first-composition-overview-light.svg'),
dark: useBaseUrl('/diagrams/first-composition-overview-dark.svg'),
}}
style={{ maxWidth: '100%', height: 'auto' }}
/>

I box gialli sono cose che il **platform team** possiede (XRD, Composition) — applicate una volta. Il box blu è ciò che un **utente** fa `kubectl apply` — per ogni richiesta. Il box verde è ciò che **Crossplane produce** in risposta. In questo modulo *indossi entrambi i cappelli*; in una piattaforma reale i due ruoli vivono in team diversi.

Le frecce spesse sono il lavoro che Crossplane fa per te; le frecce sottili sono cose che fai tu con `kubectl apply`. Ogni passo del resto del modulo è una delle frecce sottili.
*(Etichette del diagramma in inglese per coerenza con il codice e i nomi delle risorse.)*

### I pezzi nell'immagine, definiti

Expand Down
Loading
Loading