Skip to content

Commit b1c6687

Browse files
authored
Merge pull request #158 from mallardduck/branching-docs
Update docs for branching
2 parents 2f25bd1 + 3686267 commit b1c6687

File tree

4 files changed

+77
-64
lines changed

4 files changed

+77
-64
lines changed

README.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ This repo contains a set of three interlinked projects:
55

66
- The **Prometheus Federator** is a k8s Operator that manages deploying Project Monitoring Stacks.
77
- The **Helm Project Operator** is a generic design for a Kubernetes Operator that acts on `ProjectHelmChart` CRs.
8+
- This project depends heavily on and expands functionality of `helm-controller`.
89
- **Helm Locker** is a Kubernetes operator that prevents resource drift on (i.e. "locks") Kubernetes objects that are tracked by Helm 3 releases.
910

1011
> [!NOTE]
1112
> The last two project (helm-project-operator and helm-locker) are not intended or supported for standalone use.
1213
13-
For more info on _Helm Project Operator_, see the [dedicated README file](README-helm-project-operator.md).
14-
For more info on _Helm Locker_, see the [dedicated README file](README-helm-locker.md).
14+
For more info on _Helm Project Operator_, see the [dedicated README file](cmd/helm-project-operator/README.md).
15+
For more info on _Helm Locker_, see the [dedicated README file](cmd/helm-locker/README.md).
1516

1617
## Getting Started
1718

