Skip to content

Commit f34ae3a

Browse files
committed
Add Helm chart README generation using bitnami readme-generator-for-helm
Annotate values.yaml with @param and @section tags recognized by the bitnami readme-generator-for-helm tool, create a chart README.md with auto-generated parameter tables, and add a `make helm/docs` target that clones and runs the generator. Add SResources to the spellcheck expect list.
1 parent 3b0a735 commit f34ae3a

4 files changed

Lines changed: 144 additions & 5 deletions

File tree

.github/actions/spelling/expect.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ psat
1616
rolearn
1717
selfsigned
1818
servicemonitors
19+
SResources
1920
spiffe
2021
SVIDs
2122
tekton

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,23 @@ helm/lint: ## Lint the Helm chart using chart-testing (ct).
377377
helm/template: ## Render Helm chart templates for debugging.
378378
helm template test charts/mondoo-operator
379379

380+
README_GENERATOR_DIR = $(LOCALBIN)/readme-generator-for-helm
381+
README_GENERATOR = $(README_GENERATOR_DIR)/bin/index.js
382+
383+
.PHONY: helm/docs
384+
helm/docs: $(README_GENERATOR) ## Generate Helm chart README from values.yaml annotations.
385+
node $(README_GENERATOR) \
386+
--values charts/mondoo-operator/values.yaml \
387+
--readme charts/mondoo-operator/README.md
388+
389+
$(README_GENERATOR): $(LOCALBIN)
390+
@if [ ! -f $(README_GENERATOR) ]; then \
391+
echo "Installing readme-generator-for-helm..."; \
392+
rm -rf $(README_GENERATOR_DIR); \
393+
git clone --depth 1 https://github.com/bitnami/readme-generator-for-helm.git $(README_GENERATOR_DIR); \
394+
cd $(README_GENERATOR_DIR) && npm install --production; \
395+
fi
396+
380397
# Install prettier gloablly via
381398
# yarn global add prettier --prefix /usr/local
382399
.PHONY: fmt/docs

