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
3 changes: 3 additions & 0 deletions .docs-lint-scope
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ docs/bi-directional.md
docs/README.md
docs/github-setup-guide.md
docs/attribution-setup-guide.md
docs/kcp-workspaces.md
docs/push-webhook.md
docs/team-onboarding.md
docs/audit-setup/cluster/readme.md
docs/sops-age-guide.md
docs/commit-signing.md
Expand Down
134 changes: 94 additions & 40 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,99 @@
# Documentation

This repository has two kinds of markdown:

- stable user/operator guides
- maintainer notes, design docs, and working plans

If you only want the supported product docs, start with the files below.

## Start here

- [`../README.md`](../README.md): product overview and supported workflows
- [`quickstart.md`](quickstart.md): installation and your first Git commit
- [`demo/commit-window.md`](demo/commit-window.md): two resources and a `CommitRequest`
- [`configuration.md`](configuration.md): core configuration objects, every setting, and how
they fit together
- [`commit-messages.md`](commit-messages.md): the three commit message templates and their context
- [`api-first-publication.md`](api-first-publication.md): why API edits drive publication, how
replay handles remote changes, and how commit windows and push timing fit together
- [`installing-apps-as-krm.md`](installing-apps-as-krm.md): installing an app is adding a KRM
document: Flux `HelmRelease`, Argo CD `Application`, KRO, and core resources all mirror and edit alike
- [`commit-signing.md`](commit-signing.md): how valid Git signatures map to platform verification
- [`github-setup-guide.md`](github-setup-guide.md): GitHub repository and credential setup
- [`azure-devops-getting-started.md`](azure-devops-getting-started.md): Azure DevOps repository and credential setup
- [`attribution-setup-guide.md`](attribution-setup-guide.md): naming real Kubernetes users as commit
authors via kube-apiserver audit delivery
- [`sops-age-guide.md`](sops-age-guide.md): Secret encryption with SOPS + age
- [`security-model.md`](security-model.md): controller access, trust boundaries, and the Git
credentials Secret shape
- [`rbac.md`](rbac.md): the two ClusterRoles (plus the optional applier grants), and how to stop the
reverser enumerating Secrets
- [`bi-directional.md`](bi-directional.md): when Flux or Argo CD applies a folder GitOps Reverser
writes, and why every other setup needs nothing
- [`bi-directional-flux.md`](bi-directional-flux.md): the complete Flux setup for such a folder
- [`bi-directional-argocd.md`](bi-directional-argocd.md): the complete Argo CD setup for such a folder
- [`alternatives.md`](alternatives.md): nearby tools and when another approach fits better
- [`UPGRADING.md`](UPGRADING.md): breaking changes and migration steps, newest first
- [`../CONTRIBUTING.md`](../CONTRIBUTING.md): contributor workflow and validation commands
- [`style-guide.md`](style-guide.md): how docs here are written, including the no-em-dash rule and
the American-English decision
- [`../test/e2e/E2E_DEBUGGING.md`](../test/e2e/E2E_DEBUGGING.md): e2e troubleshooting, reuse,
and `.stamps`
GitOps Reverser turns changes made through the Kubernetes API into commits in a Git repository.
These pages are organized by what you want to do. If you are new, read the
[product overview](../README.md) first, then follow **Get started** from the top.

Not sure this is the right tool? [Alternatives](alternatives.md) compares nearby tools and says when
another approach fits better.

## 1. Get started

