-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: clean comments and docs (#32)
* fix: labeler diff * chore(clean): rename root as charts target & remove unused comment * feat: include license on all charts, remove unused targets, remove generated README.md * chore: update readme template * feat: wording --------- Co-authored-by: David Ragot <[email protected]>
- Loading branch information
Showing
23 changed files
with
186 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,6 @@ | |
|
||
dist | ||
|
||
charts/**/LICENSE | ||
|
||
.tmp-earthly-out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,111 @@ | ||
# Helm Charts | ||
|
||
## Validating the PR | ||
## Working Per Chart | ||
|
||
```bash | ||
earthly +pre-commit | ||
``` | ||
### Building the Charts | ||
|
||
## Working Per Chart | ||
Each chart must implement the common targets interface with the following minimum required files: | ||
|
||
- `Chart.yaml` | ||
- `Earthfile` | ||
|
||
Each `Earthfile` Chart **must** implement the following targets to integrate with the CI: | ||
|
||
- `+sources`: Raw sources of the chart without the dependencies. | ||
> [!IMPORTANT] | ||
> A LICENSE file is included in every chart through the helper [SOURCE](./charts/Earthfile) | ||
- `+dependencies`: Raw sources with dependencies updated. | ||
- `+validate`: Validates the chart, including its dependencies. | ||
- `+package`: Packages the chart from validated sources. | ||
- `+readme`: (Optional): Include README when dependendies are validated. | ||
> The README file is generated with `helm-docs` and included in the chart through the helper [README_GENERATOR](./charts/Earthfile). | ||
> [!TIP] | ||
> A file named `README.md.gotmpl` can be added to the chart to customize the README generation. | ||
- `+schema`: (Optional): Generate a values schema from the `values.yaml` and include it in the chart sources. Then it will be validated with the `+validate` target. | ||
|
||
### Building the chart | ||
|
||
Each chart must implement the common targets interface with the minimum required files: | ||
- Chart.yaml | ||
- Earthfile | ||
- values.yaml <--- It can be empty with {} as content | ||
### Core Library | ||
|
||
Each chart **must** implement the following targets: | ||
- `+sources`: raw sources of the chart without the dependendies | ||
- `+dependencies`: raw sources + dependencies updated | ||
- `+validate`: validate the chart from the dependencies | ||
- `+package`: package the chart from validated sources | ||
Each chart must implement the core Helm library as a dependency to include the common helpers for: | ||
|
||
> LICENCE is included in every chart throught the helper [SOURCE](./charts/Earthfile) | ||
- Improve resource naming | ||
- [Kubernetes recommended labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/) | ||
- Values naming | ||
|
||
> README is generated with `helm-docs` and it is included in the chart throught the helper [README_GENERATOR](./charts/Earthfile) | ||
- Global values structure accross all charts, including settings | ||
- Monitoring | ||
- Traces(OTLP) | ||
- Metrics(OTLP) | ||
- Logs(JSON) | ||
- Storage | ||
- PostgreSQL (Bitnami) (Internal or External) | ||
- Nats (Nats.io) (Internal) | ||
|
||
- (Optionals): | ||
|
||
- AWS IAM | ||
- AWS Target Groups | ||
- Ingress | ||
- PodDisruptionBudget | ||
- HorizontalPodAutoscaler | ||
- ServiceAccount | ||
- RBAC | ||
- NetworkPolicy | ||
|
||
### Core Dependencies | ||
## Validate repository changes | ||
|
||
Each chart must implement the core helm library as a dependency to include the common helper: | ||
To validate the all the changes arround the repository, run the following command: | ||
|
||
- resources naming | ||
- values naming | ||
- values structure | ||
- kubernetes recommended labels | ||
- (optional): aws, tgb, ingress, pdp, hpa | ||
```bash | ||
earthly +pre-commit | ||
``` | ||
|
||
1. First run | ||
once running it for the first time, it will build all the dependencies and validate all the charts and the charts. | ||
|
||
2. Second run | ||
It will validate the future changes only where it needs to be validated thanks to caches. | ||
|
||
## CI: Github Actions | ||
## Tests core and charts | ||
|
||
The CI is based on github actions and it is triggered on each PR and push to the main branch. | ||
- Naming conventions for included resource | ||
- Labels selection | ||
- Default environment variables bindings | ||
- Resources disablings | ||
- HorizontalPodAutoscaler | ||
- Ingress | ||
- PodDisruptionBudget | ||
- Subchart disabling | ||
- Secret mapping | ||
- Configmap mapping | ||
- Managed Stacks Features: Disable GRPC communication with any type of Agent | ||
|
||
The CI is composed by the following workflows: | ||
## CI: GitHub Actions | ||
|
||
- Labeler: | ||
- It checks for changes in the `charts/` folder and labels the PR with the chart name | ||
- Main: | ||
- Validate the PR name | ||
- Check if readme has been regenerated | ||
- Validate & Package each chart labeled in the PR | ||
- Release: | ||
- Use chart-releaser to release the charts where the PR has been merged on main. It will create a new tag with the version of the chart and release it to the helm repo. | ||
The CI is based on GitHub Actions, triggered on each PR and the main branch. It is composed of the following workflows: | ||
|
||
## CD | ||
- **Pull Request**: PR | ||
- Validates the PR name. | ||
- Labels the PR with the charts who have changed in the `charts/` directory. | ||
- Lint, Template, Generate Readmes for any charts who has changed. And Test Requirements accross on all charts `earthly +ci`. | ||
- **Release**: Main | ||
- Lint, Template, Generate Readmes for any charts who has changed. And Test Requirements accross on all charts `earthly +ci`. | ||
- Release any `Chart.yaml` `.version` that have been upgraded. | ||
- `chart-releaser` is based on builded Artifact. - It creates a new tag with the chart version and releases on github it to the Helm repository. | ||
|
||
External repository can relies on the `+package` target and artifact to be able to deploy from specific branch or tag. | ||
## CD: from sources | ||
|
||
External repositories can rely on the `+package` target and artifact to deploy from a specific branch or tag. | ||
|
||
```bash | ||
earthly github.com/formancehq/helm/charts/cloudprem+package | ||
``` | ||
|
||
<!-- Each chart are published to the [Artifact HUB](https://artifacthub.io/packages/search?repo=formancehq) and can be installed with helm: | ||
## CD: from Helm repository | ||
|
||
```bash | ||
helm repo add formancehq https://formancehq.github.io/helm | ||
helm install formancehq/cloudprem | ||
``` --> | ||
The helm repository is `ghcr.io/formancehq/helm` and can be used to deploy the charts. | ||
|
||
```bash | ||
helm upgrade --install regions ghcr.io/formancehq/helm/regions --version v2.0.18 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.