From 629b3bcac12ddb0cd3ad2802da371b6a9a30d2d8 Mon Sep 17 00:00:00 2001 From: Simon Koudijs Date: Fri, 27 Nov 2026 16:38:12 +0000 Subject: [PATCH] docs: add persona pages for platform teams and application teams Add two pages that start from the reader's problem before any setup: - for-platform-teams.md: what changes for a platform team, how one installation serves many teams through grants, and three adoption stages (mirror, coordinate, explain) with their guides. - for-application-teams.md: the Kubernetes API as a settings backend with Git as the record, the k8s-trail coffee menu as a worked example, the sibling projects for the parts GitOps Reverser leaves to others, and why a product serves one kcp workspace per customer. Link both from a "Who uses GitOps Reverser" section on the landing page. Rewrite the opening of team-onboarding.md around one concrete scenario for the platform administrator, with a handoff to the team at step 5. Record the two personas in the docs plan. Co-Authored-By: Claude Opus 5.5 --- .docs-lint-scope | 2 + docs/README.md | 11 ++ docs/for-application-teams.md | 145 ++++++++++++++++++ docs/for-platform-teams.md | 106 +++++++++++++ docs/future/task-oriented-docs-and-website.md | 20 ++- docs/kcp-workspaces.md | 4 +- docs/team-onboarding.md | 29 +++- 7 files changed, 309 insertions(+), 8 deletions(-) create mode 100644 docs/for-application-teams.md create mode 100644 docs/for-platform-teams.md diff --git a/.docs-lint-scope b/.docs-lint-scope index 9e6298fd..b3b024f5 100644 --- a/.docs-lint-scope +++ b/.docs-lint-scope @@ -41,6 +41,8 @@ docs/attribution-setup-guide.md docs/kcp-workspaces.md docs/push-webhook.md docs/team-onboarding.md +docs/for-platform-teams.md +docs/for-application-teams.md docs/audit-setup/cluster/readme.md docs/sops-age-guide.md docs/commit-signing.md diff --git a/docs/README.md b/docs/README.md index cdc3ea60..3fa69176 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,6 +7,17 @@ These pages are organized by what you want to do. If you are new, read the Not sure this is the right tool? [Alternatives](alternatives.md) compares nearby tools and says when another approach fits better. +## Who uses GitOps Reverser + +- **Platform teams** run Kubernetes with a GitOps repository, and want people and tools to change + the cluster through the Kubernetes API while Git stays the record. Start with + [let teams change the cluster through Kubernetes](for-platform-teams.md). +- **Application teams** offer their users or customers an API, such as per-customer settings, and + want every change reviewable, attributed, and in their own Git repository. Start with + [offer your users an API, with every change in Git](for-application-teams.md). + +Both continue with **Get started** below. + ## 1. Get started Pick a setup path with one question: **does Flux or Argo CD apply the same folder GitOps Reverser diff --git a/docs/for-application-teams.md b/docs/for-application-teams.md new file mode 100644 index 00000000..d76912d1 --- /dev/null +++ b/docs/for-application-teams.md @@ -0,0 +1,145 @@ +# Offer your users an API, with every change in Git + +This page is for a software team whose application has settings or objects that people outside the +team change: a customer's settings in a SaaS product, a menu, limits, the integrations a tenant has +turned on. It shows how to serve those through the Kubernetes API, and how GitOps Reverser keeps a +reviewable, attributed record of every change in your own Git repository. + +It explains the shape and where each piece comes from. The steps live in the guides it links. + +## The problem + +Settings that people change at runtime usually end up in one of these places: + +- **A file in the application image:** every change is a release. +- **An admin backend and a database you build:** you write validation, permissions, an audit log, a + history view, and an export, and you operate all of it. +- **A feature-flag or configuration service:** fast to adopt, but the data, its history, and its + schema live in somebody else's system. +- **A values file in a GitOps repository:** history and review, but every change is a pull request + that someone has to know how to write. + +## The idea: the Kubernetes API as the backend + +Kubernetes already provides most of what a settings backend needs. Describe each kind of setting as +a custom resource, and the API server serves it: + +| What a settings backend needs | Where it comes from | +| --- | --- | +| A schema, enforced on every write | The CRD's OpenAPI schema and CEL validation rules | +| Who may read and who may write, per kind and per namespace | Kubernetes RBAC | +| Rules that span fields or objects | Admission policies, or a controller that reports in `status` | +| Live updates for the application and for open browser pages | The watch API | +| History, the author of each change, and the reason for it | **GitOps Reverser**: a commit per change, in your repository | +| Review before a change goes live | A Git branch and a pull request | +| Rollback | A Git revert | + +GitOps Reverser fills the rows Kubernetes leaves empty. It mirrors your custom resources into a +folder of your repository. With author attribution, each commit names the person the API server +authenticated for that change. With a `CommitRequest`, the application can pass on the user's own +explanation as the commit message. The data, its history, and its schema stay in your repository, +readable without any of this software. + +```mermaid +flowchart LR + U["Users: a browser app,
a CLI, an agent"] -->|"typed writes,
under RBAC"| K["Kubernetes API
(your CRDs)"] + K -->|"watch"| R["GitOps Reverser"] + R -->|"attributed commits"| G["Your Git repository"] + K -->|"watch: live settings"| A["Your application"] + G -->|"review, then apply
or package"| A +``` + +## An example: the coffee bar menu + +The [k8s-trail](https://github.com/ConfigButler/k8s-trail) repository is the record of a live demo +where a room full of people changed a cluster from their phones. One of its kinds is a +`CoffeeConfig`, the coffee bar's menu: + +1. A person signs in to the app and edits the menu. The app writes the `CoffeeConfig` through the + Kubernetes API with that person's own token, so RBAC and validation answer the request. +2. When the person saves, the app asks for a reason and passes it on with the change. +3. GitOps Reverser commits the change to the branch `coffee-change`. The commit's author is the + person who made the edit, and its message is the reason they typed. +4. Someone opens a pull request from `coffee-change` to `main` and merges it with a merge commit, + which keeps every person's authorship. +5. Flux applies `main`'s `configs/coffee/` folder to the production cluster. + +Every other kind in that demo is written straight to `main`. The coffee menu shows the choice you +make per kind: record the change, or record it and review it before it goes live. + +## What you build, and what GitOps Reverser does + +**You build:** + +- The CRDs for your settings, with their schema and validation rules. +- The Roles that decide who may read and change each kind. +- Any controller or admission policy your domain needs. +- The user interface, and how the application reads its settings. + +**GitOps Reverser does:** + +- Writes each selected object's `spec` and trimmed `metadata` as YAML into a folder you choose. It + never writes `status`. Each change becomes a commit within seconds, and + [commit windows](../README.md#commit-windows) group a burst of edits into one. +- Names the author of each change, with [author attribution](attribution-setup-guide.md). +- Uses the user's own reason as the commit message, through a + [`CommitRequest`](demo/commit-window.md). +- Holds a branch with a [`GitBranch`](configuration.md#one-tenant-end-to-end), so changes can wait + on a branch for review. +- Coordinates with Flux or Argo CD when they apply the same folder back: GitOps Reverser then + decides when the applier applies. See [bi-directional GitOps](bi-directional.md). + +## Pieces GitOps Reverser leaves to others + +GitOps Reverser does not serve your API, host a user interface, or deliver settings to your +workloads. These open-source projects from the same authors cover those parts. Check each project's +status before you depend on it. + +- **Browser access:** [krm-foyer](https://github.com/ConfigButler/krm-foyer) signs users in through + OIDC and proxies their Kubernetes requests with their own credential, so a browser app needs no + backend of its own. It is a working prototype. +- **Live views in the browser:** [krm-stream](https://github.com/ConfigButler/krm-stream) keeps a + live, recoverable view of resources in a page, and merges incoming changes with a user's local + edits. +- **Settings for a workload:** an application can watch its settings live through the API. Or + [settings-image](https://github.com/ConfigButler/settings-image) builds the Git folder into a small + OCI image that a pod mounts by digest, so a settings change rolls out, and rolls back, like any + image change. + +## One API per customer: why kcp + +When each customer changes their own settings, each customer needs their own space in the API. +There are two ways to give them one: + +- **A namespace per customer, on one cluster.** This is enough when every customer uses the same + CRDs, at the same version, and namespace-level RBAC is the isolation you need. CRDs are + cluster-wide, so a schema change reaches every customer at once. +- **A [kcp](https://www.kcp.io) workspace per customer.** A workspace is a customer's own Kubernetes + API, with its own namespaces, RBAC, and CRDs, but without a cluster of its own to run. It suits a + product with many customers, where each one should see only their own API. + +GitOps Reverser runs once, in an ordinary cluster beside kcp. It reaches each workspace through its +own `KubeProvider`, and writes each one to its own folder or repository. kcp sends the audit events +of all its workspaces in one shared stream, and GitOps Reverser can tell from each event which +workspace it came from, so every commit still names the right author. +[Mirror kcp workspaces](kcp-workspaces.md) has the steps. + +## Before you choose this + +- **Git is the record; the API serves the live state.** A change is in effect as soon as the API + accepts it, and reaches Git within seconds. When a change needs review first, record it on its + own branch and apply it only after the merge, as in the coffee example. +- **Author attribution needs the API server's audit settings.** Managed control planes that hide + them cannot name authors, and commits then carry the configured committer. On kcp, you set them + on each shard. +- **Your application depends on the API server being reachable**, unless it reads settings that + were already delivered, such as a mounted settings image. + +## Next steps + +1. Install GitOps Reverser and see a first commit: the [quick start](quickstart.md). +2. Mirror your custom resources: a `WatchRule` selects them like any other type. See + [start mirroring a team's resources](team-onboarding.md) for the objects involved. +3. Name the author of each change: [the attribution guide](attribution-setup-guide.md). +4. Serve one API per customer: [mirror kcp workspaces](kcp-workspaces.md). +5. When Flux or Argo CD applies the folder: [bi-directional GitOps](bi-directional.md). diff --git a/docs/for-platform-teams.md b/docs/for-platform-teams.md new file mode 100644 index 00000000..8f4cdf65 --- /dev/null +++ b/docs/for-platform-teams.md @@ -0,0 +1,106 @@ +# Let teams change the cluster through Kubernetes, with Git as the record + +This page is for a platform team that runs Kubernetes with a GitOps repository, usually applied by +Flux or Argo CD, and serves application teams who change what runs there. It shows what GitOps +Reverser changes for them, how one installation serves many teams, and which guides to follow in +which order. + +## The problem + +GitOps keeps the desired state in Git, so every change has to arrive as a commit. That works for the +people who know the repository, and creates friction for everyone else: + +- A developer who needs a ConfigMap changed has to know the folder layout, the overlays, and the + review rules, or file a ticket and wait. +- A portal, a CI job, or an AI agent that changes the cluster needs a Git client, credentials, and + knowledge of where each file lives. +- A `kubectl` fix during an incident either gets reverted at the next apply or lives on as drift. +- An existing cluster holds state that was never committed anywhere. + +## What changes + +People and tools change the cluster through the Kubernetes API: `kubectl`, a portal, a CI job, or an +agent. Kubernetes RBAC and admission decide what each of them may do. GitOps Reverser writes each +change into the right folder as a commit within seconds, and Flux or Argo CD keeps deploying from +the repository. + +- **Files keep their shape.** An update edits the existing YAML document in place, and in a + supported Kustomize layout it edits the source manifest. See + [what it can write](../README.md#what-it-can-write). +- **Each commit can name its author.** With [author attribution](attribution-setup-guide.md), the + commit names the identity the API server authenticated. +- **A commit can say why.** A [`CommitRequest`](demo/commit-window.md) groups a set of edits into one + commit with the author's own message. +- **The applier waits for Git.** When Flux or Argo CD applies a folder that GitOps Reverser writes, + an applier claim lets GitOps Reverser decide when the applier applies, so a live edit reaches Git + before the folder is applied again. See [bi-directional GitOps](bi-directional.md). + +## One installation, many teams + +One GitOps Reverser installation serves every team. The platform keeps the objects that hold +credentials in its own namespace, and lends them to teams through **grants**: + +- A `GitProvider` holds the repository credential, and grants which namespaces may hold which + branches. +- A `GitBranch` holds one branch, and grants which namespaces may write through it. +- A `KubeProvider` connects a cluster, and grants which namespaces may mirror which source + namespaces. + +Each team then creates its own `GitTarget`, which names its folder, and `WatchRule`s, which select +what to mirror, in its own namespace. + +![A platform namespace holds the shared GitProvider with its credentials Secret, a KubeProvider and +a GitReceiver; each team namespace has its own WatchRule and GitTarget writing its own branch of that +repository, and a push event is routed by repository and branch to the GitTarget that writes +it](images/config-platform-shared.excalidraw.svg) + +A team cannot reach a credential, branch, or cluster that the platform has not granted it, and it +decides everything else about its own folder. [The grants](configuration.md#the-grants) explains +every shape. + +## Adopt it in three stages + +Each stage stands on its own, so you can stop after any of them. + +**1. Mirror.** Start with folders that nothing applies: an audit trail of a namespace, or the first +commit of an existing cluster's state. Nothing about your current GitOps setup changes. + +- [Quick start](quickstart.md): install, and see a first commit. +- Connect your Git host: [GitHub](github-setup-guide.md) or + [Azure DevOps](azure-devops-getting-started.md). +- [Start mirroring a team's resources](team-onboarding.md): the grants, the branch, the team's + folder, and how to adopt an existing repository on a scratch branch first. + +**2. Coordinate.** Let GitOps Reverser write a folder that Flux or Argo CD applies, so a change can +come from either side. + +- [Bi-directional GitOps](bi-directional.md), then the [Flux](bi-directional-flux.md) or + [Argo CD](bi-directional-argocd.md) setup. +- [React promptly to Git pushes](push-webhook.md), so a push to the repository is applied within + seconds. + +**3. Explain.** Name who made each change, and why. + +- [Attribute commits to Kubernetes users](attribution-setup-guide.md), through the API server's + audit settings. +- [Group changes into one commit](demo/commit-window.md) with a `CommitRequest`. + +Alongside the stages: [encrypt Secrets with SOPS](sops-age-guide.md), +[sign commits](commit-signing.md), [narrow the controller's permissions](rbac.md), and +[monitor it](interpreting-metrics.md). + +## Before you choose this + +- **Git history is a record of the selected state, not of every event.** Commit windows group a + burst of edits into one commit, and a restart resyncs instead of replaying every change. +- **Author attribution needs the API server's audit settings.** Managed control planes that hide + them cannot name authors; commits then carry the configured committer. +- **Mirror what people author, and leave out what controllers generate.** A `Deployment` belongs + in Git; its `ReplicaSet`s and `Pod`s do not. See + [installing apps as KRM](installing-apps-as-krm.md). +- **Some layouts are refused.** GitOps Reverser edits plain manifests and a supported Kustomize + subset. It refuses a folder of Helm templates before writing anything. + +If your team offers an API to users or customers rather than running clusters for other teams, +[offer your users an API, with every change in Git](for-application-teams.md) is the better +starting point. diff --git a/docs/future/task-oriented-docs-and-website.md b/docs/future/task-oriented-docs-and-website.md index 2dacdc3d..357f84c7 100644 --- a/docs/future/task-oriented-docs-and-website.md +++ b/docs/future/task-oriented-docs-and-website.md @@ -13,6 +13,22 @@ Organize the reader-facing navigation around outcomes. A reader should be able t step without already knowing names such as `GitTarget`, attribution, or API-first publication. Keep architecture and configuration reference available alongside the task guides. +## Two personas + +The docs serve two kinds of reader, and each has a page that starts from its problem before any +setup: + +- **Platform teams** run Kubernetes with a GitOps repository and serve application teams: + [let teams change the cluster through Kubernetes](../for-platform-teams.md). +- **Application teams** offer their users or customers an API, such as per-customer settings: + [offer your users an API, with every change in Git](../for-application-teams.md). This is the page + that explains why a product would serve one kcp workspace per customer. + +A persona page explains GitOps Reverser's part, and links the sibling projects for the parts it +leaves to others (browser access, live views, delivering settings to workloads) instead of +documenting them here. An example earns its place on a persona page when it shows a decision GitOps +Reverser makes. + ## The four main categories These categories form the documentation landing page and the website's documentation navigation. @@ -121,8 +137,10 @@ even where source material does. Proposed guides are named by task, not by filen | `docs/README.md` | Documentation landing page | Exists: organized around the four categories; link each new guide as it lands | | Root `README.md` | Homepage | Exists: reuse the product explanation and demo | | `alternatives.md` | Homepage: is this right for me? | Exists: link from adoption guidance | +| `for-platform-teams.md` | Homepage and landing page: who uses it | Exists: the platform-team persona, the grants model, and the three adoption stages with their guides | +| `for-application-teams.md` | Homepage and landing page: who uses it | Exists: the application-team persona, the Kubernetes API as a settings backend, the k8s-trail example, sibling projects, and why kcp | | `quickstart.md` | Get started: mirror | Exists: verify a first commit without an applier claim or push webhook | -| `team-onboarding.md` | Get started: mirror | Exists: grants, branch, folder, selection, scratch-branch adoption, deletion policy; asks whether an applier deploys the folder | +| `team-onboarding.md` | Get started: mirror | Exists: one worked example for the platform administrator, with a handoff to the team at step 5; grants, branch, folder, selection, scratch-branch adoption, deletion policy | | `github-setup-guide.md` | Get started: Git host | Exists: link to the push webhook guide | | `push-webhook.md` | Get started: coordination | Exists: receiver listener, route, `GitReceiver`, GitHub webhook, verification, rotation, and the Azure DevOps limit | | `azure-devops-getting-started.md` | Get started: Git host | Exists: state the push webhook limit described below | diff --git a/docs/kcp-workspaces.md b/docs/kcp-workspaces.md index 71ef0464..8c7fc66c 100644 --- a/docs/kcp-workspaces.md +++ b/docs/kcp-workspaces.md @@ -2,7 +2,9 @@ This guide mirrors the resources of one or more [kcp](https://www.kcp.io) workspaces into Git, and optionally names the workspace user who made each change as the commit author. It is for a -platform administrator who runs kcp and installs GitOps Reverser beside it. +platform administrator who runs kcp and installs GitOps Reverser beside it. Why a product would +serve one workspace per customer is in +[offer your users an API, with every change in Git](for-application-teams.md#one-api-per-customer-why-kcp). The guide has two parts, and you can stop after the first: diff --git a/docs/team-onboarding.md b/docs/team-onboarding.md index dd7a86d7..28e89f01 100644 --- a/docs/team-onboarding.md +++ b/docs/team-onboarding.md @@ -1,16 +1,28 @@ # Start mirroring a team's resources -This guide takes one team from nothing to its resources landing in a folder of the team's -repository, ending at a first commit you can inspect. It is for a platform administrator onboarding -a team on an existing installation, and for the team owner who then decides what to mirror. +This guide is for a platform administrator who adds a team to an existing GitOps Reverser +installation. It follows one example from start to finish: + +> Acme's platform team keeps one repository, `acme/platform`, for every team. Team A runs its apps +> in the namespace `team-a`. It wants every change to its Deployments, Services, and ConfigMaps +> recorded in the folder `teams/team-a`, which nothing deploys yet. + +At the end, Team A's resources are in that folder, and every change to them becomes a commit. + +Steps 1 to 4 are yours: they lend the team a repository, a branch, and access to its namespace. +Steps 5 to 7 are the team's own choices, made in its own namespace. Do them together, or +[send the team to step 5](#5-team-choose-the-folder) when you are done. Repeat the guide for every +team on the same installation. It assumes GitOps Reverser is installed. If it is not, follow the [quick start](quickstart.md) -first. You can repeat this guide for every team on the same installation. +first. [Let teams change the cluster through Kubernetes](for-platform-teams.md) explains where this +guide fits in a platform's adoption. ## First: does Flux or Argo CD apply the folder? -Ask this before you pick the folder. If Flux or Argo CD applies the folder this team's resources -will be written to, the two tools need coordinating, or each commit GitOps Reverser makes is applied +Ask this before you pick the folder. Nothing deploys Team A's folder yet, but your team's may +already be deployed. If Flux or Argo CD applies the folder this team's resources will be written +to, the two tools need coordinating, or each commit GitOps Reverser makes is applied back over edits still in flight. In that case, finish this guide on a [scratch branch](#adopt-an-existing-repository-safely) that nothing deploys, then follow [bi-directional GitOps](bi-directional.md) before you point the team at the deployed folder. @@ -162,6 +174,9 @@ branch. ## 5. Team: choose the folder +From here on, the team works in its own namespace, with the Role from step 4. The platform has +lent it the `GitBranch` `platform/main` and the `KubeProvider` `gitops-reverser/local`. + A `GitTarget` names the folder, the branch, and the source cluster: ```yaml @@ -321,3 +336,5 @@ through every condition. - [Group related changes into one commit](demo/commit-window.md) with a `CommitRequest`. - [Encrypt Secrets with SOPS and age](sops-age-guide.md) before mirroring `Secret`s. - If Flux or Argo CD applies the folder: [bi-directional GitOps](bi-directional.md). +- If the team offers its own API to users or customers: + [offer your users an API, with every change in Git](for-application-teams.md).