Skip to content

Commit 791f93e

Browse files
authored
Merge pull request #210 from Madhu-1/helm-docs
Add helm documentation for the operator
2 parents 10af11d + c7b2338 commit 791f93e

File tree

6 files changed

+226
-1
lines changed

6 files changed

+226
-1
lines changed

.github/workflows/build.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
run: make build-multifile-installer
3333
- name: Generate operator helm charts
3434
run: make build-helm-installer
35+
- name: Generate operator helm document
36+
run: make generate-helm-docs
3537
- name: Check for uncommitted changes
3638
run: make check-all-committed
3739
- name: Show the uncommitted "git diff"

.helmignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Patterns to ignore when building Helm packages.
2+
# Operating system files
3+
.DS_Store
4+
5+
# Version control directories
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.hg/
10+
.hgignore
11+
.svn/
12+
13+
# Backup and temporary files
14+
*.swp
15+
*.tmp
16+
*.bak
17+
*.orig
18+
*~
19+
20+
# IDE and editor-related files
21+
.idea/
22+
.vscode/
23+
24+
# Helm chart artifacts
25+
dist/chart/*.tgz

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ mod.check:#check go module dependencies
117117
@echo 'running "go mod verify"'
118118
@go mod verify
119119
@echo 'checking for modified files.'
120-
# fail in case there are uncommitted changes
120+
# fail in case there are uncommitted changes
121121
@ git diff --quiet || (echo "files were modified: " ; git status --porcelain ; false)
122122

123123
.PHONY: test
@@ -220,6 +220,14 @@ build-csi-rbac:
220220
$(KUSTOMIZE) build build > deploy/multifile/csi-rbac.yaml
221221
rm -rf build
222222

223+
##@ Docs
224+
.PHONY: generate-helm-docs
225+
generate-helm-docs: helm-docs
226+
$(HELM_DOCS) -c deploy/charts/ceph-csi-operator \
227+
-t docs/helm-charts/operator-chart.gotmpl.md \
228+
-t docs/helm-charts/_templates.gotmpl \
229+
-o ../../../docs/helm-charts/operator-chart.md
230+
223231
##@ Deployment
224232

225233
ifndef ignore-not-found
@@ -260,13 +268,20 @@ CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen-$(CONTROLLER_TOOLS_VERSION)
260268
ENVTEST ?= $(LOCALBIN)/setup-envtest-$(ENVTEST_VERSION)
261269
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint-$(GOLANGCI_LINT_VERSION)
262270
HELMIFY ?= $(LOCALBIN)/helmify-$(HELMIFY_VERSION)
271+
HELM_DOCS ?= $(LOCALBIN)/helm-docs-$(HELM_DOCS_VERSION)
263272

264273
## Tool Versions
265274
KUSTOMIZE_VERSION ?= v5.3.0
266275
CONTROLLER_TOOLS_VERSION ?= v0.14.0
267276
ENVTEST_VERSION ?= release-0.17
268277
GOLANGCI_LINT_VERSION ?= v1.63.4
269278
HELMIFY_VERSION ?= v0.4.18
279+
HELM_DOCS_VERSION ?= v1.14.2
280+
281+
.PHONY: helm-docs
282+
helm-docs: $(HELM_DOCS) ## Download helm-docs locally if necessary.
283+
$(HELM_DOCS): $(LOCALBIN)
284+
$(call go-install-tool,$(HELM_DOCS),github.com/norwoodj/helm-docs/cmd/helm-docs,$(HELM_DOCS_VERSION))
270285

271286
.PHONY: helmify
272287
helmify: $(HELMIFY) ## Download helmify locally if necessary.

docs/helm-charts/_templates.gotmpl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{ define "chart.valuesTable" -}}
2+
| Parameter | Description | Default |
3+
|-----------|-------------|---------|
4+
{{- range .Values }}
5+
| `{{ .Key }}` | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} |
6+
{{- end }}
7+
{{- end -}}
8+
9+
{{ define "generatedDocsWarning" -}}
10+
<!---
11+
Document is generated by `make generate-helm-docs`. DO NOT EDIT.
12+
Edit the corresponding *.gotmpl.md file instead
13+
-->
14+
{{- end -}}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
title: Ceph-CSI Operator Helm Chart
3+
---
4+
{{ template "generatedDocsWarning" . }}
5+
6+
Installs [ceph-csi-operator](https://github.com/ceph/ceph-csi-operator) to automates the deployment, configuration, and management of [ceph-csi](https://github.com/ceph/ceph-csi) drivers using new Kubernetes APIs defined as a set of Custom Resource Definitions (CRDs).
7+
8+
## Introduction
9+
10+
This chart bootstraps a [ceph-csi-operator](https://github.com/ceph/ceph-csi-operator) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
11+
12+
## Prerequisites
13+
14+
* Kubernetes 1.32+
15+
* Helm 3.x
16+
17+
See the [Helm support matrix](https://helm.sh/docs/topics/version_skew/) for more details.
18+
19+
## Installing
20+
21+
The Ceph-CSI Operator helm chart will install the basic components necessary to install [ceph-csi](https://github.com/ceph/ceph-csi) on Kubernetes cluster.
22+
23+
1. Install the Helm chart
24+
25+
The `helm install` command deploys ceph-csi-operator on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
26+
27+
ceph-csi-operator currently publishes builds of the ceph-csi operator to tagged versions.
28+
29+
### **Released version**
30+
31+
32+
```console
33+
helm repo add ceph-csi-operator https://ceph.github.io/ceph-csi-operator-charts
34+
helm install --create-namespace --namespace ceph-csi-operator-system ceph-csi-operator/operator -f values.yaml
35+
```
36+
37+
For example settings, see the next section or [values.yaml](https://github.com/ceph/ceph-csi-operator/tree/main/deploy/charts/ceph-csi-operator/values.yaml)
38+
39+
## Configuration
40+
41+
The following table lists the configurable parameters of the ceph-csi-operator chart and their default values.
42+
43+
{{ template "chart.valuesTable" . }}
44+
45+
### **Development Build**
46+
47+
To deploy from a local build from your development environment:
48+
49+
1. Build the cephcsi-operator container image: `make docker-build`
50+
1. Copy the image to your K8s cluster, such as with the `docker save` then the `docker load` commands
51+
1. Install the helm chart:
52+
53+
```console
54+
cd deploy/charts/ceph-csi-operator
55+
helm install --create-namespace --namespace ceph-csi-operator-system ceph-csi-operator .
56+
```
57+
58+
## Uninstalling the Chart
59+
60+
To see the currently installed Rook chart:
61+
62+
```console
63+
helm ls --namespace ceph-csi-operator-system
64+
```
65+
66+
To uninstall/delete the `ceph-csi-operator` deployment:
67+
68+
```console
69+
helm delete --namespace ceph-csi-operator-system ceph-csi-operator
70+
```
71+
72+
The command removes all the Kubernetes components associated with the chart and deletes the release.

docs/helm-charts/operator-chart.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
---
2+
title: Ceph-CSI Operator Helm Chart
3+
---
4+
<!---
5+
Document is generated by `make generate-helm-docs`. DO NOT EDIT.
6+
Edit the corresponding *.gotmpl.md file instead
7+
-->
8+
9+
Installs [ceph-csi-operator](https://github.com/ceph/ceph-csi-operator) to automates the deployment, configuration, and management of [ceph-csi](https://github.com/ceph/ceph-csi) drivers using new Kubernetes APIs defined as a set of Custom Resource Definitions (CRDs).
10+
11+
## Introduction
12+
13+
This chart bootstraps a [ceph-csi-operator](https://github.com/ceph/ceph-csi-operator) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
14+
15+
## Prerequisites
16+
17+
* Kubernetes 1.32+
18+
* Helm 3.x
19+
20+
See the [Helm support matrix](https://helm.sh/docs/topics/version_skew/) for more details.
21+
22+
## Installing
23+
24+
The Ceph-CSI Operator helm chart will install the basic components necessary to install [ceph-csi](https://github.com/ceph/ceph-csi) on Kubernetes cluster.
25+
26+
1. Install the Helm chart
27+
28+
The `helm install` command deploys ceph-csi-operator on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
29+
30+
ceph-csi-operator currently publishes builds of the ceph-csi operator to tagged versions.
31+
32+
### **Released version**
33+
34+
```console
35+
helm repo add ceph-csi-operator https://ceph.github.io/ceph-csi-operator-charts
36+
helm install --create-namespace --namespace ceph-csi-operator-system ceph-csi-operator/operator -f values.yaml
37+
```
38+
39+
For example settings, see the next section or [values.yaml](https://github.com/ceph/ceph-csi-operator/tree/main/deploy/charts/ceph-csi-operator/values.yaml)
40+
41+
## Configuration
42+
43+
The following table lists the configurable parameters of the ceph-csi-operator chart and their default values.
44+
45+
| Parameter | Description | Default |
46+
|-----------|-------------|---------|
47+
| `cephfsCtrlpluginSa.serviceAccount.annotations` | | `{}` |
48+
| `cephfsNodepluginSa.serviceAccount.annotations` | | `{}` |
49+
| `controllerManager.manager.args[0]` | | `"--leader-elect"` |
50+
| `controllerManager.manager.containerSecurityContext.allowPrivilegeEscalation` | | `false` |
51+
| `controllerManager.manager.containerSecurityContext.capabilities.drop[0]` | | `"ALL"` |
52+
| `controllerManager.manager.containerSecurityContext.readOnlyRootFilesystem` | | `true` |
53+
| `controllerManager.manager.env.csiServiceAccountPrefix` | | `"ceph-csi-operator-"` |
54+
| `controllerManager.manager.env.watchNamespace` | | `""` |
55+
| `controllerManager.manager.image.repository` | | `"quay.io/cephcsi/ceph-csi-operator"` |
56+
| `controllerManager.manager.image.tag` | | `"latest"` |
57+
| `controllerManager.manager.resources.limits.cpu` | | `"500m"` |
58+
| `controllerManager.manager.resources.limits.memory` | | `"128Mi"` |
59+
| `controllerManager.manager.resources.requests.cpu` | | `"10m"` |
60+
| `controllerManager.manager.resources.requests.memory` | | `"64Mi"` |
61+
| `controllerManager.podSecurityContext.runAsNonRoot` | | `true` |
62+
| `controllerManager.replicas` | | `1` |
63+
| `controllerManager.serviceAccount.annotations` | | `{}` |
64+
| `kubernetesClusterDomain` | | `"cluster.local"` |
65+
| `nfsCtrlpluginSa.serviceAccount.annotations` | | `{}` |
66+
| `nfsNodepluginSa.serviceAccount.annotations` | | `{}` |
67+
| `rbdCtrlpluginSa.serviceAccount.annotations` | | `{}` |
68+
| `rbdNodepluginSa.serviceAccount.annotations` | | `{}` |
69+
70+
### **Development Build**
71+
72+
To deploy from a local build from your development environment:
73+
74+
1. Build the cephcsi-operator container image: `make docker-build`
75+
1. Copy the image to your K8s cluster, such as with the `docker save` then the `docker load` commands
76+
1. Install the helm chart:
77+
78+
```console
79+
cd deploy/charts/ceph-csi-operator
80+
helm install --create-namespace --namespace ceph-csi-operator-system ceph-csi-operator .
81+
```
82+
83+
## Uninstalling the Chart
84+
85+
To see the currently installed Rook chart:
86+
87+
```console
88+
helm ls --namespace ceph-csi-operator-system
89+
```
90+
91+
To uninstall/delete the `ceph-csi-operator` deployment:
92+
93+
```console
94+
helm delete --namespace ceph-csi-operator-system ceph-csi-operator
95+
```
96+
97+
The command removes all the Kubernetes components associated with the chart and deletes the release.

0 commit comments

Comments
 (0)