Skip to content

Commit 9a6392c

Browse files
committed
Auto generate chart readme file
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent 44be3d5 commit 9a6392c

File tree

4 files changed

+73
-33
lines changed

4 files changed

+73
-33
lines changed

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,23 @@ gen-values-schema:
263263
@yq r api/crds/installer.stash.appscode.com_stashelasticsearches.yaml spec.validation.openAPIV3Schema.properties.spec > /tmp/stash-elasticsearch-values.openapiv3_schema.yaml
264264
@yq d /tmp/stash-elasticsearch-values.openapiv3_schema.yaml description > charts/stash-elasticsearch/values.openapiv3_schema.yaml
265265

266+
.PHONY: gen-chart-doc
267+
gen-chart-doc: gen-chart-doc-stash-elasticsearch
268+
269+
gen-chart-doc-%:
270+
@echo "Generate $* chart docs"
271+
@docker run --rm \
272+
-u $$(id -u):$$(id -g) \
273+
-v /tmp:/.cache \
274+
-v $$(pwd):$(DOCKER_REPO_ROOT) \
275+
-w $(DOCKER_REPO_ROOT) \
276+
--env HTTP_PROXY=$(HTTP_PROXY) \
277+
--env HTTPS_PROXY=$(HTTPS_PROXY) \
278+
$(BUILD_IMAGE) \
279+
chart-doc-gen -d ./charts/$*/doc.yaml -v ./charts/$*/values.yaml > ./charts/$*/README.md
280+
266281
.PHONY: manifests
267-
manifests: gen-crds patch-crds label-crds gen-bindata gen-values-schema
282+
manifests: gen-crds patch-crds label-crds gen-bindata gen-values-schema gen-chart-doc
268283

269284
.PHONY: gen
270285
gen: clientset gen-crd-protos manifests openapi

charts/stash-elasticsearch/README.md

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,41 @@
1-
# stash-elasticserach
1+
# stash-elasticsearch
22

