-
Notifications
You must be signed in to change notification settings - Fork 8
Add Chart and documentation #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
05fae44
Added chart for Function and Task for postgres-stash
bd4f1a8
wip: add PosgreSQL backup doc
3132c75
added all
7a37df9
add example for restore process
f914d8c
complete documentation
d3068a4
Add front matter + refactor
71009ea
add chart version in task and function name
9fe0b49
Renamed chart version to 11.x
02d22b2
Update chart and docs for 10.x
ad7da63
Update chart and doc for version 9.x
04468c8
use verison 9 instead of 9.x
02f7e48
Make configurable parameters global so that parent chart can overwite…
d8f853a
Add script installation process
bb80a4b
Update documentation for PostgreSQL 9.6
1f1bcae
Update charts and docs for 10.2
80b0cb9
Update chart and docs for PostgreSQL 10.6
e3da9b7
Update chart/docs for PostgreSQL 11.1
3e2f6b4
Update chart/docs for PostgreSQL 11.2
7a90219
replace . with - in version suffix of name
41a831a
Fix function name in task
b5094b4
Fix chart + remove setup script
a23c0fb
make file fixes
tamalsaha 6b52da7
fix
tamalsaha 8571825
fix
tamalsaha 931d934
revendor azure deps
tamalsaha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
description: 'postgres-stash by AppsCode - PostgreSQL database backup and restore plugin for Stash.' | ||
name: postgres-stash | ||
version: 11.2 | ||
appVersion: 11.2 | ||
home: https://github.com/stashed/postgres | ||
icon: https://cdn.appscode.com/images/icon/stash.png | ||
sources: | ||
- https://github.com/stashed/postgres | ||
maintainers: | ||
- name: appscode | ||
email: support@appscode.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Postgres-stash | ||
|
||
[postgres-stash](https://github.com/stashed/postgres-stash) - PostgreSQL database backup/restore plugin for [Stash](https://appscode.com/products/stash/) by AppsCode. | ||
|
||
## TL;DR; | ||
|
||
```console | ||
helm repo add appscode https://charts.appscode.com/stable/ | ||
helm repo update | ||
helm install appscode/postgres-stash --name=postgres-stash-11.2 --version=11.2 | ||
``` | ||
|
||
## Introduction | ||
|
||
This chart installs necessary `Function` and `Task` definition to backup or restore PostgreSQL database 11.2 using Stash. | ||
|
||
## Prerequisites | ||
|
||
- Kubernetes 1.11+ | ||
|
||
## Installing the Chart | ||
|
||
- Add AppsCode chart repository to your helm repository list, | ||
|
||
```console | ||
helm repo add appscode https://charts.appscode.com/stable/ | ||
``` | ||
|
||
- Update helm repositories to fetch latest charts from the remove repository, | ||
|
||
```console | ||
helm repo update | ||
``` | ||
|
||
- Install the chart with the release name `postgres-stash-11.2` run the following command, | ||
|
||
```console | ||
helm install appscode/postgres-stash --name=postgres-stash-11.2 --version=11.2 | ||
``` | ||
|
||
The above commands installs `Functions` and `Task` crds that are necessary to backup PostgreSQL database 11.2 using Stash. | ||
|
||
## Uninstalling the Chart | ||
|
||
To uninstall/delete the `postgres-stash-11.2` run the following command, | ||
|
||
```console | ||
helm delete postgres-stash-11.2 | ||
``` | ||
|
||
The command removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
## Configuration | ||
|
||
The following table lists the configurable parameters of the `postgre-stash` chart and their default values. | ||
|
||
| Parameter | Description | Default | | ||
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- | | ||
| `docker.registry` | Docker registry used to pull respective images | `appscode` | | ||
| `docker.image` | Docker image used to backup/restore PosegreSQL database | `postgres-stash` | | ||
| `docker.tag` | Tag of the image that is used to backup/restore PostgreSQL database. This is usually same as the database version it can backup. | `11.2` | | ||
| `backup.pgArgs` | Optional arguments to pass to `pgdump` command for bakcup | | | ||
| `restore.pgArgs` | Optional arguments to pass to `psql` command for restoration | | | ||
| `metrics.enabled` | Specifies whether to send Prometheus metrics | `true` | | ||
| `metrics.labels` | Optional comma separated labels to add to the Prometheus metrics | | | ||
|
||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. | ||
|
||
For example: | ||
|
||
```console | ||
helm install --name postgres-stash-11.2 --set metrics.enabled=false appscode/postgres-stash | ||
``` | ||
|
||
**Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `metrics.labels`. | ||
|
||
```console | ||
helm install chart/postgres-stash --set metrics.labels="k1=v1\,k2=v2" | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
To verify that all Functions are installed successfully, run: | ||
|
||
kubectl get function.stash.appscode.com | ||
|
||
To verify that all Tasks are installed successfully, run: | ||
|
||
kubectl get task.stash.appscode.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "postgres-stash.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "postgres-stash.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "postgres-stash.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
# default labels for posgres-stash resources | ||
{{- define "postgres-stash.labels" -}} | ||
app.kubernetes.io/name: {{ include "postgres-stash.name" . }} | ||
helm.sh/chart: {{ include "postgres-stash.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end -}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
apiVersion: stash.appscode.com/v1beta1 | ||
kind: Function | ||
metadata: | ||
name: pg-backup-{{- .Chart.Version }} | ||
labels: | ||
{{- include "postgres-stash.labels" . | nindent 4 }} | ||
spec: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we handle resources? |
||
image: {{ .Values.docker.registry }}/{{ .Values.docker.image }}:{{- .Values.docker.tag }} | ||
args: | ||
- backup-pg | ||
# setup information | ||
- --provider=${REPOSITORY_PROVIDER:=} | ||
- --bucket=${REPOSITORY_BUCKET:=} | ||
- --endpoint=${REPOSITORY_ENDPOINT:=} | ||
- --rest-server-url=${REPOSITORY_URL:=} | ||
- --path=${REPOSITORY_PREFIX:=} | ||
- --secret-dir=/etc/repository/secret | ||
- --scratch-dir=/tmp | ||
- --enable-cache=${ENABLE_CACHE:=true} | ||
- --max-connections=${MAX_CONNECTIONS:=0} # 0 indicates use default connection limit | ||
- --hostname=${HOSTNAME:=} | ||
- --pg-args=${pgArgs:={{ .Values.backup.pgArgs }}} # optional arguments pass to pgdump command | ||
# target information | ||
- --namespace=${NAMESPACE:=default} | ||
- --app-binding=${TARGET_NAME:=} | ||
# cleanup information | ||
- --retention-keep-last=${RETENTION_KEEP_LAST:=0} | ||
- --retention-keep-hourly=${RETENTION_KEEP_HOURLY:=0} | ||
- --retention-keep-daily=${RETENTION_KEEP_DAILY:=0} | ||
- --retention-keep-weekly=${RETENTION_KEEP_WEEKLY:=0} | ||
- --retention-keep-monthly=${RETENTION_KEEP_MONTHLY:=0} | ||
- --retention-keep-yearly=${RETENTION_KEEP_YEARLY:=0} | ||
- --retention-keep-tags=${RETENTION_KEEP_TAGS:=} | ||
- --retention-prune=${RETENTION_PRUNE:=false} | ||
- --retention-dry-run=${RETENTION_DRY_RUN:=false} | ||
# output & metric information | ||
- --output-dir=${outputDir:=} | ||
- --metrics-enabled={{ .Values.metrics.enabled }} | ||
- --metrics-pushgateway-url=${PROMETHEUS_PUSHGATEWAY_URL:=} | ||
{{- if .Values.metrics.labels }} | ||
- --metrics-labels={{ .Values.metrics.labels | quote }} | ||
{{- end }} | ||
volumeMounts: | ||
- name: ${secretVolume} | ||
mountPath: /etc/repository/secret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: stash.appscode.com/v1beta1 | ||
kind: Task | ||
metadata: | ||
name: pg-backup-{{- .Chart.Version }} | ||
labels: | ||
{{- include "postgres-stash.labels" . | nindent 4 }} | ||
spec: | ||
steps: | ||
- name: pg-backup-{{- .Chart.Version }} | ||
params: | ||
- name: outputDir | ||
value: /tmp/output | ||
- name: secretVolume | ||
value: secret-volume | ||
- name: update-status | ||
params: | ||
- name: outputDir | ||
value: /tmp/output | ||
volumes: | ||
- name: secret-volume | ||
secret: | ||
secretName: ${REPOSITORY_SECRET_NAME} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first code should be for 9.x version. Let's talk on Monday. @hossainemruz