Deploy MySQL on KubeSphere
This tutorial walks you through an example of deploying MySQL from the App Store of KubeSphere.
- Please make sure you enable the OpenPitrix system.
Hands-on Lab
On the Overview page of the project , click App Store in the top left corner.
Find MySQL and click Deploy on the App Info page.
Set a name and select an app version. Make sure MySQL is deployed in
demo-project
and click Next.In App Config, uncomment the field and customize the password. Click Deploy to continue.
-
Go to Workloads and click the service name of MySQL.
In the terminal, execute
mysql -uroot -ptesting
to log in to MySQL as the root user.
To access MySQL outside the cluster, you need to expose the app through a NodePort first.
Go to Services and click the service name of MySQL.
-
Select NodePort for Access Method and click OK. For more information, see Project Gateway.
Under Service Ports, you can see the port is exposed. The port and public IP will be used in the next step to access the MySQL database.
To access your MySQL database, you need to use the MySQL client or install a third-party application such as SQLPro Studio for the connection. The following example demonstrates how to access the MySQL database through SQLPro Studio.
Note
You may need to open the port in your security groups and configure related port forwarding rules depending on your where your Kubernetes cluster is deployed.