charts/mondoo-operator/README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Mondoo Operator Helm Chart
2+
3+
The Mondoo Operator provides a Kubernetes-native way to deploy and manage [Mondoo](https://mondoo.com) security scanning in your clusters.
4+
5+
## Prerequisites
6+
7+
- Kubernetes 1.26+
8+
- Helm 3.x
9+
10+
## Installation
11+
12+
### Add the Helm repository
13+
14+
```bash
15+
helm repo add mondoo https://mondoohq.github.io/mondoo-operator
16+
helm repo update
17+
```
18+
19+
### Install the chart
20+
21+
```bash
22+
helm install mondoo-operator mondoo/mondoo-operator --namespace mondoo-operator --create-namespace
23+
```
24+
25+
### Uninstall the chart
26+
27+
```bash
28+
helm uninstall mondoo-operator --namespace mondoo-operator
29+
```
30+
31+
## Parameters
32+
33+
### Controller Manager Configuration
34+
35+
| Name | Description | Value |
36+
| ---------------------------------------------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
37+
| `controllerManager.manager.args` | Command-line arguments passed to the operator manager container | `["operator","--health-probe-bind-address=:8081","--metrics-bind-address=:8080","--leader-elect"]` |
38+
| `controllerManager.manager.containerSecurityContext` | Security context for the manager container | `{}` |
39+
| `controllerManager.manager.image.repository` | Container image repository for the operator | `ghcr.io/mondoohq/mondoo-operator` |
40+
| `controllerManager.manager.image.tag` | Container image tag for the operator | `v12.0.1` |
41+
| `controllerManager.manager.imagePullPolicy` | Image pull policy for the operator container | `IfNotPresent` |
42+
| `controllerManager.manager.resources` | Resource requests and limits for the manager container | `{}` |
43+
| `controllerManager.podSecurityContext` | Pod-level security context for the controller manager | `{}` |
44+
| `controllerManager.replicas` | Number of controller manager replicas | `1` |
45+
| `controllerManager.serviceAccount.annotations` | Annotations to add to the controller manager service account | `{}` |
46+
47+
### Kubernetes Resources Scanning Configuration
48+
49+
| Name | Description | Value |
50+
| ------------------------------------------------- | ----------------------------------------------------------------------- | ----- |
51+
| `k8SResourcesScanning.serviceAccount.annotations` | Annotations to add to the Kubernetes resources scanning service account | `{}` |
52+
53+
### General Configuration
54+
55+
| Name | Description | Value |
56+
| ------------------------- | -------------------------------------- | --------------- |
57+
| `kubernetesClusterDomain` | Kubernetes cluster domain used for DNS | `cluster.local` |
58+
59+
### Manager Config
60+
61+
| Name | Description | Value |
62+
| ------------------------------------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
63+
| `managerConfig.controllerManagerConfigYaml` | Embedded YAML configuration for the controller manager | `# Copyright (c) Mondoo, Inc.
64+
# SPDX-License-Identifier: BUSL-1.1
65+
apiVersion: controller-runtime.sigs.k8s.io/v1alpha1
66+
kind: ControllerManagerConfig
67+
health:
68+
healthProbeBindAddress: :8081
69+
metrics:
70+
bindAddress: 127.0.0.1:8080
71+
leaderElection:
72+
leaderElect: true
73+
resourceName: 60679458.mondoo.com` |
74+
75+
### Metrics Service Configuration
76+
77+
| Name | Description | Value |
78+
| ---------------------- | ----------------------------------------------- | ----------- |
79+
| `metricsService.ports` | Ports configuration for the metrics service | `[]` |
80+
| `metricsService.type` | Kubernetes service type for the metrics service | `ClusterIP` |
81+
82+
### Pre-delete Cleanup Hook Configuration
83+
84+
| Name | Description | Value |
85+
| ----------------- | ----------------------------------------------------------------- | ------ |
86+
| `cleanup.enabled` | Enable or disable the pre-delete cleanup hook | `true` |
87+
| `cleanup.timeout` | Timeout for waiting for MondooAuditConfig resources to be deleted | `2m` |
88+

charts/mondoo-operator/values.yaml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
## @section Controller Manager Configuration
2+
## Configuration for the mondoo-operator controller manager deployment
3+
14
controllerManager:
25
manager:
6+
## @param controllerManager.manager.args Command-line arguments passed to the operator manager container
37
args:
48
- operator
59
- --health-probe-bind-address=:8081
610
- --metrics-bind-address=:8080
711
- --leader-elect
12+
## @param controllerManager.manager.containerSecurityContext [object] Security context for the manager container
813
containerSecurityContext:
914
allowPrivilegeEscalation: false
1015
capabilities:
@@ -13,26 +18,46 @@ controllerManager:
1318
privileged: false
1419
readOnlyRootFilesystem: true
1520
image:
21+
## @param controllerManager.manager.image.repository Container image repository for the operator
1622
repository: ghcr.io/mondoohq/mondoo-operator
23+
## @param controllerManager.manager.image.tag Container image tag for the operator
1724
tag: v12.0.1
25+
## @param controllerManager.manager.imagePullPolicy Image pull policy for the operator container
1826
imagePullPolicy: IfNotPresent
27+
## @param controllerManager.manager.resources [object] Resource requests and limits for the manager container
1928
resources:
2029
limits:
2130
cpu: 200m
2231
memory: 140Mi
2332
requests:
2433
cpu: 100m
2534
memory: 70Mi
35+
## @param controllerManager.podSecurityContext [object] Pod-level security context for the controller manager
2636
podSecurityContext:
2737
runAsNonRoot: true
38+
## @param controllerManager.replicas Number of controller manager replicas
2839
replicas: 1
2940
serviceAccount:
41+
## @param controllerManager.serviceAccount.annotations [object] Annotations to add to the controller manager service account
3042
annotations: {}
43+
44+
## @section Kubernetes Resources Scanning Configuration
45+
3146
k8SResourcesScanning:
3247
serviceAccount:
48+
## @param k8SResourcesScanning.serviceAccount.annotations [object] Annotations to add to the Kubernetes resources scanning service account
3349
annotations: {}
50+
51+
## @section General Configuration
52+
53+
## @param kubernetesClusterDomain Kubernetes cluster domain used for DNS
3454
kubernetesClusterDomain: cluster.local
55+
56+
## @section Manager Config
57+
## Configuration for the controller manager runtime settings
58+
3559
managerConfig:
60+
## @param managerConfig.controllerManagerConfigYaml Embedded YAML configuration for the controller manager
3661
controllerManagerConfigYaml: |-
3762
# Copyright (c) Mondoo, Inc.
3863
# SPDX-License-Identifier: BUSL-1.1
@@ -45,18 +70,26 @@ managerConfig:
4570
leaderElection:
4671
leaderElect: true
4772
resourceName: 60679458.mondoo.com
73+
74+
## @section Metrics Service Configuration
75+
4876
metricsService:
77+
## @param metricsService.ports [array] Ports configuration for the metrics service
4978
ports:
5079
- name: metrics
5180
port: 8080
5281
protocol: TCP
5382
targetPort: metrics
83+
## @param metricsService.type Kubernetes service type for the metrics service
5484
type: ClusterIP
55-
# Pre-delete cleanup hook configuration
56-
# This hook runs before uninstall to delete MondooAuditConfig resources,
57-
# allowing finalizers to clean up operator-created resources properly.
58-
# The cleanup job uses the same image as the operator.
85+
86+
## @section Pre-delete Cleanup Hook Configuration
87+
## This hook runs before uninstall to delete MondooAuditConfig resources,
88+
## allowing finalizers to clean up operator-created resources properly.
89+
## The cleanup job uses the same image as the operator.
90+
5991
cleanup:
92+
## @param cleanup.enabled Enable or disable the pre-delete cleanup hook
6093
enabled: true
61-
# Timeout for waiting for MondooAuditConfig resources to be deleted
94+
## @param cleanup.timeout Timeout for waiting for MondooAuditConfig resources to be deleted
6295
timeout: 2m

0 commit comments

Comments
 (0)