-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from ebuildy/feat_yaml_functions
feat: add toYaml and fromYaml example
- Loading branch information
Showing
5 changed files
with
111 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apiVersion: v1 | ||
name: no-values | ||
description: A very simple chart that doesn't even need any values for customization | ||
version: "0.2.0" | ||
home: "https://github.com/norwoodj/helm-docs/tree/master/example-charts/no-values" | ||
sources: ["https://github.com/norwoodj/helm-docs/tree/master/example-charts/no-values"] | ||
engine: gotpl | ||
maintainers: | ||
- email: norwood.john.m@gmail.com | ||
name: John Norwood |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# no-values | ||
|
||
A very simple chart that doesn't even need any values for customization | ||
|
||
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) | ||
|
||
## Additional Information | ||
|
||
### Snapshot classes | ||
|
||
| name | resource group | incremental | | ||
|----------|----------------|-------------| | ||
| azure-incr | true | | | ||
| azure | false | | | ||
| local-incr | true | | | ||
| local | false | | | ||
| mask-data-incr | true | rg-mask-data | | ||
| mask-data | false | rg-mask-data | | ||
|
||
### Default resources | ||
|
||
```yaml | ||
requests: | ||
cpu: 10m | ||
memory: 100m | ||
``` | ||
## Installing the Chart | ||
To install the chart with the release name `my-release`: | ||
|
||
```console | ||
$ helm repo add foo-bar http://charts.foo-bar.com | ||
$ helm install my-release foo-bar/no-values | ||
``` | ||
|
||
## Values | ||
|
||
| Key | Type | Default | Description | | ||
|-----|------|---------|-------------| | ||
| resources.requests.cpu | string | `"10m"` | | | ||
| resources.requests.memory | string | `"100m"` | | | ||
| volumeSnapshotClass.azure.parameters | object | `{}` | | | ||
| volumeSnapshotClass.local.parameters | object | `{}` | | | ||
| volumeSnapshotClass.mask-data.parameters.resourceGroup | string | `"rg-mask-data"` | | | ||
|
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{{ template "chart.header" . }} | ||
{{ template "chart.description" . }} | ||
|
||
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} | ||
|
||
## Additional Information | ||
|
||
{{ $values := (.Files.Get "values.yaml") | fromYaml }} | ||
|
||
### Snapshot classes | ||
|
||
| name | resource group | incremental | | ||
|----------|----------------|-------------| | ||
{{- range $name, $spec := $values.volumeSnapshotClass }} | ||
{{- range $parameterIncr := list "true" "false" }} | ||
| {{ $name }}{{- if eq $parameterIncr "true" -}}-incr{{- end }} | {{ $parameterIncr }} | {{ $spec.parameters.resourceGroup | default "" }} | | ||
{{- end }} | ||
{{- end }} | ||
|
||
### Default resources | ||
|
||
```yaml | ||
{{ $values.resources | toYaml }} | ||
``` | ||
|
||
## Installing the Chart | ||
|
||
To install the chart with the release name `my-release`: | ||
|
||
```console | ||
$ helm repo add foo-bar http://charts.foo-bar.com | ||
$ helm install my-release foo-bar/{{ template "chart.name" . }} | ||
``` | ||
|
||
{{ template "chart.requirementsSection" . }} | ||
|
||
{{ template "chart.valuesSection" . }} | ||
|
||
{{ template "helm-docs.versionFooter" . }} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
volumeSnapshotClass: | ||
azure: | ||
parameters: {} | ||
|
||
local: | ||
parameters: {} | ||
|
||
mask-data: | ||
parameters: | ||
resourceGroup: rg-mask-data | ||
|
||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 100m |
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,6 +1,6 @@ | ||
module github.com/norwoodj/helm-docs | ||
|
||
go 1.22.0 | ||
go 1.22 | ||
|
||
require ( | ||
github.com/Masterminds/sprig/v3 v3.2.3 | ||
|