Skip to content

Commit

Permalink
Auto generate chart readme file
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <tamal@appscode.com>
  • Loading branch information
tamalsaha committed May 26, 2020
1 parent 56f2d0f commit da3e334
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 32 deletions.
17 changes: 16 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,23 @@ gen-values-schema:
@yq r api/crds/installer.stash.appscode.com_stashmongodbs.yaml spec.validation.openAPIV3Schema.properties.spec > /tmp/stash-mongodb-values.openapiv3_schema.yaml
@yq d /tmp/stash-mongodb-values.openapiv3_schema.yaml description > charts/stash-mongodb/values.openapiv3_schema.yaml

.PHONY: gen-chart-doc
gen-chart-doc: gen-chart-doc-stash-mongodb

gen-chart-doc-%:
@echo "Generate $* chart docs"
@docker run --rm \
-u $$(id -u):$$(id -g) \
-v /tmp:/.cache \
-v $$(pwd):$(DOCKER_REPO_ROOT) \
-w $(DOCKER_REPO_ROOT) \
--env HTTP_PROXY=$(HTTP_PROXY) \
--env HTTPS_PROXY=$(HTTPS_PROXY) \
$(BUILD_IMAGE) \
chart-doc-gen -d ./charts/$*/doc.yaml -v ./charts/$*/values.yaml > ./charts/$*/README.md

.PHONY: manifests
manifests: gen-crds patch-crds label-crds gen-bindata gen-values-schema
manifests: gen-crds patch-crds label-crds gen-bindata gen-values-schema gen-chart-doc

.PHONY: gen
gen: clientset gen-crd-protos manifests openapi
Expand Down
61 changes: 30 additions & 31 deletions charts/stash-mongodb/README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,41 @@
# stash-mongodb

[stash-mongodb](https://github.com/stashed/stash-mongodb) - MongoDB database backup/restore plugin for [Stash by AppsCode](https://appscode.com/products/stash/).
[stash-mongodb](https://github.com/stashed/mongodb) - MongoDB database backup/restore plugin for [Stash by AppsCode](https://stash.run)

## TL;DR;

```console
helm repo add appscode https://charts.appscode.com/stable/
helm repo update
helm install stash-mongodb-4.1.4 appscode/stash-mongodb -n kube-system --version=4.1.4
$ helm repo add appscode https://charts.appscode.com/stable/
$ helm repo update
$ helm install stash-mongodb-4.1.4 appscode/stash-mongodb -n kube-system --version=4.1.4
```

## Introduction

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

## Prerequisites

- Kubernetes 1.11+

## Installing the Chart

- Add AppsCode chart repository to your helm repository list,
To install the chart with the release name `stash-mongodb-4.1.4`:

```console
helm repo add appscode https://charts.appscode.com/stable/
$ helm install stash-mongodb-4.1.4 appscode/stash-mongodb -n kube-system --version=4.1.4
```

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

```console
helm repo update
```

- Install the chart with the release name `stash-mongodb-4.1.4` run the following command,

```console
helm install stash-mongodb-4.1.4 appscode/stash-mongodb -n kube-system --version=4.1.4
```

The above commands installs `Functions` and `Task` crds that are necessary to backup MongoDB database 4.1.4 using Stash.
> **Tip**: List all releases using `helm list`
## Uninstalling the Chart

To uninstall/delete the `stash-mongodb-4.1.4` run the following command,
To uninstall/delete the `stash-mongodb-4.1.4`:

```console
helm uninstall stash-mongodb-4.1.4 -n kube-system
$ helm delete stash-mongodb-4.1.4 -n kube-system
```

The command removes all the Kubernetes components associated with the chart and deletes the release.
Expand All @@ -54,18 +44,27 @@ The command removes all the Kubernetes components associated with the chart and

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

| Parameter | Description | Default |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------- | --------------- |
| `image.registry` | Docker registry used to pull respective images | `stashed` |
| `image.repository` | Docker image used to backup/restore MongoDB database | `stash-mongodb` |
| `image.tag` | Tag of the image that is used to backup/restore MongoDB database. This is usually same as the database version it can backup. | `4.1.4` |
| `backup.args` | Optional arguments to pass to `mongodump` command during bakcup process | |
| `restore.args` | Optional arguments to pass to `mongorestore` command during restore process | |
| Parameter | Description | Default |
|------------------|-------------------------------------------------------------------------------------------------------------------------------|-----------------|
| nameOverride | Overrides name template | `""` |
| fullnameOverride | Overrides fullname template | `""` |
| image.registry | Docker registry used to pull MongoDB addon image | `stashed` |
| image.repository | Docker image used to backup/restore MongoDB database | `stash-mongodb` |
| image.tag | Tag of the image that is used to backup/restore MongoDB database. This is usually same as the database version it can backup. | `"4.1.4"` |
| backup.args | Arguments to pass to `mongodump` command during bakcup process | `""` |
| restore.args | Arguments to pass to `mongorestore` command during restore process | `""` |
| maxConcurrency | Maximum concurrency to perform backup or restore tasks | `3` |


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

Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
```console
$ helm install stash-mongodb-4.1.4 appscode/stash-mongodb -n kube-system --version=4.1.4 --set image.registry=stashed
```

For example:
Alternatively, a YAML file that specifies the values for the parameters can be provided while
installing the chart. For example:

```console
helm install stash-mongodb-4.1.4 appscode/stash-mongodb -n kube-system --set docker.registry=my-registry
$ helm install stash-mongodb-4.1.4 appscode/stash-mongodb -n kube-system --version=4.1.4 --values values.yaml
```
19 changes: 19 additions & 0 deletions charts/stash-mongodb/doc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
project:
name: stash-mongodb
shortName: stash-mongodb
url: https://github.com/stashed/mongodb
description: "MongoDB database backup/restore plugin for [Stash by AppsCode](https://stash.run)"
app: "necessary `Function` and `Task` definition to backup or restore MongoDB database 4.1.4 using Stash"
repository:
url: https://charts.appscode.com/stable/
name: appscode
chart:
name: stash-mongodb
version: "4.1.4"
values: "-- generate from values file --"
valuesExample: "-- generate from values file --"
prerequisites:
- Kubernetes 1.11+
release:
name: stash-mongodb-4.1.4
namespace: kube-system
8 changes: 8 additions & 0 deletions charts/stash-mongodb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,26 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

# Overrides name template
nameOverride: ""
# Overrides fullname template
fullnameOverride: ""

image:
# Docker registry used to pull MongoDB addon image
registry: stashed
# Docker image used to backup/restore MongoDB database
repository: stash-mongodb
# Tag of the image that is used to backup/restore MongoDB database.
# This is usually same as the database version it can backup.
tag: "4.1.4"

# optional argument to send mongodump or mongorestore command
backup:
# Arguments to pass to `mongodump` command during bakcup process
args: ""
restore:
# Arguments to pass to `mongorestore` command during restore process
args: ""

# Maximum concurrency to perform backup or restore tasks
Expand Down

0 comments on commit da3e334

Please sign in to comment.