@@ -20,18 +21,20 @@ For more information, see the [Getting Started guide](docs/prometheus-federator/
2021
### Branches and Releases
2122
This is the current branch strategy for `rancher/prometheus-federator`, it may change in the future.
2223

23-
| Branch | Tag | Rancher |
24-
|----------------|----------|------------------------|
25-
| `main` | `head` | `main` branch (`head`) |
26-
| `release/v0.0` | `v0.x.x` | `v2.9.x`, `v2.8.x` |
24+
| Branch | Tag | Rancher |
25+
|----------------|------------------|------------------------|
26+
| `main` (v3.x) | `head`, `v3.x.x` | `main` branch (`head`) |
27+
| `release/v1.x` | `v1.x.x` | `v2.10.x`, `v2.9.x` |
28+
| `release/v0.x` | `v0.x.x` | Legacy Branch |
2729

2830
> [!NOTE]
29-
> We are starting our new Branch strategy officially in 2.10, the prior Rancher versions will receive updates to their new versions once cleared for backporting.
31+
> We are still adopting our new Branch strategy. Soon all Rancher Minors will have a branch targeting them.
32+
> When a Branch for v2.x is created 2.10 will be updated to use that rather than v1.x.
3033
3134

3235
## More Info
3336

34-
Prometheus Federator is an operator (powered by [`rancher/helm-project-operator`](README-helm-project-operator.md) and [`rancher/charts-build-scripts`](README-helm-locker.md)) that manages deploying one or more Project Monitoring Stacks composed of the following set of resources that are scoped to project namespaces:
37+
Prometheus Federator is an operator (powered by [`rancher/helm-project-operator`](cmd/helm-project-operator/README.md) and [`rancher/charts-build-scripts`](cmd/helm-locker/README.md)) that manages deploying one or more Project Monitoring Stacks composed of the following set of resources that are scoped to project namespaces:
3538
- [Prometheus](https://prometheus.io/) (managed externally by [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator))
3639
- [Alertmanager](https://prometheus.io/docs/alerting/latest/alertmanager/) (managed externally by [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator))
3740
- [Grafana](https://github.com/helm/charts/tree/master/stable/grafana) (deployed via an embedded Helm chart)
@@ -47,12 +50,22 @@ For more information on ProjectHelmCharts and how to configure the underlying op
4750
For more information on how to configure the underlying Project Monitoring Stack, please read the [`README.md` of the underlying chart](packages/rancher-project-monitoring/charts/README.md) (`rancher-project-monitoring`).
4851

4952
## Developing
53+
For more information, see the [Developing guide](docs/prometheus-federator/developing.md).
5054

5155
### Which branch do I make changes on?
5256

53-
Prometheus Federator is built and released off the contents of the `main` branch. To make a contribution, open up a PR to the `main` branch.
57+
This depends on the component of Prometheus Federator you're seeing to modify.
58+
Here's a good guide:
5459

55-
For more information, see the [Developing guide](docs/prometheus-federator/developing.md).
60+
- Prometheus Federator directly: Target the `main` branch by default, unless change is specific to a Rancher Minor.
61+
- Rancher Project Monitoring:
62+
1. Use the [rancher/ob-team-charts](https://github.com/rancher/ob-team-charts) repo `main` branch,
63+
2. After chart updated in `ob-team-charts`, update `build.yaml` version on your target branch (likely main, then backport)
64+
65+
### How do I know what version of Rancher Project Monitoring is used?
66+
There are a few options depending on where you're working.
67+
For compiled binaries, you can use the `debug-chart` command to dump the static chart.
68+
Or, you can check `build.yaml` on the target branch/tag you're curious about.
5669

5770
## Building
5871

README-helm-locker.md renamed to cmd/helm-locker/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ Once created, the Helm Locker controllers will watch all resources tracked by th
1111

1212
## Getting Started
1313

14-
For more information, see the [Getting Started guide](docs/gettingstarted.md).
14+
For more information, see the [Getting Started guide](../../docs/helm-locker/gettingstarted.md).
15+
16+
> [!WARN]
17+
> These directions are intended for development workflows/debugging.
18+
> They are not meant for standalone usage and come with no support.
1519
1620
## Who needs Helm Locker?
1721

README-helm-project-operator.md renamed to cmd/helm-project-operator/README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,34 @@ This repo contains a set of two interlinked projects:
88

99
**Note: These project are not intended for standalone use.**
1010

11-
For more info on _Helm Locker_, see the [dedicated README file](README-helm-locker.md).
11+
For more info on _Helm Locker_, see the [dedicated README file](../helm-locker/README.md).
1212

1313
Helm Project Operator is intended to be implemented by a Project Operator (e.g. [`rancher/prometheus-federator`](https://github.com/rancher/prometheus-federator)) but provides a common definition for all Project Operators to use in order to support deploy specific, pre-bundled Helm charts (tied to a unique registered `spec.helmApiVersion` associated with the operator) across all project namespaces detected by this operator.
1414

1515
## Getting Started
1616

17-
For more information, see the [Getting Started guide](docs/helm-project-operator/gettingstarted.md).
17+
For more information, see the [Getting Started guide](../../docs/helm-project-operator/gettingstarted.md).
18+
19+
> [!WARN]
20+
> These directions are intended for development workflows/debugging.
21+
> They are not meant for standalone usage and come with no support.
22+
1823

1924
## Developing
2025

2126
### Which branch do I make changes on?
2227

2328
Helm Project Operator is built and released off the contents of the `main` branch. To make a contribution, open up a PR to the `main` branch.
2429

25-
For more information, see the [Developing guide](docs/helm-project-operator/developing.md).
30+
For more information, see the [Developing guide](../../docs/helm-project-operator/developing.md).
2631

2732
## Design
2833

29-
Helm Project Operator is built on top of [k3s-io/helm-controller](https://github.com/k3s-io/helm-controller) and [rancher/helm-locker](https://github.com/rancher/helm-locker). For more information on the design of the underlying components, please see the `README.md` on their respective repositories.
34+
Helm Project Operator is built on top of [k3s-io/helm-controller](https://github.com/k3s-io/helm-controller) and [rancher/helm-locker](https://github.com/rancher/prometheus-federator/tree/main/internal/helm-locker). For more information on the design of the underlying components, please see the `README.md` on their respective repositories.
3035

3136
For an example of how Helm Project Operator can be implemented, please see [`rancher/prometheus-federator`](https://github.com/rancher/prometheus-federator).
3237

33-
For more information in general, please see [docs/design.md](docs/helm-project-operator/design.md).
38+
For more information in general, please see [docs/design.md](../../docs/helm-project-operator/design.md).
3439

3540
## Building
3641

docs/prometheus-federator/developing.md

Lines changed: 39 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,59 @@
11
# Developing Prometheus Federator
22

3-
The Prometheus Federator repository is primarily comprised of just two things:
4-
- A simple `main.go` that implements [Helm Project Operator](https://github.com/rancher/helm-project-operator) for the [`rancher-project-monitoring` chart](charts/rancher-project-monitoring)
5-
- A `packages/` directory that corresponds to a [`rancher/charts-build-scripts`](https://github.com/rancher/charts-build-scripts) repository
3+
The Prometheus Federator project is primarily composed of two components:
4+
- The golang code that implements a [Helm Project Operator](../../cmd/helm-project-operator/README.md), and
5+
- The charts used for `rancher-project-monitoring` which are ultimately based on `rancher-monitoring`
6+
- This component heavily relies on [`rancher/charts-build-scripts`](https://github.com/rancher/charts-build-scripts) and mimics a smaller `rancher/charts` for O&B team.
67

7-
In **most** circumstances, you will only ever have to make changes to the `packages/` directory; if you need to make changes to the underlying code of the operator that is deployed, it is likely that you intend to make this change in [rancher/helm-project-operator](https://github.com/rancher/helm-project-operator) instead.
8+
The golang half can be found here in this repo and the Charts half in our [rancher/ob-team-charts](https://github.com/rancher/ob-team-charts) repo.
89

9-
## Repository Structure
10-
11-
```bash
12-
## This directory is a [`rancher/charts-build-scripts`](https://github.com/rancher/charts-build-scripts) packages directory. See below for more details.
13-
packages/
10+
In **most** circumstances, you will primarily make changes to the charts half and work in [rancher/ob-team-charts](https://github.com/rancher/ob-team-charts) repo first.
11+
Then, after that bump versions here in `build.yaml` and create your RC/alpha release after that. Finally, you can land that change in `rancher/charts`.
1412

15-
## This directory contains **auto-generated** Helm chart archives that can be used to deploy Prometheus Federator in a Kubernetes cluster in
16-
## the cattle-monitoring-system namespace, which deploys rancher-project-monitoring (located under charts/rancher-project-monitoring)
17-
## on seeing a ProjectHelmChart with spec.helmApiVersion: monitoring.cattle.io/v1alpha1.
18-
##
19-
## IMPORTANT: You should never modify the contents of this directory directly; you should always modify `packages` since that will
20-
## overwrite the changes that are observed in this directory on running a `make charts`.
21-
##
22-
assets/
13+
When you want to make changes to Prometheus Federator directly you do not need to interact with [rancher/ob-team-charts](https://github.com/rancher/ob-team-charts) repo.
2314

24-
## This file is an **auto-generated** Helm index.yaml identifying this repository as a valid Helm repository that contains Helm charts.
25-
##
26-
## IMPORTANT: You should never modify the contents of this file directly; you should always modify `packages` since that will
27-
## overwrite the changes that are observed in this directory on running a `make charts` or `make index`.
28-
##
29-
index.yaml
15+
## Repository Structure
3016

31-
## This directory contains **auto-generated** Helm charts that can be used to deploy Prometheus Federator in a Kubernetes cluster in
32-
## the cattle-monitoring-system namespace, which deploys rancher-project-monitoring (located under charts/rancher-project-monitoring)
33-
## on seeing a ProjectHelmChart with spec.helmApiVersion: monitoring.cattle.io/v1alpha1.
17+
```bash
18+
## This directory contains the source chart for the Prometheus Federator chart.
3419
##
35-
## IMPORTANT: You should never modify the contents of this directory directly; you should always modify `packages` since that will
36-
## overwrite the changes that are observed in this directory on running a `make charts`.
37-
charts/
38-
39-
## The main chart that deploys Prometheus Federator in the cluster.
40-
prometheus-federator/*
41-
42-
## A chart based on https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack that deploys a Project
43-
## Monitoring Stack onto the cluster on seeing a valid ProjectHelmChart (which means that it is contained within a Project Registration Namespace
44-
## with spec.helmApiVersion set to monitoring.cattle.io/v1alpha1)
45-
##
46-
## This chart is not expected to ever be deployed standalone; it is embedded into the Prometheus Federator binary itself.
47-
rancher-project-monitoring/*
48-
49-
## This directory will contain additional docs to assist users in getting started with using Helm Project Operator.
20+
## At build time it is used as a template to generate a 1:1 release chart to the image tag.
21+
## If you modify the Prometheus Federator chart you should consider if it needs to be back ported from `main` to other release branches.
22+
charts/prometheus-federator
23+
24+
## This directory contains all CLI entry points of the Prometheus Federator (and internal projects)
25+
cmd/
26+
## The directory contains the helm-locker cli entrypoint used by devs.
27+
helm-locker
28+
## The directory contains the helm-project-operator cli entrypoint used by devs.
29+
helm-project-operator
30+
## The directory contains the prometheus-federator cli entrypoint
31+
prometheus-federator
32+
33+
## This directory will contain additional docs to assist users in getting started with using Prometheus Federator.
5034
docs/
5135

5236
## This directory contains an example ProjectHelmChart that can be deployed to create an example Project Monitoring Stack
5337
## Note: the namespace needs to be modified to be a valid Project Registration Namespace, depending on how you deployed the operator.
5438
examples/
5539

56-
## This directory contains the image that is used to build rancher/helm-project-operator, which is hosted on hub.docker.com.
40+
## This directory contains all the internal code used by Prometheus Federator
41+
internal/
42+
## The directory contains the helm-locker internal project code.
43+
helm-locker
44+
## The directory contains the helm-project-operator internal project code.
45+
helm-project-operator
46+
47+
## This directory contains Dockerfile* to produce images for Prod and Dev
5748
package/
58-
Dockerfile
49+
Dockerfile-helm-locker
50+
Dockerfile-helm-project-operator
51+
Dockerfile-prometheus-federator
52+
```
5953

60-
## The main entrypoint into Prometheus Federator that implements Helm Project Operator.
61-
main.go
54+
---
6255

63-
## The Dockerfile used to run CI and other scripts executed by make in a Docker container (powered by https://github.com/rancher/dapper)
64-
Dockerfile.dapper
65-
```
56+
> TODO: Migrate the following content to [rancher/ob-team-charts](https://github.com/rancher/ob-team-charts) repo.
6657
6758
## Making changes to the Helm Charts (`packages/`)
6859

0 commit comments

Comments
 (0)