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 5e0f88c commit ecf774c
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 33 deletions.
17 changes: 16 additions & 1 deletion Makefile
Expand Up @@ -263,8 +263,23 @@ gen-values-schema:
@yq r api/crds/installer.stash.appscode.com_stashelasticsearches.yaml spec.validation.openAPIV3Schema.properties.spec > /tmp/stash-elasticsearch-values.openapiv3_schema.yaml
@yq d /tmp/stash-elasticsearch-values.openapiv3_schema.yaml description > charts/stash-elasticsearch/values.openapiv3_schema.yaml

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

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
62 changes: 30 additions & 32 deletions charts/stash-elasticsearch/README.md
@@ -1,51 +1,41 @@
# stash-elasticserach
# stash-elasticsearch

[stash-elasticsearch](https://github.com/stashed/stash-elasticsearch) - Elasticsearch database backup/restore plugin for [Stash by AppsCode](https://appscode.com/products/stash/).
[stash-elasticsearch](https://github.com/stashed/elasticsearch) - Elasticsearch 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-elasticsearch-6.2.4 appscode/stash-elasticsearch -n kube-system --version=6.2.4
$ helm repo add appscode https://charts.appscode.com/stable/
$ helm repo update
$ helm install stash-elasticsearch-6.2.4 appscode/stash-elasticsearch -n kube-system --version=6.2.4
```

## Introduction

This chart installs necessary `Function` and `Task` definition to backup or restore Elasticsearch database 6.2.4 using Stash.
This chart deploys necessary `Function` and `Task` definition to backup or restore Elasticsearch database 6.2.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-elasticsearch-6.2.4`:

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

- Update helm repositories to fetch latest charts from the remove repository.
The command deploys necessary `Function` and `Task` definition to backup or restore Elasticsearch database 6.2.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-elasticsearch-6.2.4` run the following command,

```console
helm install stash-elasticsearch-6.2.4 appscode/stash-elasticsearch -n kube-system --version=6.2.4
```

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

To uninstall/delete the `stash-elasticsearch-6.2.4` run the following command,
To uninstall/delete the `stash-elasticsearch-6.2.4`:

```console
helm uninstall stash-elasticsearch-6.2.4 -n kube-system
$ helm delete stash-elasticsearch-6.2.4 -n kube-system
```

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

The following table lists the configurable parameters of the `stash-elasticsearch` 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 PosegreSQL database | `stash-elasticsearch` |
| `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.2.4` |
| `backup.args` | Optional arguments to pass to `multielasticdump` command during backup process | |
| `restore.args` | Optional arguments to pass to `multielasticdump` command during restore process | |
| Parameter | Description | Default |
|------------------|-------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| nameOverride | Overrides name template | `""` |
| fullnameOverride | Overrides fullname template | `""` |
| image.registry | Docker registry used to pull Elasticsearch addon image | `stashed` |
| image.repository | Docker image used to backup/restore Elasticsearch database | `stash-elasticsearch` |
| 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.2.4"` |
| backup.args | Arguments to pass to `multielasticdump` command during backup process | `""` |
| restore.args | Arguments to pass to `multielasticdump` command during restore process | `""` |


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-elasticsearch-6.2.4 appscode/stash-elasticsearch -n kube-system --version=6.2.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-elasticsearch-6.2.4 appscode/stash-elasticsearch -n kube-system --set docker.registry=my-registry
$ helm install stash-elasticsearch-6.2.4 appscode/stash-elasticsearch -n kube-system --version=6.2.4 --values values.yaml
```
19 changes: 19 additions & 0 deletions charts/stash-elasticsearch/doc.yaml
@@ -0,0 +1,19 @@
project:
name: stash-elasticsearch
shortName: stash-elasticsearch
url: https://github.com/stashed/elasticsearch
description: "Elasticsearch database backup/restore plugin for [Stash by AppsCode](https://stash.run)"
app: "necessary `Function` and `Task` definition to backup or restore Elasticsearch database 6.2.4 using Stash"
repository:
url: https://charts.appscode.com/stable/
name: appscode
chart:
name: stash-elasticsearch
version: "6.2.4"
values: "-- generate from values file --"
valuesExample: "-- generate from values file --"
prerequisites:
- Kubernetes 1.11+
release:
name: stash-elasticsearch-6.2.4
namespace: kube-system
8 changes: 8 additions & 0 deletions charts/stash-elasticsearch/values.yaml
Expand Up @@ -2,16 +2,24 @@
# 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 Elasticsearch addon image
registry: stashed
# Docker image used to backup/restore Elasticsearch database
repository: stash-elasticsearch
# Tag of the image that is used to backup/restore Elasticsearch database.
# This is usually same as the database version it can backup.
tag: "6.2.4"

# optional argument to send multielasticdump
backup:
# Arguments to pass to `multielasticdump` command during backup process
args: ""
restore:
# Arguments to pass to `multielasticdump` command during restore process
args: ""

0 comments on commit ecf774c

Please sign in to comment.