diff --git a/Makefile b/Makefile index 800cdb43f..fcda22b72 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/charts/stash-elasticsearch/README.md b/charts/stash-elasticsearch/README.md index aae044246..2dd495dbe 100644 --- a/charts/stash-elasticsearch/README.md +++ b/charts/stash-elasticsearch/README.md @@ -1,18 +1,18 @@ -# 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 @@ -20,32 +20,22 @@ This chart installs necessary `Function` and `Task` definition to backup or rest ## 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. @@ -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 ``` diff --git a/charts/stash-elasticsearch/doc.yaml b/charts/stash-elasticsearch/doc.yaml new file mode 100644 index 000000000..a10be4219 --- /dev/null +++ b/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 diff --git a/charts/stash-elasticsearch/values.yaml b/charts/stash-elasticsearch/values.yaml index a6063b532..504e96843 100644 --- a/charts/stash-elasticsearch/values.yaml +++ b/charts/stash-elasticsearch/values.yaml @@ -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: ""