Skip to content

Commit

Permalink
Add mysql external database docs
Browse files Browse the repository at this point in the history
Signed-off-by: Anisur Rahman <[email protected]>
  • Loading branch information
anisurrahman75 committed Nov 20, 2024
1 parent 10d5444 commit 7a15dbe
Show file tree
Hide file tree
Showing 14 changed files with 925 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/addons/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Addons | KubeStash
menu:
docs_{{ .version }}:
identifier: kubestash-addons
name: Addons
weight: 60
pre: dropdown
menu_name: docs_{{ .version }}
---
41 changes: 41 additions & 0 deletions docs/addons/mysql/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: MySQL Addon Overview | KubeStash
description: MySQL Addon Overview | KubeStash
menu:
docs_{{ .version }}:
identifier: kubestash-mysql-readme
name: Readme
parent: kubestash-mysql
weight: -1
product_name: kubestash
menu_name: docs_{{ .version }}
section_menu_id: kubestash-addons
url: /docs/{{ .version }}/addons/mysql/
aliases:
- /docs/{{ .version }}/addons/mysql/README/
---

# KubeStash MySQL Addon

KubeStash v2024.9.30+ supports extending its functionality through addons. KubeStash MySQL addon enables KubeStash to backup and restore MySQL databases.

This guide will give you an overview of which MySQL versions are supported and how the docs are organized.

## Supported MySQL Versions

KubeStash has the following addon versions for MySQL:

[//]: # ({{< versionlist "mysql">}})

Here, the addon follows `M.M.P` versioning scheme where `M.M.P` (Major.Minor.Patch) represents the respective database version.

## Addon Version Compatibility

Any addon with matching major version with the database version should be able to take backup of that database. For example, MySQL addon with version `8.x.x` should be able take backup of any MySQL of `8.x.x` series. However, this might not be true for some versions. In that case, we will have separate addon for that version.

## Documentation Overview

KubeStash MySQL documentations are organized as below:

- [How does it work?](/docs/addons/mysql/overview/index.md) gives an overview of how backup and restore process for MySQL database works in Stash.
- [Standalone MySQL Database](/docs/addons/mysql/logical/index.md) shows how to backup and restore an externally managed MySQL database.
10 changes: 10 additions & 0 deletions docs/addons/mysql/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: KubeStash MySQL Addon
menu:
docs_{{ .version }}:
identifier: kubestash-mysql
name: MySQL
parent: kubestash-addons
weight: 50
menu_name: docs_{{ .version }}
---
12 changes: 12 additions & 0 deletions docs/addons/mysql/logical/examples/appbinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: appcatalog.appscode.com/v1alpha1
kind: AppBinding
metadata:
name: mysql-appbinding
namespace: demo
spec:
clientConfig:
url: mysql://kubestash-test-do-user-165729-0.m.db.ondigitalocean.com:25060/defaultdb?ssl-mode=REQUIRED
secret:
name: mysql-auth-secret
type: mysql
version: "8.0.21"
9 changes: 9 additions & 0 deletions docs/addons/mysql/logical/examples/auth-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: mysql-auth-secret
namespace: demo
type: Opaque
stringData:
username: doadmin # replace with your auth username
password: "" # <replace with your authentication password>
38 changes: 38 additions & 0 deletions docs/addons/mysql/logical/examples/backupconfiguration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: core.kubestash.com/v1alpha1
kind: BackupConfiguration
metadata:
name: sample-mysql-backup
namespace: demo
spec:
target:
apiGroup: appcatalog.appscode.com
kind: AppBinding
name: mysql-appbinding
namespace: demo
backends:
- name: gcs-backend
storageRef:
namespace: demo
name: gcs-storage
retentionPolicy:
name: demo-retention
namespace: demo
sessions:
- name: frequent-backup
scheduler:
schedule: "*/5 * * * *"
jobTemplate:
backoffLimit: 1
repositories:
- name: gcs-mysql-repo
backend: gcs-backend
directory: /mysql
encryptionSecret:
name: encrypt-secret
namespace: demo
addon:
name: mysql-addon
tasks:
- name: logical-backup
params:
databases: playground
17 changes: 17 additions & 0 deletions docs/addons/mysql/logical/examples/backupstorage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: storage.kubestash.com/v1alpha1
kind: BackupStorage
metadata:
name: gcs-storage
namespace: demo
spec:
storage:
provider: gcs
gcs:
bucket: kubestash-qa
prefix: demo
secretName: gcs-secret
usagePolicy:
allowedNamespaces:
from: All
default: true
deletionPolicy: Delete
21 changes: 21 additions & 0 deletions docs/addons/mysql/logical/examples/restoresession.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: core.kubestash.com/v1alpha1
kind: RestoreSession
metadata:
name: restore-sample-mysql
namespace: demo
spec:
target:
apiGroup: appcatalog.appscode.com
kind: AppBinding
name: mysql-appbinding
namespace: demo
dataSource:
repository: gcs-mysql-repo
snapshot: latest
encryptionSecret:
name: encrypt-secret
namespace: demo
addon:
name: mysql-addon
tasks:
- name: logical-backup-restore
15 changes: 15 additions & 0 deletions docs/addons/mysql/logical/examples/retentionpolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: storage.kubestash.com/v1alpha1
kind: RetentionPolicy
metadata:
name: demo-retention
namespace: demo
spec:
default: true
failedSnapshots:
last: 2
maxRetentionPeriod: 2mo
successfulSnapshots:
last: 5
usagePolicy:
allowedNamespaces:
from: All
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7a15dbe

Please sign in to comment.