Skip to content

Commit

Permalink
Updated MySQL doc for 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
the-redback committed Oct 1, 2018
1 parent 49630d5 commit 7452ab3
Show file tree
Hide file tree
Showing 23 changed files with 1,373 additions and 879 deletions.
79 changes: 79 additions & 0 deletions docs/concepts/catalog/mysql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: MySQLVersion
menu:
docs_0.9.0-beta.1:
identifier: mysql-version
name: MySQLVersion
parent: catalog
weight: 30
menu_name: docs_0.9.0-beta.1
section_menu_id: concepts
---

# MySQLVersion

## What is MySQLVersion

`MySQLVersion` is a Kubernetes `Custom Resource Definitions` (CRD). It provides a declarative configuration to specify the docker images to be used for [MySQL](https://www.mysql.org/) database deployed with KubeDB in Kubernetes native way.

When you install KubeDB, `MySQLVersion` crd will be created automatically for every supported MySQL versions. You have to specify the name of `MySQLVersion` crd in `spec.version` field of [MySQL](/docs/concepts/databases/mysql.md) crd. Then, KubeDB will use the docker images specified in the `MySQLVersion` crd to create your expected database.

Using a separate crd for specifying respective docker images allows us to modify the images independent of KubeDB operator. This will also allow the users to use a custom image for the database.

## MySQLVersion Specification

As with all other Kubernetes objects, a MySQLVersion needs `apiVersion`, `kind`, and `metadata` fields. It also needs a `.spec` section.

```yaml
apiVersion: catalog.kubedb.com/v1alpha1
kind: MySQLVersion
metadata:
name: "8.0-v1"
labels:
app: kubedb
spec:
version: "8.0"
db:
image: "${KUBEDB_DOCKER_REGISTRY}/mysql:8.0-v1"
exporter:
image: "${KUBEDB_DOCKER_REGISTRY}/mysqld-exporter:v0.11.0"
tools:
image: "${KUBEDB_DOCKER_REGISTRY}/mysql-tools:8.0-v1"
```
### metadata.name
`metadata.name` is a required field that specify the name of the `MySQLVersion` crd. You have to specify this name in `spec.version` field of [MySQL](/docs/concepts/databases/mysql.md) crd.

We follow this convention for naming MySQLVersion crd:

- Name format: `{Original MySQL image version}-{modification tag}`

We modify original MySQL docker image to support additional features. An image with higher modification tag will have more feature than the images with lower modification tag. Hence, it is recommended to use MySQLVersion crd with highest modification tag to enjoy latest features.

### spec.version

`spec.version` is a required field that specifies the original version of MySQL database that has been used to build the docker image specified in `spec.db.image` field.

### spec.deprecated

`spec.deprecated` is an optional field that specifies whether the docker images specified here is supported by the current KubeDB operator. For example, we have modified `kubedb/mysql:8.0` docker image to support custom configuration and re-tagged as `kubedb/mysql:8.0-v1`. Now, KubeDB `0.9.0` supports providing custom configuration which required `kubedb/mysql:8.0-v1` docker image. So, we have marked `kubedb/mysql:8.0` as deprecated for KubeDB `0.9.0`.

The default value of this field is `false`. If `spec.depcrecated` is set `true`, KubeDB operator will not create the database and other respective resources for this version.

### spec.db.image

`spec.db.image` is a required field that specifies the docker image which will be used to create Statefulset by KubeDB operator to create expected MySQL database.

### spec.exporter.image

`spec.exporter.image` is required field that specifies the image which will be used to export Prometheus metrics.

### spec.tools.image

`spec.tools.image` is a required field that specifies the image which will be used to take backup and initialize database from snapshot.

## Next Steps

- Learn about MySQL crd [here](/docs/concepts/databases/mysql.md).
- Deploy your first MySQL database with KubeDB by following the guide [here](/docs/guides/mysql/quickstart/quickstart.md).
296 changes: 202 additions & 94 deletions docs/concepts/databases/mysql.md

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions docs/examples/mysql/Initialization/demo-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,5 @@ spec:
storage: 50Mi
init:
scriptSource:
gitRepo:
repository: "https://github.com/kubedb/mysql-init-scripts.git"
directory: .
configMap:
name: my-init-script
2 changes: 2 additions & 0 deletions docs/examples/mysql/Initialization/demo-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
namespace: demo
spec:
version: "8.0-v1"
databaseSecret:
secretName: mysql-infant-auth
storage:
storageClassName: "standard"
accessModes:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/mysql/cli/mysql-demo.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kubedb.com/v1alpha1
kind: MySQL
metadata:
name: mysql-demo
name: mysql-qa
spec:
version: "8.0-v1"
storage:
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/mysql/custom-config/mysql-custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ spec:
version: "8.0-v1"
doNotPause: true
configSource:
configMap:
name: my-custom-config
configMap:
name: my-custom-config
storage:
storageClassName: "standard"
accessModes:
Expand Down
6 changes: 4 additions & 2 deletions docs/examples/mysql/private-registry/demo-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ spec:
resources:
requests:
storage: 50Mi
imagePullSecrets:
- name: myregistrykey
podTemplate:
spec:
imagePullSecrets:
- name: myregistrykey
1 change: 1 addition & 0 deletions docs/examples/mysql/quickstart/demo-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ metadata:
spec:
version: "8.0-v1"
doNotPause: true
storageType: Durable
storage:
storageClassName: "standard"
accessModes:
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/mysql/snapshot/demo-2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ spec:
databaseName: mysql-infant
storageSecretName: my-snap-secret
gcs:
bucket: restic
bucket: kubedb
2 changes: 2 additions & 0 deletions docs/examples/mysql/snapshot/demo-3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ metadata:
namespace: demo
spec:
version: "8.0-v1"
databaseSecret:
secretName: mysql-infant-auth
storage:
storageClassName: "standard"
accessModes:
Expand Down
7 changes: 1 addition & 6 deletions docs/examples/mysql/snapshot/demo-4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ spec:
resources:
requests:
storage: 50Mi
init:
scriptSource:
gitRepo:
repository: "https://github.com/kubedb/mysql-init-scripts.git"
directory: .
backupSchedule:
cronExpression: "@every 1m"
storageSecretName: my-snap-secret
gcs:
bucket: restic
bucket: kubedb
47 changes: 29 additions & 18 deletions docs/guides/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,46 @@ aliases:
## Supported MySQL Features

|Features | Availability |
|--------------------------------------------------------|:------------:|
|Clustering | ✗ |
|Persistent Volume | ✓ |
|Instant Backup | ✓ |
|Scheduled Backup | ✓ |
|Initialize using Snapshot | ✓ |
|Initialize using Script (\*.sql, \*sql.gz and/or \*.sh) | ✓ |
|Builtin Prometheus Discovery | ✓ |
|Using CoreOS Prometheus Operator | ✓ |
| Features | Availability |
| ------------------------------------------------------- | :----------: |
| Clustering | ✗ |
| Persistent Volume | ✓ |
| Instant Backup | ✓ |
| Scheduled Backup | ✓ |
| Initialize using Snapshot | ✓ |
| Initialize using Script (\*.sql, \*sql.gz and/or \*.sh) | ✓ |
| Custom Configuration | ✓ |
| Using Custom docker image | ✓ |
| Builtin Prometheus Discovery | ✓ |
| Using CoreOS Prometheus Operator | ✓ |

<br/>

## Life Cycle of a MySQL Object

<p align="center">
  <img alt="lifecycle" src="/docs/images/mysql/mysql-lifecycle.png" width="600" height="660">
  <img alt="lifecycle" src="/docs/images/mysql/mysql-lifecycle.png" >
</p>

<br/>

## Supported MySQL Versions

| KubeDB Version | MySQL:8.0 | MySQL:5.7 |
|:--------------:|:---------:|:---------:|
| 0.1.0 - 0.7.0 | &#10007; | &#10007; |
| 0.8.0-beta.2 | &#10003; | &#10007; |
| 0.8.0-rc.0 | &#10003; | &#10003; |
| 0.8.0 | &#10003; | &#10003; |
| 0.9.0-beta.1 | &#10003; | &#10003; |
| KubeDB Version | MySQL 8.0, 8 | 5.7, 5 | 8.0-v1, 8-v1 | 5.7-v1, 5-v1 |
| :------------: | :----------: | :------: | :----------: | :----------: |
| 0.1.0 - 0.7.0 | &#10007; | &#10007; | &#10007; | &#10007; |
| 0.8.0 | &#10003; | &#10003; | &#10007; | &#10007; |
| 0.9.0-beta.1 | &#10007; | &#10007; | &#10003; | &#10003; |

<br/>

## External tools dependency

| Tool | Version |
| -------------------------------------- | :-----: |
| [osm](https://github.com/appscode/osm) | 0.8.0 |

<br/>

## User Guide

Expand All @@ -60,6 +70,7 @@ aliases:
- Use [private Docker registry](/docs/guides/mysql/private-registry/using-private-registry.md) to deploy MySQL with KubeDB.
- Use [kubedb cli](/docs/guides/mysql/cli/cli.md) to manage databases like kubectl for Kubernetes.
- Detail concepts of [MySQL object](/docs/concepts/databases/mysql.md).
- Detail concepts of [MySQLVersion object](/docs/concepts/catalog/mysql.md).
- Detail concepts of [Snapshot object](/docs/concepts/snapshot.md).
- Wondering what features are coming next? Please visit [here](/docs/roadmap.md).
- Want to hack on KubeDB? Check our [contribution guidelines](/docs/CONTRIBUTING.md).
Loading

0 comments on commit 7452ab3

Please sign in to comment.