Skip to content

Commit

Permalink
docs: increasing reuse of chart doc templates (#107)
Browse files Browse the repository at this point in the history
* docs: increasing reuse of chart doc templates

* ci: remove check-charts as its now done via the chart pipeline
  • Loading branch information
nexus49 authored Dec 10, 2024
1 parent 0a2c86e commit 568e4e0
Show file tree
Hide file tree
Showing 36 changed files with 238 additions and 519 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/helm-docs.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ tasks:
deps:
- task: setup:helm-docs
cmds:
- "{{.LOCAL_BIN}}/helm-docs --chart-search-root charts/ --template-files=README.md.gotmpl --skip-version-footer=false"
- "for chart in $(echo {{.CHARTS}} | tr ',' ' '); do {{.LOCAL_BIN}}/helm-docs --log-level=debug --chart-search-root $chart --template-files=../../docs-templates/header.md.gotmpl,README.md.gotmpl,../../docs-templates/footer.md.gotmpl --skip-version-footer=false; done"
4 changes: 2 additions & 2 deletions charts/account-operator-crds/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ description: A Helm chart for Kubernetes

type: application

version: 0.1.8
version: 0.1.9

appVersion: "1.16.0"
appVersion: "0.0.0"
20 changes: 14 additions & 6 deletions charts/account-operator-crds/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

A Helm chart for Kubernetes

![Version: 0.1.8](https://img.shields.io/badge/Version-0.1.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)

## Additional Information

The `common` chart is a library of common resources that are shared across all other charts in the repository. It has no templates, but provides helm template functions and default values that can be used by other charts.

![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
## Values
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| kcp.enabled | bool | `false` | Enable KCP |

## Overriding Values

The values in the `defaults:` section can be reused from other charts by using the lookup function "common.getKeyValue". It implements lookup on three levels:

Expand All @@ -26,7 +26,15 @@ Example
3) .Values.deployment.resources.limits.memory = 1024MB
4) .Values.common.defaults.deployment.resources.limits.memory = default 512MB
```
# account-operator-crds

![Version: 0.1.8](https://img.shields.io/badge/Version-0.1.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.16.0](https://img.shields.io/badge/AppVersion-1.16.0-informational?style=flat-square)

A Helm chart for Kubernetes

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| kcp.enabled | bool | `false` | Enable KCP |

2 changes: 1 addition & 1 deletion charts/account-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: account-operator
description: A Helm chart for Kubernetes
type: application
version: 0.5.9
version: 0.5.10
appVersion: "0.112.0"
dependencies:
- name: account-operator-crds
Expand Down
52 changes: 24 additions & 28 deletions charts/account-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,15 @@

A Helm chart for Kubernetes

![Version: 0.5.8](https://img.shields.io/badge/Version-0.5.8-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.111.0](https://img.shields.io/badge/AppVersion-0.111.0-informational?style=flat-square)

## Additional Information

The `common` chart is a library of common resources that are shared across all other charts in the repository. It has no templates, but provides helm template functions and default values that can be used by other charts.
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| oci://ghcr.io/openmfp/helm-charts | account-operator-crds | 0.1.8 |
| oci://ghcr.io/openmfp/helm-charts | common | 0.1.8 |

| Repository | Name | Description | Sources |
|------------|------|-------------|---------|
| `oci://ghcr.io/openmfp/helm-charts` | `common` | The `common` chart is a library of common resources that are shared across all other charts in the repository. It has no templates, but provides helm template functions and [default values](https://github.com/openmfp/helm-charts/blob/main/charts/common/values.yaml) that can be used by other charts. |[source](https://github.com/openmfp/helm-charts/tree/main/charts/common)|
| `oci://ghcr.io/openmfp/helm-charts` | `account-operator-crds` | The `account-operator-crds` chart provides CRDS introduced by the `account-operator`. |[source](https://github.com/openmfp/helm-charts/tree/main/charts/account-operator-crds)|
## Values

The values in the `defaults:` section can be reused from other charts by using the lookup function "common.getKeyValue". It implements lookup on three levels:

1. Looks for `keyOverride` in the chart's values.yaml
2. Looks for `global.key` in the chart's or parent chart's values.yaml
3. Uses the `key` in the chart's values.yaml
4. Uses the `common.defaults.key` value from the table below.

1 has precendence over 2 over 3 over 4 respectively. This approach allows for individual charts to have minimal configuration, while still being able to override parameters locally.

Example
```
1) .Values.deployment.resources.limits.memoryOveride = 4096MB
2) .Values.global.deployment.resources.limits.memory = 2048MB
3) .Values.deployment.resources.limits.memory = 1024MB
4) .Values.common.defaults.deployment.resources.limits.memory = default 512MB
```

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| crds.enabled | bool | `true` | Enable CRDs |
Expand All @@ -58,3 +35,22 @@ Example
| subroutines.namespace.enabled | bool | `true` | Enable namespace subroutines |
| webhooks.certDir | string | `"/certs"` | The directory for webhook certificates |
| webhooks.enabled | bool | `false` | Enable webhooks |

## Overriding Values

The values in the `defaults:` section can be reused from other charts by using the lookup function "common.getKeyValue". It implements lookup on three levels:

1. Looks for `keyOverride` in the chart's values.yaml
2. Looks for `global.key` in the chart's or parent chart's values.yaml
3. Uses the `key` in the chart's values.yaml
4. Uses the `common.defaults.key` value from the table below.

1 has precendence over 2 over 3 over 4 respectively. This approach allows for individual charts to have minimal configuration, while still being able to override parameters locally.

Example
```
1) .Values.deployment.resources.limits.memoryOveride = 4096MB
2) .Values.global.deployment.resources.limits.memory = 2048MB
3) .Values.deployment.resources.limits.memory = 1024MB
4) .Values.common.defaults.deployment.resources.limits.memory = default 512MB
```
34 changes: 5 additions & 29 deletions charts/account-operator/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
{{ template "chart.header" . }}
{{ template "chart.description" . }}

{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
## Requirements

## Additional Information

The `common` chart is a library of common resources that are shared across all other charts in the repository. It has no templates, but provides helm template functions and default values that can be used by other charts.

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesHeader" . }}

The values in the `defaults:` section can be reused from other charts by using the lookup function "common.getKeyValue". It implements lookup on three levels:

1. Looks for `keyOverride` in the chart's values.yaml
2. Looks for `global.key` in the chart's or parent chart's values.yaml
3. Uses the `key` in the chart's values.yaml
4. Uses the `common.defaults.key` value from the table below.

1 has precendence over 2 over 3 over 4 respectively. This approach allows for individual charts to have minimal configuration, while still being able to override parameters locally.

Example
```
1) .Values.deployment.resources.limits.memoryOveride = 4096MB
2) .Values.global.deployment.resources.limits.memory = 2048MB
3) .Values.deployment.resources.limits.memory = 1024MB
4) .Values.common.defaults.deployment.resources.limits.memory = default 512MB
```

{{ template "chart.valuesTable" . }}
| Repository | Name | Description | Sources |
|------------|------|-------------|---------|
| `oci://ghcr.io/openmfp/helm-charts` | `common` | The `common` chart is a library of common resources that are shared across all other charts in the repository. It has no templates, but provides helm template functions and [default values](https://github.com/openmfp/helm-charts/blob/main/charts/common/values.yaml) that can be used by other charts. |[source](https://github.com/openmfp/helm-charts/tree/main/charts/common)|
| `oci://ghcr.io/openmfp/helm-charts` | `account-operator-crds` | The `account-operator-crds` chart provides CRDS introduced by the `account-operator`. |[source](https://github.com/openmfp/helm-charts/tree/main/charts/account-operator-crds)|
2 changes: 1 addition & 1 deletion charts/common/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ description: A Helm chart for Kubernetes

type: library

version: 0.1.8
version: 0.1.9
42 changes: 36 additions & 6 deletions charts/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,35 @@

A Helm chart for Kubernetes

![Version: 0.1.8](https://img.shields.io/badge/Version-0.1.8-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)

## Additional Information

The `common` chart is a library of common resources that are shared across all other charts in the repository. It has no templates, but provides helm template functions and default values that can be used by other charts.

![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)
## Values
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| defaults.certManager.enabled | bool | `false` | toggle to enable/disable cert-manager |
| defaults.deployment.maxSurge | int | `5` | maxSurge |
| defaults.deployment.maxUnavailable | int | `0` | maxUnavailable |
| defaults.deployment.resources.limits | object | `{"cpu":"100m","memory":"512Mi"}` | cpu and memory limits for the deployment |
| defaults.deployment.resources.requests | object | `{"cpu":"40m","memory":"50Mi"}` | cpu and memory requests for the deployment |
| defaults.deployment.revisionHistoryLimit | int | `3` | deployment revision history limit |
| defaults.deployment.strategy | string | `"RollingUpdate"` | deployment strategy |
| defaults.externalSecrets.enabled | bool | `true` | toggle to enable/disable external-secrets |
| defaults.fga.enabled | bool | `false` | toggle to enable/disable experimental FGA features |
| defaults.health.liveness | object | `{"failureThreshold":1,"path":"/healthz"}` | liveness probe parameters |
| defaults.health.periodSeconds | int | `10` | health period |
| defaults.health.port | int | `8081` | health port |
| defaults.health.readiness | object | `{"initialDelaySeconds":5,"path":"/readyz","periodSeconds":10}` | readiness probe parameters |
| defaults.health.startup | object | `{"failureThreshold":30,"path":"/readyz"}` | startup probe parameters |
| defaults.imagePullPolicy | string | `"Always"` | imagePullPolicy is the policy to use when pulling images for all charts |
| defaults.imagePullSecret | string | `"github"` | imagePullSecret is the name of the secret that holds the docker registry credentials |
| defaults.istio.enabled | bool | `false` | toggle to enable/disable istio |
| defaults.istio.gateway.name | string | `"gateway"` | name of the gateway |
| defaults.metrics.port | int | `8080` | metrics port |
| defaults.port | int | `8080` | service port |
| defaults.securityContext.fsGroup | int | `2000` | fsGroup id to run the container |
| defaults.securityContext.runAsGroup | int | `3000` | group id to run the container |
| defaults.securityContext.runAsUser | int | `1000` | user id to run the container |

## Overriding Values

The values in the `defaults:` section can be reused from other charts by using the lookup function "common.getKeyValue". It implements lookup on three levels:

Expand All @@ -26,6 +48,13 @@ Example
3) .Values.deployment.resources.limits.memory = 1024MB
4) .Values.common.defaults.deployment.resources.limits.memory = default 512MB
```
# common

![Version: 0.1.8](https://img.shields.io/badge/Version-0.1.8-informational?style=flat-square) ![Type: library](https://img.shields.io/badge/Type-library-informational?style=flat-square)

A Helm chart for Kubernetes

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
Expand All @@ -52,3 +81,4 @@ Example
| defaults.securityContext.fsGroup | int | `2000` | fsGroup id to run the container |
| defaults.securityContext.runAsGroup | int | `3000` | group id to run the container |
| defaults.securityContext.runAsUser | int | `1000` | user id to run the container |

31 changes: 0 additions & 31 deletions charts/common/README.md.gotmpl

This file was deleted.

2 changes: 1 addition & 1 deletion charts/example-content/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "0.126.0"
description: Helm Chart for the openmfp Portal
name: example-content
version: 0.110.15
version: 0.110.16
dependencies:
- name: common
version: 0.1.8
Expand Down
28 changes: 11 additions & 17 deletions charts/example-content/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@

Helm Chart for the openmfp Portal

![Version: 0.110.15](https://img.shields.io/badge/Version-0.110.15-informational?style=flat-square) ![AppVersion: 0.126.0](https://img.shields.io/badge/AppVersion-0.126.0-informational?style=flat-square)

## Additional Information

The `common` chart is a library of common resources that are shared across all other charts in the repository. It has no templates, but provides helm template functions and default values that can be used by other charts.

## Requirements

| Repository | Name | Version |
|------------|------|---------|
| oci://ghcr.io/openmfp/helm-charts | common | 0.1.8 |

| Repository | Name | Description | Sources |
|------------|------|-------------|---------|
| `oci://ghcr.io/openmfp/helm-charts` | `common` | The `common` chart is a library of common resources that are shared across all other charts in the repository. It has no templates, but provides helm template functions and [default values](https://github.com/openmfp/helm-charts/blob/main/charts/common/values.yaml) that can be used by other charts. |[source](https://github.com/openmfp/helm-charts/tree/main/charts/common)|
## Values
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| image.name | string | `"ghcr.io/openmfp/example-content"` | The image name |
| istio.virtualService.hosts[0] | string | `"your-host.com"` | |
| istio.virtualService.matchers[0].match[0].uri.exact | string | `"/ui/example-content"` | |
| istio.virtualService.matchers[0].match[1].uri.prefix | string | `"/ui/example-content/"` | |

## Overriding Values

The values in the `defaults:` section can be reused from other charts by using the lookup function "common.getKeyValue". It implements lookup on three levels:

Expand All @@ -32,10 +33,3 @@ Example
3) .Values.deployment.resources.limits.memory = 1024MB
4) .Values.common.defaults.deployment.resources.limits.memory = default 512MB
```

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| image.name | string | `"ghcr.io/openmfp/example-content"` | The image name |
| istio.virtualService.hosts[0] | string | `"your-host.com"` | |
| istio.virtualService.matchers[0].match[0].uri.exact | string | `"/ui/example-content"` | |
| istio.virtualService.matchers[0].match[1].uri.prefix | string | `"/ui/example-content/"` | |
33 changes: 4 additions & 29 deletions charts/example-content/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
{{ template "chart.header" . }}
{{ template "chart.description" . }}

{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
## Requirements

## Additional Information

The `common` chart is a library of common resources that are shared across all other charts in the repository. It has no templates, but provides helm template functions and default values that can be used by other charts.

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesHeader" . }}

The values in the `defaults:` section can be reused from other charts by using the lookup function "common.getKeyValue". It implements lookup on three levels:

1. Looks for `keyOverride` in the chart's values.yaml
2. Looks for `global.key` in the chart's or parent chart's values.yaml
3. Uses the `key` in the chart's values.yaml
4. Uses the `common.defaults.key` value from the table below.

1 has precendence over 2 over 3 over 4 respectively. This approach allows for individual charts to have minimal configuration, while still being able to override parameters locally.

Example
```
1) .Values.deployment.resources.limits.memoryOveride = 4096MB
2) .Values.global.deployment.resources.limits.memory = 2048MB
3) .Values.deployment.resources.limits.memory = 1024MB
4) .Values.common.defaults.deployment.resources.limits.memory = default 512MB
```

{{ template "chart.valuesTable" . }}
| Repository | Name | Description | Sources |
|------------|------|-------------|---------|
| `oci://ghcr.io/openmfp/helm-charts` | `common` | The `common` chart is a library of common resources that are shared across all other charts in the repository. It has no templates, but provides helm template functions and [default values](https://github.com/openmfp/helm-charts/blob/main/charts/common/values.yaml) that can be used by other charts. |[source](https://github.com/openmfp/helm-charts/tree/main/charts/common)|
4 changes: 2 additions & 2 deletions charts/extension-manager-operator-crds/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ name: extension-manager-operator-crds
description: A Helm chart for Kubernetes

type: application
version: 0.1.5
appVersion: "1.16.0"
version: 0.1.6
appVersion: "0.0.0"
Loading

0 comments on commit 568e4e0

Please sign in to comment.