Skip to content

Commit bd920eb

Browse files
shudiptatamalsaha
authored andcommitted
Backup and Restore for MySQL-8.0.14 (#3)
1 parent de01833 commit bd920eb

File tree

281 files changed

+10044
-17986
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

281 files changed

+10044
-17986
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ _testmain.go
2929
/bin
3030
/coverage.txt
3131
/dist
32+
.env*

Dockerfile.dbg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ RUN set -x
1919

2020
FROM {ARG_FROM}
2121

22+
ENV DEBIAN_FRONTEND noninteractive
23+
ENV DEBCONF_NONINTERACTIVE_SEEN true
24+
25+
RUN set -x \
26+
&& apt-get update \
27+
&& apt-get install -y --no-install-recommends ca-certificates \
28+
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/*
29+
2230
COPY --from=0 restic_{NEW_RESTIC_VER} /bin/restic_{NEW_RESTIC_VER}
2331
COPY bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}
2432

Dockerfile.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ RUN set -x
1919

2020
FROM {ARG_FROM}
2121

22+
ENV DEBIAN_FRONTEND noninteractive
23+
ENV DEBCONF_NONINTERACTIVE_SEEN true
24+
25+
RUN set -x \
26+
&& apt-get update \
27+
&& apt-get install -y --no-install-recommends ca-certificates \
28+
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/*
29+
2230
COPY --from=0 /restic_{NEW_RESTIC_VER} /bin/restic_{NEW_RESTIC_VER}
2331
COPY bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN}
2432

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
SHELL=/bin/bash -o pipefail
1717

1818
# The binary to build (just the basename).
19-
BIN := mysql-stash
19+
BIN := stash-mysql
2020
COMPRESS ?= no
2121

2222
# Where to push the docker image.
23-
REGISTRY ?= appscode
23+
REGISTRY ?= stashed
2424

2525
# This version-strategy uses git tags to set the version string
2626
git_branch := $(shell git rev-parse --abbrev-ref HEAD)

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
11
[![Go Report Card](https://goreportcard.com/badge/stash.appscode.dev/mysql)](https://goreportcard.com/report/stash.appscode.dev/mysql)
22
[![Build Status](https://travis-ci.org/stashed/mysql.svg?branch=master)](https://travis-ci.org/stashed/mysql)
3-
[![Docker Pulls](https://img.shields.io/docker/pulls/appscode/mysql-stash.svg)](https://hub.docker.com/r/appscode/mysql-stash/)
3+
[![Docker Pulls](https://img.shields.io/docker/pulls/stashed/stash-mysql.svg)](https://hub.docker.com/r/stashed/stash-mysql/)
44
[![Slack](https://slack.appscode.com/badge.svg)](https://slack.appscode.com)
55
[![Twitter](https://img.shields.io/twitter/follow/appscodehq.svg?style=social&logo=twitter&label=Follow)](https://twitter.com/intent/follow?screen_name=AppsCodeHQ)
66

77
# MySQL
8+
89
MySQL backup and restore plugin for [Stash by AppsCode](https://appscode.com/products/stash).
910

10-
---
11+
## Install
12+
13+
Install MySQL 8.0.14 backup or restore plugin for Stash as below.
14+
15+
```console
16+
helm repo add appscode https://charts.appscode.com/stable/
17+
helm repo update
18+
helm install appscode/stash-mysql --name=stash-mysql-8.0.14 --version=8.0.14
19+
```
1120

12-
**Stash binaries collects anonymous usage statistics to help us learn how the software is being used and how we can improve it. To disable stats collection, run the operator with the flag** `--enable-analytics=false`.
21+
To install catalog for all supported MySQL versions, please visit [here](https://github.com/stashed/catalog).
1322

14-
---
23+
## Uninstall
24+
25+
Uninstall MySQL 8.0.14 backup or restore plugin for Stash as below.
26+
27+
```console
28+
helm delete stash-mysql-8.0.14
29+
```
1530

1631
## Support
32+
1733
We use Slack for public discussions. To chit chat with us or the rest of the community, join us in the [AppsCode Slack team](https://appscode.slack.com/messages/C8NCX6N23/details/) channel `#stash`. To sign up, use our [Slack inviter](https://slack.appscode.com/).
1834

1935
If you have found a bug with Stash or want to request for new features, please [file an issue](https://github.com/stashed/stash/issues/new).

chart/stash-mysql/.helmignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
.vscode/

chart/stash-mysql/Chart.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
description: 'stash-mysql - MySQL database backup and restore plugin for Stash by AppsCode'
3+
name: stash-mysql
4+
version: 8.0.14
5+
appVersion: 8.0.14
6+
home: https://github.com/stashed/mysql
7+
icon: https://cdn.appscode.com/images/icon/stash.png
8+
sources:
9+
- https://github.com/stashed/mysql
10+
maintainers:
11+
- name: appscode
12+
email: support@appscode.com

chart/stash-mysql/README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# stash-mysql
2+
3+
[stash-mysql](https://github.com/stashed/mysql) - MySQL database backup/restore plugin for [Stash by AppsCode](https://appscode.com/products/stash/).
4+
5+
## TL;DR;
6+
7+
```console
8+
$ helm repo add appscode https://charts.appscode.com/stable/
9+
$ helm repo update
10+
$ helm install appscode/stash-mysql --name=stash-mysql-8.0.14 --version=8.0.14
11+
```
12+
13+
## Introduction
14+
15+
This chart installs necessary `Functions` and `Tasks` definitions to take backup of MySQL-8.0.14 databases and restore them using Stash.
16+
17+
## Prerequisites
18+
19+
- Kubernetes 1.11+
20+
21+
## Installing the Chart
22+
23+
- Add AppsCode chart repository to your helm repository list,
24+
25+
```console
26+
$ helm repo add appscode https://charts.appscode.com/stable/
27+
```
28+
29+
- Update helm repositories to fetch latest charts from the remove repository,
30+
31+
```console
32+
$ helm repo update
33+
```
34+
35+
- Install the chart with the release name `stash-mysql-8.0.14` run the following command,
36+
37+
```console
38+
$ helm install appscode/stash-mysql --name=stash-mysql-8.0.14 --version=8.0.14
39+
```
40+
41+
The above commands installs `Functions` and `Task` CRDs that are necessary to take backup of MySQL-8.0.14 databases and restore them using Stash.
42+
43+
## Uninstalling the Chart
44+
45+
To uninstall/delete the `stash-mysql-8.0.14` run the following command,
46+
47+
```console
48+
helm delete stash-mysql-8.0.14 --purge
49+
```
50+
51+
The command removes all the Kubernetes components associated with the chart and deletes the release.
52+
53+
## Configuration
54+
55+
The following table lists the configurable parameters of the `stash-mysql` chart and their default values.
56+
57+
| Parameter | Description | Default |
58+
| :---------------: | -------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------: |
59+
| `docker.registry` | Docker registry used to pull respective images | `stashed` |
60+
| `docker.image` | Docker image used to take backup of MySQL databases and restore them | `stash-mysql` |
61+
| `docker.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. | `8.0.14` |
62+
| `backup.myArgs` | Optional arguments to pass to `mysqldump` command during bakcup process | `--all-databases` |
63+
| `restore.myArgs` | Optional arguments to pass to `mysql` command during restore process | "" |
64+
| `metrics.enabled` | Specifies whether to send Prometheus metrics | `true` |
65+
| `metrics.labels` | Optional comma separated labels to add to the Prometheus metrics | [] |
66+
67+
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
68+
69+
For example:
70+
71+
```console
72+
helm install --name stash-mysql-8.0.14 --set metrics.enabled=false appscode/stash-mysql
73+
```
74+
75+
**Tips:** Use escape character (`\`) while providing multiple comma-separated labels for `metrics.labels`.
76+
77+
```console
78+
helm install chart/stash-mysql --set metrics.labels="k1=v1\,k2=v2"
79+
```

chart/stash-mysql/templates/NOTES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
To verify that all Functions are installed successfully, run:
2+
3+
kubectl get function.stash.appscode.com
4+
5+
To verify that all Tasks are installed successfully, run:
6+
7+
kubectl get task.stash.appscode.com
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "stash-mysql.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "stash-mysql.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Create chart name and version as used by the chart label.
29+
*/}}
30+
{{- define "stash-mysql.chart" -}}
31+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
32+
{{- end -}}
33+
34+
{{/*
35+
Common labels
36+
*/}}
37+
{{- define "stash-mysql.labels" -}}
38+
app.kubernetes.io/name: {{ include "stash-mysql.name" . }}
39+
helm.sh/chart: {{ include "stash-mysql.chart" . }}
40+
app.kubernetes.io/instance: {{ .Release.Name }}
41+
{{- if .Chart.AppVersion }}
42+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
43+
{{- end }}
44+
app.kubernetes.io/managed-by: {{ .Release.Service }}
45+
{{- end -}}

0 commit comments

Comments
 (0)