☁️A Practical Guide to Kubernetes Deployment with Huawei’s CCE and CodeArts

Ertugrul Basar
Huawei Developers
Published in
7 min readFeb 5, 2024
CodeArts

🔦Introduction

Hi everyone🙌! In this article, I will show you how to deploy a Kubernetes environment in Huawei’s Kubernetes platform CCE (Cloud Container Engine) while utilizing Huawei’s DevSecOps platform CodeArts. Throughout this process, we will purchase a CCE cluster, upload a YAML file to the CodeArts Repo, and finally, deploy pods using CodeArts Deploy. Therefore, it won’t be a demo that includes only one service. This work will not only serve as a guideline but may also assist you in adapting your business to the cloud.

Before we begin the demo, I want to overview CCE and CodeArts briefly.

1️⃣ CCE: Huawei Cloud CCE is essentially a cloud-based platform for running containerized applications. It helps you deploy and manage containerized apps efficiently and securely on Huawei’s cloud infrastructure.

2️⃣ CodeArts: CodeArts is a one-stop DevSecOps platform that provides out-of-the-box cloud services for requirement delivery, code commit, check, build, verification, deployment, and release throughout the entire software lifecycle. It consists of the following services: Req (Project Management), Repo (Code Hosting), Check (Code Quality), Build (Code Build), Artifact (Build Hosting), Deploy (Build Deployment), Pipeline (Continuous Delivery), TestPlan (Deployment Test).

💻Demo

Prerequisites for this demo

1️⃣ CCE Cluster: We need a cluster to which we will deploy our deployment. (The cluster MUST be in the same region as the CodeArts subscription)

After entering the CCE dashboard, click on “Buy” in the top-right corner of the page.

CCE Dashboard — 1

After that, we are going to create a cluster with the specifications below. Please wait a few minutes for the cluster creation. (You can adjust the maximum node value according to your specific needs.)

A Kubernetes cluster is like an orchestra for tiny programs called containers. It groups them together, schedules them on different machines, and makes sure they all play in harmony. This lets you run applications more efficiently, reliably, and at scale.

Cluster Specifications

Next, we need to create nodes so that the service we are going to deploy can run on them. Click on “Create Node” for this.

Nodes are like individual computers where these apps run, like different sections in an orchestra. More computers (nodes) mean your app can handle more work, like a bigger orchestra playing louder!

CCE Dashboard — 2

Then, we will create four nodes with the specifications below. This will be a straightforward task, so I will choose the minimum specifications available. (You can adjust the specifications according to your needs.)

Node Specifications

Finally, after waiting for a few minutes, the created nodes will be in the “Running” status, and our cluster is now ready for use!

Cluster Overview

2️⃣ CodeArts Subscription and Project: To access CodeArts services, you will need a subscription. However, there’s no need to worry about payment because we will be using the Basic Version, which is entirely free for up to 10 users!

CodeArts Pricing List

3️⃣ YAML file: We need a YAML file to apply to the cluster and initiate the deployment. You can refer to this link if you want to use the same file I will use.

A Kubernetes YAML file is like a recipe for your application in the Kubernetes world. It tells the “chef” (Kubernetes) exactly what ingredients (containers) you need, how to put them together (configure), and how many to make (replicas).

Here, we can start the demo, beginning with uploading the YAML file to the CodeArts Repo. To do that, we first need to create a repository. You can find the steps below 👇

CodeArts Repo Dashboard

We will not use a template or import a repository, so we can continue with the common option. Click ‘Next’ here.

CodeArts Repo Create — 1

We can name the repository here. Click on ‘OK’, and the repository will be created.

CodeArts Repo Create — 2

After the repository is created, we can now upload the YAML file that we will apply to the CCE cluster. Click on the “Create” button, as shown in the screenshot below 👇

CodeArts Repo — 1

After clicking on ‘Create,’ a new section will appear, and we will choose ‘Upload File’ from there. (I have created this YAML file on my computer, which is why I clicked on ‘Upload File.’ You can also click on ‘Create File’ and then copy the content from this link to the file.)

CodeArts Repo — 2

Next, I will choose the file I want to upload and click on OK.

CodeArts Repo — 3

After the upload process is complete, you can see the file as shown in the screenshot below. In the CodeArts Repo, you can also edit the files. So, if you need any changes to be made, you don’t need to upload the same file again.

CodeArts Repo — 4

Now, we can head over to CodeArts Deploy and create a task, as indicated by the button pointed below 👇

CodeArts Deploy Dashboard

Here we can name the task and then click on ‘Next’.

CodeArts Deploy Create — 1

Here there are some templates that you can use in your projects. I will choose ‘Kubernetes Manifest Deployment for CCE’. This template is enough and helps you to apply your YAML file to the cluster we have created before.

CodeArts Deploy Create — 2

After that, the task creation is done, and we can now choose “Repo” as a File Source, then select the repository we have created, and finally, we can specify the YAML File Path.

CodeArts Deploy Task — 1

Next, after the YAML file is selected, we are going to choose the cluster we have created before. This means that we need to select the Region, Cluster Name, and Namespace. After that, we can click on “Save & Deploy,” and the deployment process will start.

CodeArts Deploy Task — 2

After the deployment starts, a new page will appear, and on this page, you can see the logs in real time. In a few seconds, the deployment process will be finished successfully, and you can see it in the screenshot below 👇

CodeArts Deploy Task Logs

Now, the YAML file we have uploaded has been applied to the cluster, and we expect to see it on CCE. To do that, we can go to the ‘CCE Cluster Page > Workloads,’ and as you can see in the screenshot below, the nginx-deployment is deployed and running!

Cluster Workloads

👉Conclusion

In this article, we have successfully deployed a workload on a CCE cluster. Throughout this process, we purchased a cluster in CCE, created a project on CodeArts, uploaded a YAML file to a CodeArts Repo, and then applied the YAML file with CodeArts Deploy. Consequently, we can affirm that we have utilized several Huawei Cloud services in this practice. This article serves as a basic guideline for your business needs, and you can adapt this practice to your projects as well. Until the next article, goodbye.

💁References

--

--