charts: add mariadb-cluster chart

This commit is contained in:
Sameer Naik
2016-03-25 11:47:40 +05:30
parent 4084f1fa97
commit 390eabe4b7
7 changed files with 215 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
name: mariadb-cluster
home: https://mariadb.org
source:
- https://github.com/bitnami/bitnami-docker-mariadb
version: 0.1.0
description: Chart to create a Highly available MariaDB cluster
maintainers:
- Bitnami <containers@bitnami.com>
details: |-
MariaDB is a fast, reliable, scalable, and easy to use open-source relational database system. MariaDB Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.

37
mariadb-cluster/README.md Normal file
View File

@@ -0,0 +1,37 @@
# MariaDB
> MariaDB is a fast, reliable, scalable, and easy to use open-source relational database system. MariaDB Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.
Based on the [Bitnami MariaDB](https://github.com/bitnami/bitnami-docker-mariadb) image for docker, this Chart bootstraps a [MariaDB](https://mariadb.com/) deployment on a [Kubernetes](http://kubernetes.io) cluster using [Helm](https://helm.sh).
## Persistence
For persistence of the MariaDB data, mount a [storage volume](http://kubernetes.io/docs/user-guide/volumes/) at the `/bitnami/mariadb/data` path of the MariaDB master pod.
By default the MariaDB Chart mounts an [emptyDir](http://kubernetes.io/docs/user-guide/volumes/#emptydir) volume.
## Configuration
To edit the default MariaDB configuration, run
```bash
$ helm edit mariadb-cluster
```
Configurable parameters can be specified in `tpl/values.toml`. If not specified default values as defined by the [Bitnami MariaDB](https://github.com/bitnami/bitnami-docker-mariadb) image are used.
> Tip: If you have issues running the above command, add `se autochdir` to your `~/.vimrc` profile or simply edit `~/.helm/workspace/charts/mariadb-cluster/tpl/values.toml` in your favourite editor.
Finally, generate the chart to apply your changes to the configuration.
```bash
$ helm generate mariadb-cluster
```
## Cleanup
To delete the MariaDB deployment completely:
```bash
$ helm uninstall -n default mariadb-cluster
```

View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: mariadb-master
labels:
provider: mariadb
mode: master
heritage: bitnami
spec:
ports:
- name: mysql
port: 3306
targetPort: mysql
selector:
provider: mariadb
mode: master

View File

@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: mariadb-slave
labels:
provider: mariadb
mode: slave
heritage: bitnami
spec:
ports:
- name: mysql
port: 3306
targetPort: mysql
selector:
provider: mariadb
mode: slave

View File

@@ -0,0 +1,68 @@
#helm:generate helm tpl -d tpl/values.toml -o manifests/mariadb-master-rc.yaml $HELM_GENERATE_FILE
apiVersion: v1
kind: ReplicationController
metadata:
name: mariadb-master
labels:
provider: mariadb
mode: master
heritage: bitnami
spec:
replicas: 1
selector:
provider: mariadb
mode: master
version: 5.5.48-0-r01
template:
metadata:
labels:
provider: mariadb
mode: master
version: 5.5.48-0-r01
heritage: bitnami
spec:
containers:
- name: mariadb
image: bitnami/mariadb:5.5.48-0-r01
args:
- --max_connect_errors=1000
env:
- name: MARIADB_USER
value: "{{.mariadbUser}}"
- name: MARIADB_PASSWORD
value: "{{.mariadbPassword}}"
- name: MARIADB_DATABASE
value: "{{.mariadbDatabase}}"
- name: MARIADB_REPLICATION_MODE
value: master
- name: MARIADB_REPLICATION_USER
value: "{{.mariadbReplicationUser}}"
- name: MARIADB_REPLICATION_PASSWORD
value: "{{.mariadbReplicationPassword}}"
ports:
- name: mysql
containerPort: 3306
livenessProbe:
exec:
command:
- mysqladmin
- ping
initialDelaySeconds: 60
timeoutSeconds: 5
readinessProbe:
exec:
command:
- mysqladmin
- ping
initialDelaySeconds: 5
timeoutSeconds: 1
volumeMounts:
- name: data
mountPath: /bitnami/mariadb/data
- name: conf
mountPath: /bitnami/mariadb/conf
volumes:
- name: data
emptyDir: {}
- name: conf
emptyDir: {}

View File

@@ -0,0 +1,63 @@
#helm:generate helm tpl -d tpl/values.toml -o manifests/mariadb-slave-rc.yaml $HELM_GENERATE_FILE
apiVersion: v1
kind: ReplicationController
metadata:
name: mariadb-slave
labels:
provider: mariadb
mode: slave
heritage: bitnami
spec:
replicas: 3
selector:
provider: mariadb
mode: slave
version: 5.5.48-0-r01
template:
metadata:
labels:
provider: mariadb
mode: slave
version: 5.5.48-0-r01
spec:
containers:
- name: mariadb
image: bitnami/mariadb:5.5.48-0-r01
args:
- --max_connect_errors=1000
env:
- name: MARIADB_USER
value: "{{.mariadbUser}}"
- name: MARIADB_PASSWORD
value: "{{.mariadbPassword}}"
- name: MARIADB_DATABASE
value: "{{.mariadbDatabase}}"
- name: MARIADB_REPLICATION_MODE
value: slave
- name: MARIADB_MASTER_HOST
value: mariadb-master
- name: MARIADB_MASTER_USER
value: "{{.mariadbUser}}"
- name: MARIADB_MASTER_PASSWORD
value: "{{.mariadbPassword}}"
- name: MARIADB_REPLICATION_USER
value: "{{.mariadbReplicationUser}}"
- name: MARIADB_REPLICATION_PASSWORD
value: "{{.mariadbReplicationPassword}}"
ports:
- name: mysql
containerPort: 3306
livenessProbe:
exec:
command:
- mysqladmin
- ping
initialDelaySeconds: 60
timeoutSeconds: 5
readinessProbe:
exec:
command:
- mysqladmin
- ping
initialDelaySeconds: 5
timeoutSeconds: 1

View File

@@ -0,0 +1,5 @@
mariadbUser = "my-user"
mariadbPassword = "my-password"
mariadbDatabase = "my-database"
mariadbReplicationUser = "replication-user"
mariadbReplicationPassword = "replication-password"