3-
[stash-elasticsearch](https://github.com/stashed/stash-elasticsearch) - Elasticsearch database backup/restore plugin for [Stash by AppsCode](https://appscode.com/products/stash/).
3+
[stash-elasticsearch](https://github.com/stashed/elasticsearch) - Elasticsearch database backup/restore plugin for [Stash by AppsCode](https://stash.run)
44

55
## TL;DR;
66

77
```console
8-
helm repo add appscode https://charts.appscode.com/stable/
9-
helm repo update
10-
helm install stash-elasticsearch-6.5.3 appscode/stash-elasticsearch -n kube-system --version=6.5.3
8+
$ helm repo add appscode https://charts.appscode.com/stable/
9+
$ helm repo update
10+
$ helm install stash-elasticsearch-6.5.3 appscode/stash-elasticsearch -n kube-system --version=6.5.3
1111
```
1212

1313
## Introduction
1414

15-
This chart installs necessary `Function` and `Task` definition to backup or restore Elasticsearch database 6.5.3 using Stash.
15+
This chart deploys necessary `Function` and `Task` definition to backup or restore Elasticsearch database 6.5.3 using Stash on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
1616

1717
## Prerequisites
1818

1919
- Kubernetes 1.11+
2020

2121
## Installing the Chart
2222

23-
- Add AppsCode chart repository to your helm repository list.
23+
To install the chart with the release name `stash-elasticsearch-6.5.3`:
2424

2525
```console
26-
helm repo add appscode https://charts.appscode.com/stable/
26+
$ helm install stash-elasticsearch-6.5.3 appscode/stash-elasticsearch -n kube-system --version=6.5.3
2727
```
2828

29-
- Update helm repositories to fetch latest charts from the remove repository.
29+
The command deploys necessary `Function` and `Task` definition to backup or restore Elasticsearch database 6.5.3 using Stash on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
3030

31-
```console
32-
helm repo update
33-
```
34-
35-
- Install the chart with the release name `stash-elasticsearch-6.5.3` run the following command,
36-
37-
```console
38-
helm install stash-elasticsearch-6.5.3 appscode/stash-elasticsearch -n kube-system --version=6.5.3
39-
```
40-
41-
The above commands installs `Functions` and `Task` crds that are necessary to backup Elasticsearch database 6.5.3 using Stash.
31+
> **Tip**: List all releases using `helm list`
4232
4333
## Uninstalling the Chart
4434

45-
To uninstall/delete the `stash-elasticsearch-6.5.3` run the following command,
35+
To uninstall/delete the `stash-elasticsearch-6.5.3`:
4636

4737
```console
48-
helm uninstall stash-elasticsearch-6.5.3 -n kube-system
38+
$ helm delete stash-elasticsearch-6.5.3 -n kube-system
4939
```
5040

5141
The command removes all the Kubernetes components associated with the chart and deletes the release.
@@ -54,18 +44,26 @@ The command removes all the Kubernetes components associated with the chart and
5444

5545
The following table lists the configurable parameters of the `stash-elasticsearch` chart and their default values.
5646

57-
| Parameter | Description | Default |
58-
| ------------------ | :---------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
59-
| `image.registry` | Docker registry used to pull respective images | `stashed` |
60-
| `image.repository` | Docker image used to backup/restore PosegreSQL database | `stash-elasticsearch` |
61-
| `image.tag` | Tag of the image that is used to backup/restore Elasticsearch database. This is usually same as the database version it can backup. | `6.5.3` |
62-
| `backup.args` | Optional arguments to pass to `multielasticdump` command during backup process | |
63-
| `restore.args` | Optional arguments to pass to `multielasticdump` command during restore process | |
47+
| Parameter | Description | Default |
48+
|------------------|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
49+
| nameOverride | Overrides name template | `""` |
50+
| fullnameOverride | Overrides fullname template | `""` |
51+
| image.registry | Docker registry used to pull Elasticsearch addon image | `stashed` |
52+
| image.repository | Docker image used to backup/restore Elasticsearch database | `stash-elasticsearch` |
53+
| image.tag | Tag of the image that is used to backup/restore Elasticsearch database. This is usually same as the database version it can backup. | `"6.5.3"` |
54+
| backup.args | Arguments to pass to `multielasticdump` command during backup process | `""` |
55+
| restore.args | Arguments to pass to `multielasticdump` command during restore process | `""` |
56+
57+
58+
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:
6459

65-
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
60+
```console
61+
$ helm install stash-elasticsearch-6.5.3 appscode/stash-elasticsearch -n kube-system --version=6.5.3 --set image.registry=stashed
62+
```
6663

67-
For example:
64+
Alternatively, a YAML file that specifies the values for the parameters can be provided while
65+
installing the chart. For example:
6866

6967
```console
70-
helm install stash-elasticsearch-6.5.3 appscode/stash-elasticsearch -n kube-system --set docker.registry=my-registry
68+
$ helm install stash-elasticsearch-6.5.3 appscode/stash-elasticsearch -n kube-system --version=6.5.3 --values values.yaml
7169
```

charts/stash-elasticsearch/doc.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
project:
2+
name: stash-elasticsearch
3+
shortName: stash-elasticsearch
4+
url: https://github.com/stashed/elasticsearch
5+
description: "Elasticsearch database backup/restore plugin for [Stash by AppsCode](https://stash.run)"
6+
app: "necessary `Function` and `Task` definition to backup or restore Elasticsearch database 6.5.3 using Stash"
7+
repository:
8+
url: https://charts.appscode.com/stable/
9+
name: appscode
10+
chart:
11+
name: stash-elasticsearch
12+
version: "6.5.3"
13+
values: "-- generate from values file --"
14+
valuesExample: "-- generate from values file --"
15+
prerequisites:
16+
- Kubernetes 1.11+
17+
release:
18+
name: stash-elasticsearch-6.5.3
19+
namespace: kube-system

charts/stash-elasticsearch/values.yaml

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

5+
# Overrides name template
56
nameOverride: ""
7+
# Overrides fullname template
68
fullnameOverride: ""
79

810
image:
11+
# Docker registry used to pull Elasticsearch addon image
912
registry: stashed
13+
# Docker image used to backup/restore Elasticsearch database
1014
repository: stash-elasticsearch
15+
# Tag of the image that is used to backup/restore Elasticsearch database.
16+
# This is usually same as the database version it can backup.
1117
tag: "6.5.3"
1218

1319
# optional argument to send multielasticdump
1420
backup:
21+
# Arguments to pass to `multielasticdump` command during backup process
1522
args: ""
1623
restore:
24+
# Arguments to pass to `multielasticdump` command during restore process
1725
args: ""

0 commit comments

Comments
 (0)