Skip to content

Commit 7b556d5

Browse files
authored
improve documentation for values (#301)
* values revamp --------- Co-authored-by: sabban <[email protected]>
1 parent 6f98257 commit 7b556d5

File tree

6 files changed

+596
-271
lines changed

6 files changed

+596
-271
lines changed

.github/workflows/release.yaml

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,45 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'charts/*/templates/**'
9-
- 'charts/*/README.md.gotmpl'
10-
- 'charts/*/*.yaml'
8+
- "charts/**/values.yaml"
9+
- "charts/**/README.md" # ensure section exists; regen when touched
10+
- ".github/workflows/release.yaml"
11+
# Adjust if your chart lives elsewhere
12+
env:
13+
CHART_DIR: charts/crowdsec
1114

1215
jobs:
1316
update-readme:
1417
runs-on: ubuntu-latest
1518
steps:
16-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
ref: ${{ github.ref }}
23+
persist-credentials: true
24+
25+
- name: Set up Node.js (readme-generator requires Node 22.x)
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: "22"
29+
30+
- name: Install readme-generator-for-helm
31+
run: npm i -g @bitnami/[email protected]
1732

18-
- name: Run helm-docs
33+
- name: Generate README.md & values.schema.json
1934
run: |
20-
GOBIN=$PWD go install github.com/norwoodj/helm-docs/cmd/[email protected]
21-
./helm-docs --sort-values-order file
22-
rm helm-docs
35+
for CHART_DIR in crowdsec crowdsec-traefik-bouncer helloworld; do \
36+
readme-generator \
37+
--values charts/$CHART_DIR/"values.yaml" \
38+
--readme charts/$CHART_DIR/"README.md" \
39+
--schema "/tmp/schema.json""
40+
done
2341
2442
- name: Commit bump
2543
uses: EndBug/add-and-commit@v9
2644
with:
45+
message: "chore(charts): regenerate README.md"
2746
branch: main
28-
message: 'Regenerate chart README.md'
2947

3048
release:
3149
needs: update-readme

charts/crowdsec-traefik-bouncer/README.md

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,45 @@
66

77
A http service to verify request and bounce them according to decisions made by CrowdSec.
88

9-
## Values
10-
11-
| Key | Type | Default | Description |
12-
|-----|------|---------|-------------|
13-
| bouncer.crowdsec_bouncer_api_key | string | `""` | bouncer api key (need to be generated from crowdsec agent) |
14-
| bouncer.crowdsec_agent_host | string | `""` | crowdsec lapi host (ie: crowdsec-service.crowdsec.svc.cluster.local:8080) |
15-
| bouncer.crowdsec_bouncer_gin_mode | string | `"debug"` | crowdsec_bouncer_gin_mode sets the mode of the app |
16-
| bouncer.env | list | `[]` | environment variables |
17-
| replicaCount | int | `1` | |
18-
| image.repository | string | `"fbonalair/traefik-crowdsec-bouncer"` | |
19-
| image.pullPolicy | string | `"IfNotPresent"` | |
20-
| image.tag | string | `""` | |
21-
| imagePullSecrets | list | `[]` | |
22-
| podAnnotations | object | `{}` | |
23-
| podSecurityContext | object | `{}` | |
24-
| securityContext | object | `{}` | |
25-
| service.type | string | `"ClusterIP"` | |
26-
| service.port | int | `80` | |
27-
| resources | object | `{}` | |
28-
| nodeSelector | object | `{}` | |
29-
| tolerations | list | `[]` | |
30-
| affinity | object | `{}` | |
31-
| priorityClassName | string | `""` | |
9+
## Parameters
10+
11+
### Bouncer
12+
13+
| Name | Description | Value |
14+
| ----------------------------------- | -------------------------------------------------------------------------- | ----- |
15+
| `bouncer.crowdsec_bouncer_api_key` | Bouncer API key (must be generated from CrowdSec agent) | `""` |
16+
| `bouncer.crowdsec_agent_host` | CrowdSec LAPI host (e.g. crowdsec-service.crowdsec.svc.cluster.local:8080) | `""` |
17+
| `bouncer.crowdsec_bouncer_gin_mode` | Gin mode for the bouncer app (debug, release, test) | `""` |
18+
| `bouncer.env` | Additional environment variables for the bouncer container | `[]` |
19+
| `replicaCount` | Number of replicas for the bouncer Deployment | `1` |
20+
21+
### Image
22+
23+
| Name | Description | Value |
24+
| -------------------- | ------------------------------------------------------ | ----- |
25+
| `image.repository` | Container image repository | `""` |
26+
| `image.pullPolicy` | Image pull policy (Always, IfNotPresent, Never) | `""` |
27+
| `image.tag` | Image tag (defaults to chart appVersion if empty) | `""` |
28+
| `imagePullSecrets` | Image pull secrets (list of objects with `name` field) | `[]` |
29+
| `podAnnotations` | Annotations applied to bouncer pods | `{}` |
30+
| `podSecurityContext` | Pod-level security context | `{}` |
31+
| `securityContext` | Container-level security context | `{}` |
32+
33+
### Service
34+
35+
| Name | Description | Value |
36+
| -------------- | ---------------------------- | ----- |
37+
| `service.type` | Kubernetes Service type | `""` |
38+
| `service.port` | Service port for the bouncer | `80` |
39+
40+
### Resources
41+
42+
| Name | Description | Value |
43+
| ------------------- | --------------------------------------------- | ----- |
44+
| `resources` | Resource requests and limits for bouncer pods | `{}` |
45+
| `nodeSelector` | Node selector rules for scheduling pods | `{}` |
46+
| `tolerations` | Tolerations for scheduling pods | `[]` |
47+
| `affinity` | Affinity rules for scheduling pods | `{}` |
48+
| `priorityClassName` | PriorityClass name for pods | `""` |
49+
3250

charts/crowdsec-traefik-bouncer/values.yaml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,40 @@
22
# This is a YAML-formatted file.
33
# Declare variables to be passed into your templates.
44

5-
# Required parameters to be passed to the image env variables
5+
## @section Bouncer
66
bouncer:
7-
# -- bouncer api key (need to be generated from crowdsec agent)
7+
## @param bouncer.crowdsec_bouncer_api_key [string] Bouncer API key (must be generated from CrowdSec agent)
88
crowdsec_bouncer_api_key: ""
9-
# -- crowdsec lapi host (ie: crowdsec-service.crowdsec.svc.cluster.local:8080)
9+
## @param bouncer.crowdsec_agent_host [string] CrowdSec LAPI host (e.g. crowdsec-service.crowdsec.svc.cluster.local:8080)
1010
crowdsec_agent_host: ""
11-
# -- crowdsec_bouncer_gin_mode sets the mode of the app
11+
## @param bouncer.crowdsec_bouncer_gin_mode [string] Gin mode for the bouncer app (debug, release, test)
1212
crowdsec_bouncer_gin_mode: "debug"
13-
# -- environment variables
13+
## @param bouncer.env [array] Additional environment variables for the bouncer container
1414
env: []
1515

16+
## @param replicaCount Number of replicas for the bouncer Deployment
1617
replicaCount: 1
1718

19+
## @section Image
1820
image:
21+
## @param image.repository [string] Container image repository
1922
repository: fbonalair/traefik-crowdsec-bouncer
23+
## @param image.pullPolicy [string] Image pull policy (Always, IfNotPresent, Never)
2024
pullPolicy: IfNotPresent
21-
# Overrides the image tag whose default is the chart appVersion.
25+
## @param image.tag [string] Image tag (defaults to chart appVersion if empty)
2226
tag: ""
27+
28+
## @param imagePullSecrets [array] Image pull secrets (list of objects with `name` field)
2329
imagePullSecrets: []
30+
31+
## @param podAnnotations [object] Annotations applied to bouncer pods
2432
podAnnotations: {}
2533

34+
## @param podSecurityContext [object] Pod-level security context
2635
podSecurityContext: {}
2736
# fsGroup: 2000
2837

38+
## @param securityContext [object] Container-level security context
2939
securityContext: {}
3040
# capabilities:
3141
# drop:
@@ -34,26 +44,31 @@ securityContext: {}
3444
# runAsNonRoot: true
3545
# runAsUser: 1000
3646

47+
## @section Service
3748
service:
49+
## @param service.type [string] Kubernetes Service type
3850
type: ClusterIP
51+
## @param service.port Service port for the bouncer
3952
port: 80
4053

54+
## @section Resources
55+
## @param resources [object] Resource requests and limits for bouncer pods
4156
resources: {}
42-
# We usually recommend not to specify default resources and to leave this as a conscious
43-
# choice for the user. This also increases chances charts run on environments with little
44-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
45-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
4657
# limits:
4758
# cpu: 100m
4859
# memory: 128Mi
4960
# requests:
5061
# cpu: 100m
5162
# memory: 128Mi
5263

64+
## @param nodeSelector [object] Node selector rules for scheduling pods
5365
nodeSelector: {}
5466

67+
## @param tolerations [array] Tolerations for scheduling pods
5568
tolerations: []
5669

70+
## @param affinity [object] Affinity rules for scheduling pods
5771
affinity: {}
5872

59-
priorityClassName: ""
73+
## @param priorityClassName [string] PriorityClass name for pods
74+
priorityClassName: ""

0 commit comments

Comments
 (0)