---
title: Charmhub | Deploy MariaDB using Charmhub - The Open Operator Collection
description: Deploy the latest version of MariaDB as a Kubernetes Operator on any
  cloud.
url: https://charmhub.io/charmed-osm-mariadb-k8s/docs/contributing-hacking
---

# MariaDB

[Charmed Distribution of OSM](https://charmhub.io/publisher/charmed-osm "View all packages from Charmed Distribution of OSM")

* [Charmed Distribution of OSM](https://charmhub.io/publisher/charmed-osm "View all packages from Charmed Distribution of OSM")
* [Cloud](https://charmhub.io/?filter=cloud)
* [Databases](https://charmhub.io/?filter=databases)

Platform:

stable 35

```
juju deploy charmed-osm-mariadb-k8s
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

#### Relevant links

* [Homepage](https://osm.etsi.org/gitweb/?p=osm/devops.git)

---

#### Contacts

##### Maintainers

+ [OSM Charmers](mailto:osm-charmers@lists.launchpad.net)

* [Submit a bug](https://osm.etsi.org/bugzilla/enter_bug.cgi?product=OSM)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

For any problems with this charm, please [report bugs here](https://osm.etsi.org/bugzilla/enter_bug.cgi?product=OSM).

The code for this charm can be downloaded as follows:

```
git clone "https://osm.etsi.org/gerrit/osm/devops"
cd devops/installers/charm/mariadb-k8s/
```

## Setting up the environment

In order to deploy the mariadb charm, it is necessary to have a Juju controller deployed in K8s. The easiest way to achieve that is by installing Microk8s and bootstrapping a controller on top.

```
# Install Juju and Microk8s snaps
sudo snap install juju --classic
sudo snap install microk8s --classic
# Setting up permissions
sudo usermod -a -G microk8s `whoami`
sudo chown -f -R `whoami` ~/.kube
newgrp microk8s
# Wait for Microk8s to be ready
microk8s.status --wait-ready
# Enable storage and dns addons and bootstrap a controller
microk8s.enable storage dns
juju bootstrap microk8s
```

## Deployment

From the store:

```
juju deploy cs:~charmed-osm/mariadb-k8s
```

Locally:

```
tox -e build
juju deploy ./release
```

## Testing

The tests of this charm are done using tox and Zaza.

### Prepare environment

```
sudo apt install tox -y
```

If /usr/bin/python does not exist, you should probably need to do this:

```
sudo ln -s /usr/bin/python3 /usr/bin/python
```

### Integration tests

For executing the integration tests, it is necessary to build the charm beforehand with `tox -e build`

Run integration tests:

```
tox -e func
```

---
