Skip to content

Commit dad10df

Browse files
committed
Auto generate chart readme file
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent 462eecf commit dad10df

File tree

4 files changed

+68
-29
lines changed

4 files changed

+68
-29
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_stashmysqls.yaml spec.validation.openAPIV3Schema.properties.spec > /tmp/stash-mysql-values.openapiv3_schema.yaml
264264
@yq d /tmp/stash-mysql-values.openapiv3_schema.yaml description > charts/stash-mysql/values.openapiv3_schema.yaml
265265

266+
.PHONY: gen-chart-doc
267+
gen-chart-doc: gen-chart-doc-stash-mysql
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-mysql/README.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# stash-mysql
22

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

55
## TL;DR;
66

@@ -12,40 +12,30 @@ $ helm install stash-mysql-5.7.25 appscode/stash-mysql -n kube-system --version=
1212

1313
## Introduction
1414

15-
This chart installs necessary `Functions` and `Tasks` definitions to take backup of MySQL-5.7.25 databases and restore them using Stash.
15+
This chart deploys necessary `Function` and `Task` definition to backup or restore MySQL database 5.7.25 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-mysql-5.7.25`:
2424

2525
```console
26-
$ helm repo add appscode https://charts.appscode.com/stable/
26+
$ helm install stash-mysql-5.7.25 appscode/stash-mysql -n kube-system --version=5.7.25
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 MySQL database 5.7.25 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-mysql-5.7.25` run the following command,
36-
37-
```console
38-
$ helm install appscode/stash-mysql --name=stash-mysql-5.7.25 --version=5.7.25
39-
```
40-
41-
The above commands installs `Functions` and `Task` CRDs that are necessary to take backup of MySQL-5.7.25 databases and restore them using Stash.
31+
> **Tip**: List all releases using `helm list`
4232
4333
## Uninstalling the Chart
4434

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

4737
```console
48-
helm uninstall stash-mysql-5.7.25 -n kube-system --purge
38+
$ helm delete stash-mysql-5.7.25 -n kube-system
4939
```
5040

5141
The command removes all the Kubernetes components associated with the chart and deletes the release.
@@ -54,19 +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-mysql` 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 take backup of MySQL databases and restore them | `stash-mysql` |
61-
| `image.tag` | Tag of the image that is used to take backup of MySQL databases and restore them. This is usually same as the database version it can take backup. | `5.7.25` |
62-
| `backup.args` | Optional arguments to pass to `mysqldump` command during bakcup process | `--all-databases` |
63-
| `restore.args` | Optional arguments to pass to `mysql` 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 MySQL addon image | `stashed` |
52+
| image.repository | Docker image used to backup/restore MySQL database | `stash-mysql` |
53+
| image.tag | Tag of the image that is used to backup/restore MySQL database. This is usually same as the database version it can backup. | `"5.7.25"` |
54+
| backup.args | Arguments to pass to `mysqldump` command during bakcup process | `"--all-databases"` |
55+
| restore.args | Arguments to pass to `mysql` command during restore process | `""` |
6456

65-
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
6657

67-
For example:
58+
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:
6859

6960
```console
70-
helm install stash-mysql-5.7.25 appscode/stash-mysql -n kube-system ---set docker.registry=my-registry
61+
$ helm install stash-mysql-5.7.25 appscode/stash-mysql -n kube-system --version=5.7.25 --set image.registry=stashed
7162
```
7263

64+
Alternatively, a YAML file that specifies the values for the parameters can be provided while
65+
installing the chart. For example:
66+
67+
```console
68+
$ helm install stash-mysql-5.7.25 appscode/stash-mysql -n kube-system --version=5.7.25 --values values.yaml
69+
```

charts/stash-mysql/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-mysql
3+
shortName: stash-mysql
4+
url: https://github.com/stashed/mysql
5+
description: "MySQL database backup/restore plugin for [Stash by AppsCode](https://stash.run)"
6+
app: "necessary `Function` and `Task` definition to backup or restore MySQL database 5.7.25 using Stash"
7+
repository:
8+
url: https://charts.appscode.com/stable/
9+
name: appscode
10+
chart:
11+
name: stash-mysql
12+
version: "5.7.25"
13+
values: "-- generate from values file --"
14+
valuesExample: "-- generate from values file --"
15+
prerequisites:
16+
- Kubernetes 1.11+
17+
release:
18+
name: stash-mysql-5.7.25
19+
namespace: kube-system

charts/stash-mysql/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 MySQL addon image
912
registry: stashed
13+
# Docker image used to backup/restore MySQL database
1014
repository: stash-mysql
15+
# Tag of the image that is used to backup/restore MySQL database.
16+
# This is usually same as the database version it can backup.
1117
tag: "5.7.25"
1218

1319
# optional argument to send mysqldump or mysql command
1420
backup:
21+
# Arguments to pass to `mysqldump` command during bakcup process
1522
args: "--all-databases"
1623
restore:
24+
# Arguments to pass to `mysql` command during restore process
1725
args: ""

0 commit comments

Comments
 (0)