CS Launch MariaDB: Difference between revisions
No edit summary |
No edit summary |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 32: | Line 32: | ||
** <code>MARIADB_PASSWORD</code> = <code>Insecure</code> | ** <code>MARIADB_PASSWORD</code> = <code>Insecure</code> | ||
* '''Click on the ''Create'' button''' | * '''Click on the ''Create'' button''' | ||
[[File:launch-mariadb-secret.png]] | |||
== Create Custom Configurations == | == Create Custom Configurations == | ||
| Line 47: | Line 48: | ||
</pre> | </pre> | ||
* '''Click on the ''Create'' button''' | * '''Click on the ''Create'' button''' | ||
[[File:launch-mariadb-config.png]] | |||
== Create the Deployment == | == Create the Deployment == | ||
| Line 63: | Line 65: | ||
* Select <code>Secret</code> from the '''Type''' drop down list | * Select <code>Secret</code> from the '''Type''' drop down list | ||
* Select <code>mariadb-secret</code> from the '''Secret''' drop down list | * Select <code>mariadb-secret</code> from the '''Secret''' drop down list | ||
[[File:launch-mariadb-deployment.png]] | |||
* Click on the '''Deployment''' tab | * Click on the '''Deployment''' tab | ||
* Click on '''Scaling and Upgrade Policy''' under the '''Deployment''' tab | * Click on '''Scaling and Upgrade Policy''' under the '''Deployment''' tab | ||
* Select '''Recreate: kill ALL pods, then start new pods''' checkbox | * Select '''Recreate: kill ALL pods, then start new pods''' checkbox | ||
** This tells the cluster to remove pods before restarting because multiple pods can not mount the PVC | ** This tells the cluster to remove pods before restarting because multiple pods can not mount the PVC | ||
[[File:launch-mariadb-upgrade.png]] | |||
* Click on the '''Pod''' tab | * Click on the '''Pod''' tab | ||
* Click on '''Storage''' under the '''Pod''' tab | * Click on '''Storage''' under the '''Pod''' tab | ||
| Line 75: | Line 79: | ||
* Change '''VolumeName''' to <code>data</code> | * Change '''VolumeName''' to <code>data</code> | ||
* Select <code>mariadb-pvc</code> from the '''Persistent Volume Claim''' drop down list | * Select <code>mariadb-pvc</code> from the '''Persistent Volume Claim''' drop down list | ||
[[File:launch-mariadb-storage.png]] | |||
* Click on '''container-0''' tab | * Click on '''container-0''' tab | ||
* Click on '''Storage''' under the '''container-0''' tab | * Click on '''Storage''' under the '''container-0''' tab | ||
| Line 81: | Line 86: | ||
* Select <code>data</code> from the '''Select Volume''' drop down list | * Select <code>data</code> from the '''Select Volume''' drop down list | ||
* Fill in '''Mount Point''' with <code>/var/lib/mysql</code> | * Fill in '''Mount Point''' with <code>/var/lib/mysql</code> | ||
[[File:launch-mariadb-mount.png]] | |||
* Click on '''Health Check''' under the '''container-0''' tab | * Click on '''Health Check''' under the '''container-0''' tab | ||
* Select '''Command run inside the container exits with status 0''' from the '''Type''' drop down list under '''Readiness Check''' | * Select '''Command run inside the container exits with status 0''' from the '''Type''' drop down list under '''Readiness Check''' | ||
| Line 95: | Line 101: | ||
* Fill in '''Command to run''' with <code>bash -c 'healthcheck.sh --connect --innodb_initialized'</code> | * Fill in '''Command to run''' with <code>bash -c 'healthcheck.sh --connect --innodb_initialized'</code> | ||
* Change '''Failure Threshold''' to <code>30</code> | * Change '''Failure Threshold''' to <code>30</code> | ||
[[File:launch-mariadb-health.png]] | |||
* Finally, click on the '''Create''' button to start your deployment | * Finally, click on the '''Create''' button to start your deployment | ||
== Updates == | |||
Version updates to your manual deployment will have to be made manually. If you use the '''lts''' tag <code>mariadb:lts</code> then anytime the pod is restarted then the newest version of the long term support image is pulled and ran. If you a specific a version number tag, then you will need to manually change the version number to update. | |||
== Accessing == | |||
* By design, access to your database workload is limited to the internal network between your other workloads | |||
* You can access the database through the command prompt on the running database pod | |||
* You can create another workload with a database client installed | |||
* You can use a web based database client and create an ingress to access it from external hosts. See: [[HowTo:CS_Launch#Launch_an_App_Using_a_Public_Image]] | |||
Latest revision as of 08:02, 28 October 2025
Introduction
Instructions for deploying a simple MariaDB database service on CS Launch using Docker official images: https://hub.docker.com/u/library
Create Project and Namespace
You will need a project and namespace on CS Launch to deploy your database. See HowTo:CS_Launch for instructions on doing this.
Create Persistence Storage
Your database will need a Persistent Volume Claim to store the data so that it is not lost between restarts.
- Navigate to your Cluster Dashboard
- Click on Storage from the menu on the left
- Click on PersistentVolumeClaims underneath Storage
- Click on the Create button
- Fill in Name with a namespace unique name, example:
mariadb-pvc - Change Request Storage to the size of your storage requirements, example:
1 GiB - Click on the Create button
Create Passwords Secret
A secret is a secure way to store your deployments password information.
- Navigate to your Cluster Dashboard
- Click on Storage from the menu on the left
- Click on Secrets underneath Storage
- Click on the Create button
- Select the Opaque tile as this type of secret is suited for storing passwords
- Fill in Name with namespace unique name, example:
mariadb-secret - Fill in Key with
MARIADB_ROOT_PASSWORD - Fill in Value with what you want to use as the root password, for example:
ChangeMe - Fill in additional Keys:
MARIADB_DATABASE=test-dbMARIADB_USER=testMARIADB_PASSWORD=Insecure
- Click on the Create button
Create Custom Configurations
You can use a ConfigMap to storage custom configuration options.
- Navigate to your Cluster Dashboard
- Click on Storage from the menu on the left
- Click on ConfigMaps underneath Storage
- Click on the Create button
- Fill in Name with namespace unique name, example:
mariadb-config - Fill in Key with
my.cnf - Fill in Value with your custom configuration options:
[mariadb] ### Put custom mariadb configurations here
- Click on the Create button
Create the Deployment
Now you have all the components created, you can create the deployment itself. We will create it as a "Deployment" to make it easier. You can create as a StatefulSet to get a consistent pod name, but it is more work set up initially.
- Navigate to your Cluster Dashboard
- Click on Workloads from the menu on the left
- Click on Deployments underneath Workloads
- Click on the Create button
- Fill in Name with the hostname you want other workloads to access the service by, example:
mariadb - Fill in Container Image with the version of mariadb docker image you want, example:
mariadb:ltsor use a specific version that you want - Click on Add Port or Service button
- Select
Cluster IPfrom the Service Type drop down list - Fill in service Name with a port name example:
mariadb - Fill in Private Container Port with the database port:
3306 - Click on Add Variable under Environment Variables
- Select
Secretfrom the Type drop down list - Select
mariadb-secretfrom the Secret drop down list
- Click on the Deployment tab
- Click on Scaling and Upgrade Policy under the Deployment tab
- Select Recreate: kill ALL pods, then start new pods checkbox
- This tells the cluster to remove pods before restarting because multiple pods can not mount the PVC
- Click on the Pod tab
- Click on Storage under the Pod tab
- Select ConfigMap from the Add Volume drop down list
- Change VolumeName to
configuration - Select
mariadb-configunder the ConfigMap drop down list - Select Persistent Volume Claim from the Add Volume drop down list
- Change VolumeName to
data - Select
mariadb-pvcfrom the Persistent Volume Claim drop down list
- Click on container-0 tab
- Click on Storage under the container-0 tab
- Select
configurationfrom the Select Volume drop down list - Fill in Mount Point with
/etc/mysql/conf.d - Select
datafrom the Select Volume drop down list - Fill in Mount Point with
/var/lib/mysql
- Click on Health Check under the container-0 tab
- Select Command run inside the container exits with status 0 from the Type drop down list under Readiness Check
- Change Initial Delay to
30 Sec. - Change Timeout to
5 Sec. - Fill in Command to run with
bash -c 'healthcheck.sh --connect --innodb_initialized' - Select Command run inside the container exists with status 0 from the Type drop down list under Liveness Check
- Change Initial Delay to
120 Sec. - Change Timeout to
5 Sec. - Fill in Command to run with
bash -c 'healthcheck.sh --connect --innodb_initialized' - Select Command run inside the container exists with status 0 from the Type drop down list under Startup Check
- Change Initial Delay to
10 Sec. - Change Timeout to
5 Sec. - Fill in Command to run with
bash -c 'healthcheck.sh --connect --innodb_initialized' - Change Failure Threshold to
30
- Finally, click on the Create button to start your deployment
Updates
Version updates to your manual deployment will have to be made manually. If you use the lts tag mariadb:lts then anytime the pod is restarted then the newest version of the long term support image is pulled and ran. If you a specific a version number tag, then you will need to manually change the version number to update.
Accessing
- By design, access to your database workload is limited to the internal network between your other workloads
- You can access the database through the command prompt on the running database pod
- You can create another workload with a database client installed
- You can use a web based database client and create an ingress to access it from external hosts. See: HowTo:CS_Launch#Launch_an_App_Using_a_Public_Image






