mirror of
https://github.com/bitnami/charts.git
synced 2026-03-08 08:47:24 +08:00
charts: add mariadb-cluster chart
This commit is contained in:
10
mariadb-cluster/Chart.yaml
Normal file
10
mariadb-cluster/Chart.yaml
Normal 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
37
mariadb-cluster/README.md
Normal 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
|
||||
```
|
||||
16
mariadb-cluster/manifests/mariadb-master-svc.yaml
Normal file
16
mariadb-cluster/manifests/mariadb-master-svc.yaml
Normal 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
|
||||
16
mariadb-cluster/manifests/mariadb-slave-svc.yaml
Normal file
16
mariadb-cluster/manifests/mariadb-slave-svc.yaml
Normal 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
|
||||
68
mariadb-cluster/tpl/mariadb-master-rc.yaml
Normal file
68
mariadb-cluster/tpl/mariadb-master-rc.yaml
Normal 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: {}
|
||||
63
mariadb-cluster/tpl/mariadb-slave-rc.yaml
Normal file
63
mariadb-cluster/tpl/mariadb-slave-rc.yaml
Normal 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
|
||||
5
mariadb-cluster/tpl/values.toml
Normal file
5
mariadb-cluster/tpl/values.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
mariadbUser = "my-user"
|
||||
mariadbPassword = "my-password"
|
||||
mariadbDatabase = "my-database"
|
||||
mariadbReplicationUser = "replication-user"
|
||||
mariadbReplicationPassword = "replication-password"
|
||||
Reference in New Issue
Block a user