# Installing MariaDB on IBM Cloud

Get MariaDB on IBM Cloud

You should have an IBM Cloud account, otherwise you can [register here](https://cloud.ibm.com/registration).\
At the end of the tutorial you will have a cluster with MariaDB up and running. IBM Cloud uses Bitnami charts to deploy MariaDB on with helm

1. We will provision a new Kubernetes Cluster for you if, you already have one skip to step **2**
2. We will deploy the IBM Cloud Block Storage plug-in, if already have it skip to step **3**
3. MariaDB deployment

## Step 1 provision Kubernetes Cluster

1. Click the Catalog button on the top.
2. Select Service from the catalog.
3. Search for Kubernetes Service and click on it.

![kubernetes-select](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-eb23bf92403167d363ac90b1bc6d57efdca4a0b0%2Fkubernetes-select.png?alt=media)

4. Choose a plan: standard or free.

{% hint style="info" %}
The free plan includes one worker node and no subnet.
{% endhint %}

5. To provision a standard cluster, upgrade your account to Pay-As-You-Go.
6. To upgrade to a Pay-As-You-Go account, follow these steps:
   1. In the console, go to **Manage > Account**.
   2. Select **Account settings**, and click **Add credit card**.
   3. Enter your payment information, click **Next**, and submit your information.
7. Choose between classic or VPC after reviewing the documentation to determine the most suitable option.

![infra-select](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-bd7f3ec42d2ab2b58059a485e5e66f2b8a6402a3%2Finfra-select.png?alt=media)

8. Now choose your location settings, for more information please visit [Locations](https://cloud.ibm.com/docs/containers?topic=containers-regions-and-zones#zones)
9. Choose **Geography** (continent)

![location-geo](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-a9541ccebe7f57dd7d0ca1bc10582add8d3a6cf1%2Flocation-geo.png?alt=media)

10. Select either **Single-Zone** or **Multi-Zone** storage. Single Zone stores your data in one data center, while Multi-Zone distributes your data across multiple zones, offering greater safety in the event of unexpected zone failures.

![location-avail](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-3530bcccc77ed7e743018c559bbf47ade3f82941%2Flocation-avail.png?alt=media)

11. Choose a **Worker Zone** if using Single zones or Metro if Multizone

![location-worker](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-1af04b9fa0fa9aa6ecea34e7215f8ca4d742becf%2Flocation-worker.png?alt=media)

12. Set up your account with VRF or enable VLAN spanning to use Multizone.
13. If no Virtual LAN is available at your selected location, a new VLAN will be created for you.
14. Choose a Worker node setup or use the preselected one.
15. Set the **Worker node per zone**.

![worker-pool](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-3af0f13e70486383b35dd9bc944f0e00c95fdc35%2Fworker-pool.png?alt=media)

16. Choose Master Service Endpoint, In VRF-enabled accounts, you can choose **Private endpoint only** to make your master accessible on the private network or via VPN tunnel. Choose **Public endpoint only** to make your master publicly accessible. When you have a VRF-enabled account, your cluster is set up by default to use **Both private and public endpoints**. For more information visit [endpoints](https://cloud.ibm.com/docs/account?topic=account-service-endpoints-overview).

![endpoints](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-ff2c6e37439140fae6f1149fe0d2a3b3e553d012%2Fendpoints.png?alt=media)

17. Give **Cluster name**

![name-new](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-6ef8db3478945532a012e7a3923c7c16a5426e0d%2Fname-new.png?alt=media)

18. Give desired **Tags** to your cluster, for more information visit [tags](https://cloud.ibm.com/docs/account?topic=account-tag)

![tasg-new](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-18086098c8298df0ceabac22238b67e3bc18ea40%2Ftasg-new.png?alt=media)

19. Click **Create**

![create-new](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-b4fa6b7827653b1490de5b8e8e9ebe50f121e7f2%2Fcreate-new.png?alt=media)

20. Wait for you cluster to be provisioned

![cluster-prepare](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-a334f2d9a3f3696ea35edf2fdb53624773d16290%2Fcluster-prepare.png?alt=media)

21. Your cluster is ready for usage

![cluster-done](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-d85d69d086adebe8fc4560d08b0936927989b30c%2Fcluster-done.png?alt=media)

## Step 2 deploy IBM Cloud Block Storage plug-in

The Block Storage plug-in is a persistent, high-performance iSCSI storage that you can add to your apps by using Kubernetes Persistent Volumes (PVs).

1. Click the **Catalog** button on the top
2. Select **Software** from the catalog
3. Search for _IBM Cloud Block Storage plug-in_ and click on it

![block-search](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-47da6ddc421a6e45fe3de94dcd423381250888f2%2Fblock-search.png?alt=media)

4. On the application page, select the cluster you wish to use
5. Click on **Enter or select namespace** and choose the default Namespace or use a custom one (if you get error please wait 30 minutes for the cluster to finalize)

![block-cluster](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-5e49254c9baa6bef1b86c2011c681b261a2a01e6%2Fblock-cluster.png?alt=media)

6. Give a **Name** to this workspace
7. Click **Install** and wait for the deployment

![block-storage-create](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-6d8bca35e21f163a8f58e13539c6f1eb5c1d692c%2Fblock-storage-create.png?alt=media)

## Step 3 deploy MariaDB

We will deploy MariaDB on our cluster

1. Click the **Catalog** button on the top
2. Select **Software** from the catalog
3. Search for _MariaDB_ and click on it

![search](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-beca2feed27c5f8c36f0563791d6091cd2c88f3e%2Fsearch.png?alt=media)

4. Please select **IBM Kubernetes Service**

![target-select](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-29ecfdadd9a667f0edaedfcf5d443b9a35a423e5%2Ftarget-select.png?alt=media)

5. On the application page, select the cluster you wish to use

![cluster-select](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-57847bf4fb327bc5b89f9c9334447d758460e3a2%2Fcluster-select.png?alt=media)

6. Click on **Enter or select namespace** and choose the default Namespace or use a custom one

![details-namespace](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-7334ece69fa51a62e8b0c2ed3b6e0b5e10496d1b%2Fdetails-namespace.png?alt=media)

7. Give a unique name to workspace, which you can easily recognize

![details-name](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-0efbf9edadc5aa646825dd3823b9290bc0273185%2Fdetails-name.png?alt=media)

8. Select which **Resource Group** you want to use, it's for access controll and billing purposes. For more information please visit [resource groups](https://cloud.ibm.com/docs/account?topic=account-account_setup#bp_resourcegroups)

![details-resource](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-36f65fc61bb40694e419666df4cc6530a908e728%2Fdetails-resource.png?alt=media)

9. Give **Tags** to your MariaDB, for more information visit [tags](https://cloud.ibm.com/docs/account?topic=account-tag)

![details-tags](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-6a6da83f34c59c97bb2745a591725b887a12607c%2Fdetails-tags.png?alt=media)

10. Click on **Parameters with default values**, You can set deployment values or use the default ones

![parameters](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-ffcfb7e87f5212a2d38ed3468b0153dc04def82f%2Fparameters.png?alt=media)

11. Please set the MariaDB root password in the parameters

![root-password](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-de4142963f9009eef368b157998b3cfa2f48c672%2Froot-password.png?alt=media)

12. After finishing everything, tick the box next to the agreements and click **Install**

![aggreement-create](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-9e0e7d6c9fb48d62f5e9ec13376c703225fcd070%2Faggreement-create.png?alt=media)

13. The MariaDB workspace will start installing, wait a couple of minutes

![in-progress](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-20695f4e38d53db29a6c59a2d71f888c24eb1ce0%2Fin-progress.png?alt=media)

14. Your MariaDB workspace has been successfully deployed

![done](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-2a221d48b98515d88897bb93dec56ec0383aa95e%2Fdone.png?alt=media)

## Verify MariaDB installation

1. Go to [Resources](https://cloud.ibm.com/resources) in your browser
2. Expand **Clusters.** Click on your cluster

![resource-select](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-9bc11fe925cf657a9c4b83e6643a145b72758fbe%2Fresource-select.png?alt=media)

3. On the **Overview** page, click **Actions**, then select **Web Terminal** from the dropdown menu.

![cluster-main](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-1dc41a05a5863926164571b94971c410d77e159b%2Fcluster-main.png?alt=media)

4. Click Install and wait for sometime
5. Click on Actions
6. Click Web terminal. A terminal window will open up
7. On the terminal window, please change NAMESPACE to the namespace you choose at the deployment setup:

```bash
$ kubectl get ns
```

![get-ns](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-a5fd64f842ff210e7082359123aab2ec9f00f018%2Fget-ns.png?alt=media)

```bash
$ kubectl get pod -n NAMESPACE -o wide
```

![get-pods](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-7ecf3164500e4a122008791f77fc85d97430c447%2Fget-pods.png?alt=media)

```bash
$ kubectl get service -n NAMESPACE
```

![get-service](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-c72d4f70d38d40dd8a6455bf494fe5e6ea318495%2Fget-service.png?alt=media)

8. Enter your pod with bash , please replace PODNAME with your mariadb pod's name

```bash
$ kubectl exec --stdin --tty PODNAME -n NAMESPACE -- /bin/bash
```

![bash](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-05b520796d54f19d0f994f0570cbbeb25ff0a184%2Fbash.png?alt=media)

9. After you are in your pod please enter Mariadb and enter your root password after the prompt

```bash
$ mysql -u root -p
```

![welcome](https://2988006611-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSsmexDFPv2xG2OTyO5yV%2Fuploads%2Fgit-blob-a4879841d18704cafd3d46af0adbdac2dfa28e68%2Fwelcome.png?alt=media)

You have successfully deployed MariaDB IBM Cloud!

<sub>_This page is licensed: CC BY-SA / Gnu FDL_</sub>

{% @marketo/form formId="4316" %}