Pick a setup path with one question: **does Flux or Argo CD apply the same folder GitOps Reverser
writes?** If yes, follow [coordinate changes from Kubernetes and Git](#coordinate-changes-from-kubernetes-and-git),
even when you only want to record cluster changes for now. An applier that keeps deploying that
folder needs coordination either way. If no, follow [mirror cluster state into Git](#mirror-cluster-state-into-git).

### Mirror cluster state into Git

The shortest path to a commit in Git, with no applier and no Git push webhook. It mirrors the
selected cluster state; batching and restarts mean Git history is not a complete record of every
event.

1. **Install GitOps Reverser and see a first commit:** [quick start](quickstart.md).
2. **Connect your Git host:** [GitHub](github-setup-guide.md) or
[Azure DevOps](azure-devops-getting-started.md).
3. **Start mirroring a team's resources:** [onboard a team](team-onboarding.md): the repository,
branch, folder, namespaces, and resources it mirrors, and how to adopt an existing repository
on a scratch branch first.
4. **Optional: record who made each change:** [attribute commits to Kubernetes users](attribution-setup-guide.md)
through API-server audit delivery. It needs control over the API server's audit settings;
[the k3s example](audit-setup/cluster/readme.md) shows a complete configuration.

### Coordinate changes from Kubernetes and Git

For a folder that Flux or Argo CD also applies. Start with the path above, then:

1. **Understand why coordination is needed:** [bi-directional GitOps](bi-directional.md).
2. **Configure the applier:** [Flux](bi-directional-flux.md) or [Argo CD](bi-directional-argocd.md).
3. **React promptly to Git pushes:** [point the Git host's push webhook at GitOps Reverser](push-webhook.md),
then push a test change and watch it apply.
4. **Optional: record who made each change**, as in the path above.

### Supporting guides

Use these where your setup needs them:

- [Encrypt Secrets with SOPS and age](sops-age-guide.md)
- [Sign commits](commit-signing.md)
- [Narrow the controller's permissions](rbac.md)
- [Mirror kcp workspaces](kcp-workspaces.md), including commit authors from kcp's shared audit stream
- [Helm chart values](../charts/gitops-reverser/README.md)

## 2. Make changes

- **Make a change through Kubernetes:** create, update, or delete a selected resource and follow it
into Git. The [quick start's test step](quickstart.md#4-test-it) is the smallest example.
- **Group changes and explain why:** [the commit window demo](demo/commit-window.md) collects two
edits and saves them as one commit with a `CommitRequest`. [Commit messages](commit-messages.md)
covers the templates.
- **Choose what to mirror:** [installing apps as KRM](installing-apps-as-krm.md) shows that a Flux
`HelmRelease`, an Argo CD `Application`, or a KRO instance mirrors and edits like any other
resource.
- **Work alongside other people on the same branch:** [API-first publication](api-first-publication.md)
explains how edits from several authors and targets become commits, and what happens when another
writer moves the branch.
- **Make a change through Git:** with an applier configured, a push reaches the cluster as described
in [the life of an apply](bi-directional.md#the-life-of-an-apply).

## 3. Operate

- **Monitor health and resource usage:** [interpreting metrics](interpreting-metrics.md), including
[suggested alerts](interpreting-metrics.md#suggested-alerts).
- **Investigate a missing or unexpected change:** start from the resource's conditions
(`kubectl describe`), then the [metrics for the watch-to-push pipeline](interpreting-metrics.md#pipeline-watch-to-push)
and the [operational boundaries](architecture.md#operational-boundaries).
- **Upgrade an installation:** [UPGRADING.md](UPGRADING.md) lists breaking changes and migration
steps, newest first.

## 4. Understand and reference

- [Architecture](architecture.md): how a Kubernetes edit reaches Git, how a Git edit reaches the
cluster, and the boundaries around safety and recovery.
- [Configuration](configuration.md): every object, field, default, and controller setting.
- [Security model](security-model.md): credentials, permissions, trust boundaries, and the Git
credentials Secret shape.
- [RBAC](rbac.md): the two ClusterRoles, the optional applier grants, and how to stop the controller
listing Secrets.
- [Definitions](definitions.md): the vocabulary these pages use.
- [Helm chart](../charts/gitops-reverser/README.md): installation options and values.

## Contributing

- [CONTRIBUTING.md](../CONTRIBUTING.md): contributor workflow and validation commands.
- [Style guide](style-guide.md): how these docs are written, including the no-em-dash rule and the
American-English decision.
- [e2e debugging](../test/e2e/E2E_DEBUGGING.md): e2e troubleshooting, reuse, and `.stamps`.

## Maintainer notes

Expand Down
4 changes: 2 additions & 2 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ selectable transport, Redis Streams by default and an in-process ring with
Redis as the shared store across replicas.

**Audit is an optional attribution lookup.** When attribution is enabled, kube-apiserver posts audit
events to `/audit-webhook/<audit-route>` (or a configured annotation-routed shared endpoint). The route
events to `/audit-webhook/<audit-route>` (or the bare endpoint, routed by an event annotation). The route
is `KubeProvider.spec.attribution.auditRoute`, which defaults to `<namespace>.<name>`.
The operator appends a minimal fact to that route's per-type fact stream; every process watching the
type follows that stream into a bounded, TTL'd in-process index, and a watch event joins against the
Expand Down Expand Up @@ -2004,7 +2004,7 @@ Current limitations:
over it is not mirrored, and the next apply restores it; until then the cluster runs the older
value. See [the apply window](design/apply-trigger.md#the-apply-window).
- **Audit ingress uses a shared-CA trust boundary.** Named `/audit-webhook/<audit-route>` routes and the
annotation-routed shared endpoint both require a client certificate signed by the audit CA, but that
annotation-routed bare endpoint both require a client certificate signed by the audit CA, but that
certificate is not bound to one audit route. This is an accepted privileged-control-plane assumption, not
tenant isolation; see [SECURITY.md](../SECURITY.md#shared-audit-ingress-trust-model).
- **`deletecollection`** is reconciled by the watch (each item arrives as its own `DELETED`, or the
Expand Down
3 changes: 3 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3565,6 +3565,9 @@ Use an annotation that the producing control plane sets consistently as source m
routing metadata only: it keeps the audit fact and the watch event in the same source-cluster
partition, so a user from one logical cluster can never be credited for a matching object in another.

For kcp, where the annotation is `kcp.io/cluster` and its value is a workspace's logical cluster
name, see [mirror kcp workspaces](kcp-workspaces.md).

Valkey/Redis is **optional**: when `--redis-addr` is set, watch resume cursors are stored so restarts
pick up where they left off; when left empty, watches cold-replay from scratch on restart instead. The
Helm chart defaults to **configured-author** (`attribution.enabled: false`): the audit webhook is
Expand Down
27 changes: 27 additions & 0 deletions docs/definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,19 @@ clusters, and in prose "the receiver" is fine. A delivery to it is a hint to loo
about the branch: it wakes the branch worker of each provider for the repository and branch it
names, and the worker reads the remote itself.

**Push webhook.** The Git host's webhook for pushes, configured in the repository's or the
organization's settings and pointed at a receiver's `status.webhookPath`. Say "push webhook" for the
host-side configuration and the capability as a whole. Not "push notification" or "push hook".

**Push event.** The Git host's own name for what a push webhook reports: one push, naming a
repository, a branch, and the commit it moved to. GitHub, GitLab and Gitea all call it that.

**Delivery.** One request a push webhook sends to a receiver, carrying one push event. It is
verified before its body is parsed, and a verified delivery is only a hint (see **Receiver**).
`gitopsreverser_receiver_deliveries_total` counts deliveries by `outcome`, and
`GitBranch.status.lastPushNoticeAt` records when one last reached the branch. The **audit webhook**
sends requests too; call those audit requests, so "delivery" stays with the push webhook.

## Attribution

The word alone is ambiguous, so it is never used alone. There are two:
Expand All @@ -355,6 +368,18 @@ is the `<route>` segment in `/audit-webhook/<route>`, and defaults to the `KubeP
a provider there carries it, otherwise the namespace of the oldest provider carrying it. A provider
elsewhere that carries it is not used (`AuditRouteConflict`), so no namespace reads another's facts.

**Audit webhook.** The kube-apiserver's audit webhook backend, configured to post audit events to the
operator's audit listener. It authenticates with a client certificate, where a push webhook proves
itself with a shared token, which is why the two never share a listener. A bare "webhook" is ambiguous wherever both
could be meant: say which.

**Named endpoint, bare endpoint.** The two paths the audit listener serves. A **named endpoint**,
`/audit-webhook/<route>`, files every event it receives under that route. The **bare endpoint**,
`/audit-webhook` with no route, serves a **shared audit stream**: one producer's events for many
source clusters, such as a kcp shard's. It reads each event's route from the event annotation
`--author-attribution-audit-route-annotation-key` names, drops an event without one, and is off until
that flag is set. The stream is shared; the endpoint is bare. Not "shared endpoint".

**Grace window.** The bounded wait for a matching fact before a watch event ships credited to the
committer instead.

Expand Down Expand Up @@ -546,3 +571,5 @@ outage.
| trigger, apply trigger (for an applier claim) | applier claim | the resource does not declare when to apply, and "trigger" already names watch-plan, API-surface and Argo Events triggers |
| quiet branch | flush | no apply waits for a branch with nothing pending; it goes after a flush |
| consumer (for what applies a `GitRepository`) | what applies it, `alsoAppliedBy` | consumer names the object a grant admits |
| push notification, push hook | push webhook, delivery | the host configures a push webhook, and it sends deliveries |
| shared endpoint (for `/audit-webhook`) | bare endpoint | the stream is what is shared; the endpoint is the path with no route |
Loading