☁️Creating a MySQL Container in Huawei Cloud w/ Cloud Container Engine

10 min read
Cloud ComputingMySQLDockerHuawei Cloud

☁️Creating a MySQL Container in Huawei Cloud w/ Cloud Container Engine

Introduction

Hi everyone!

In this article I will explain in general what the Cloud Container Engine is, how it works and how you can set up a mysql using it.

I wish good readings to everyone. I would like to start this article with the question, "What is CCE?". CCE is a one-stop platform integrating compute (ECS or BMS), networking (VPC, EIP, and ELB), storage (EVS, OBS, and SFS), and many other services. It supports heterogeneous computing architectures such as GPU, NPU, and Arm. Multi-AZ, multi-region disaster recovery ensures high availability of Kubernetes clusters.

Cloud Container Engine(CCE) has so many product advantages.

Now that you have general information about CCE, we can focus on how to get CCE and how to install mysql on a cce.

Demo of Cloud Container Engine(CCE)

Step 1: Enable CCE for the First Time and Perform Authorization

If you are opening the CCE Console for the first time from the top left of the page, you must accept the incoming agreement.

Step 2: Create a Cluster

On the page that opens, you need to click on the Buy Cluster button. In the window that opens, you can create it by filling in the necessary parameters as in the picture.

Step 3: Create a Node Pool and Nodes in the Cluster

At this stage, we will create a node pool and nodes in the cluster. From the Nodes tab, you need to select Node Pools and then create node pool. Then you will be able to see it like the picture below.

If you have properly selected the properties of the node, you can now submit. After that, you can press the scaling button as below and select the number 1 on the screen that opens.

After these steps, you just need to wait 10 minutes and your node on which you will install mysql is ready.

Step 4: Deploy MySQL

At this stage, there are two different paths. One is the operations that can be done with kubectl. The other can be done via CCE Console. I will do it through CCE Console.

In which CCE you want to install it, you need to click on it and enter its settings. After that, you need to click on the Workloads section and enter its settings.

Click on Create Workload and select the stateful option from the options above as shown below and fill in the other settings as shown in the pictures.

Once you have made these settings, you can move on to the container settings, which are very important for a mysql statefulset.

If you can't select mysql here, you may need to throw it from your own docker screen.

After making the necessary environment variables settings, we create and add an Elastic Volume Service (EVS).

After adding it, we also make the necessary headless settings so that we can access it directly with the ip given in the headless.

If you have done everything correctly, the mysql statefulset should be running as below. If you see something else, you may have done a step wrong.

Conclusion😊

In this article, I showed you how you can create a CCE and a Node using Cloud Container Engine (CCE). I also showed you how you can install mysql container with statefulset on the Node.

Now you have seen how you can install mysql on CCE in general. I hope this article was useful for you. See you in my other articles 😊