This is a hands-on lab to introduce you to CCE and DevCloud on Huawei Cloud to build a DevSecOps Platform.
Jirayut Nimsaeng
Founder & CEO
Opsta (Thailand) Co., Ltd.
HUAWEI CONNECT 2022 Bangkok: Hands-on Lab
September 21, 2022
Streamlining Python Development: A Guide to a Modern Project Setup
Introduction of CCE and DevCloud
1. Author: Developer Support Team-Luoyangyang 00525118
(DTSE of Huawei Cloud)
Instructor: Jirayut Nimsaeng
HUAWEI CONNECT 2022 Bangkok: Hands-on Lab
September 21, 2022
Introduction of
CCE and DevCloud
https://bit.ly/opsta-huawei-hol-devcloud-cce-2022
2. Introduction of CCE and DevCloud
Instructor
Jirayut Nimsaeng (Dear)
Jirayut has been involved in DevSecOps, Container, Cloud Technology
and Open Source for over 10 years. He has experienced and
succeeded in transforming several companies to deliver greater
values and be more agile.
● He is Founder and CEO of Opsta (Thailand) Co.,Ltd.
● He is Cloud/DevSecOps Transformation Consultant and
Solution Architecture
● He is the first Certified Kubernetes Administrator (CKA) and
Certified Kubernetes Security Specialist (CKS) in Thailand
3. Introduction of CCE and DevCloud
Agenda
● Docker, Kubernetes and CCE
● Code repository and CI/CD
● DevCloud
● Workshop
5. Introduction of CCE and DevCloud
Prerequisite
1. https://bit.ly/opsta-huawei-hol-devcloud-cce-2022
2. Register Huawei Cloud Account
3. Activate Coupon
4. Apply Huawei Cloud Developer Forum
6. Introduction of CCE and DevCloud
Step to Become a Member of Huawei Cloud Developer Forum
1. Log in with your Huawei Cloud account and go
to the Huawei Cloud Developer Forum.
2. Agree to the Developer Forum Privacy Notice and Terms.
3. And then, begin to browse, write posts and reply in the Forum.
8. Introduction of CCE and DevCloud
What is Docker?
● Docker is a software platform.
● It supports rapid construction, test and deployment of application.
● Docker packages software into standardized units called Container, which
have all the features needed to run the software, including libraries, system
tools, code and runtime.
● With Docker, people can quickly deploy and scale applications upon any
environment.
● Docker containers are virtualized at the operating system level, with
resource isolation (CPU, memory, disk space) and isolation of process,
network and user id through Linux's cgroup and namespace, respectively.
10. Introduction of CCE and DevCloud
What is Kubernetes?
● Kubernetes, originated from google, is an open source system for scheduling
and orchestration of containerized applications.
● For application developers, kubernetes can be regarded as a cluster
operating system.
● Kubernetes provides functions such as service discovery, scaling, load
balancing, self-healing, and even leader election, freeing developers from
infrastructure-related configurations.
● When using Kubernetes, it's like you run a large number of servers as one on
which your applications run. Regardless of the number of servers in a
Kubernetes cluster, the method for deploying applications in Kubernetes is
always the same.
12. Introduction of CCE and DevCloud
What is Cloud Container Engine(CCE)?
● CCE provides highly scalable, high-performance, enterprise-class Kubernetes
clusters and supports Docker containers. With CCE, you can easily deploy,
manage, and scale containerized applications in the cloud.
● It supports heterogeneous computing architectures such as GPU, NPU, and Arm.
Supporting multi-AZ and multi-region disaster recovery, CCE ensures high
availability of Kubernetes clusters.
● Huawei Cloud is one of world's first Kubernetes Certified Service Providers
(KCSPs) and China's first participant in the Kubernetes community.
● Huawei Cloud is also a founder and platinum member of Cloud Native
Computing Foundation (CNCF).
● CCE is one of the world's container services to first pass the Certified Kubernetes
Conformance Program.
14. Introduction of CCE and DevCloud
What is Code repository?
● Code repository is an archive of code, documents, web pages, notes etc.
● Code repository supports committing of code, code rollback, code merge
and many other code version control functions.
● Code repository (private or public) is the must tool for any business
successful software project.
● Normally, using git as the basic command tool.
● Huawei Cloud provides a git-based online code repository, CodeHub, which
is a component of DevCloud.
16. Introduction of CCE and DevCloud
What is CI/CD?
● CI is the short for Continuous Integration, which means continuously
integrate any changes of the software into the main branch
● CD is the short for Continuous Delivery, which means reliable software can be
released at any time with simple and repeatable deployment.
● Pipeline integrates the CI and CD process, providing visualized, customizable
automatic delivery to shorten the delivery period and improve efficiency.
● Huawei Cloud’s product CloudPipeline provides a visualized and automated
task scheduling platform, which is one of DevCloud components.
17. Introduction of CCE and DevCloud
What is DevCloud?
● DevCloud is a one-stop, cloud-based DevOps platform that provides a bundle
of out-of-the-box cloud services covering requirement delivery, code commit,
code build, verification, deployment, and release.
● DevCloud consists of ProjectMan, CodeHub, CloudPipeline, CloudBuild,
CloudDeploy and CloudRelease.
● ProjectMan provides agile project management and collaboration, supports
management of sprints, milestones, and requirements across projects, tracks
bugs, and provides multi-dimensional statistics reports.
18. Introduction of CCE and DevCloud
What is DevCloud?
● CloudBuild provides an easy-to-use hybrid language build platform to implement
cloud-based build, and supports continuous and efficient delivery.
● With CloudBuild, you can create, configure, and run build tasks with a few clicks.
CloudBuild also supports automation of code retrieval, build, and packaging, as well as
real-time status monitoring.
● CloudDeploy provides visualized, one-click deployment. It supports deployment on VMs
or containers by using Tomcat, Spring Boot, and other templates or by flexibly
orchestrating atomic actions.
● CloudDeploy also supports parallel deployment and seamless integration with
CloudPipeline, providing standard deployment environments and implementing automatic
deployment.
● CloudRelease helps software development teams manage the software release process in
a standardized, visualized, and traceable way
34. Introduction of CCE and DevCloud
2.1.1 Create CodeHub Repository
1. Go to Code > CodeHub
2. Click on arrow next to Create Directly >
Use Template
35. Introduction of CCE and DevCloud
2.1.2 Create CodeHub Repository
1. Search for Java Web Demo and select it
2. Click Next
3. Repository Name: spring_web
37. Introduction of CCE and DevCloud
2.1.4 Create Dockerfile
1. Go to your spring_web repository
2. Click on plus sign next to spring_web repository name > Create File
38. Introduction of CCE and DevCloud
2.1.5 Dockerfile Content
# This is the jdk base image in the SWR devcloud_test_luoyangyang repository
# The image would be uploaded to the destination by following later CloudBuild step
FROM swr.ap-southeast-3.myhuaweicloud.com/[YOUR_UNIQUE_ORG_NAME]/java:openjdk-8-jdk-alpine
# Copy the jar to the docker container inside
# The jar would be created by following later CloudBuild step
COPY ./target/demoapp.jar demoapp.jar
# Run the java -jar demoapp.jar command when the image instanced was created
ENTRYPOINT ["java", "-jar", "demoapp.jar"]
39. Introduction of CCE and DevCloud
2.1.6 Commit Dockerfile
● Create File: Dockerfile
● Put the content of Dockerfile
40. Introduction of CCE and DevCloud
2.1.7 devcloud-demo-deployment.yaml Content
kind: Deployment
apiVersion: apps/v1
metadata:
name: devcloud-demo
namespace: default
labels:
appgroup: ''
# Use the pipeline parameter versionTag, which would be explained in later CloudPipeline step
version: {{versionTag}}
spec:
# The number of replicas of the pod
replicas: 1
selector:
matchLabels:
app: devcloud-demo
template:
metadata:
creationTimestamp: null
labels:
app: devcloud-demo
annotations:
metrics.alpha.kubernetes.io/custom-endpoints: '[{"api":"","path":"","port":"","names":""}]'
spec:
containers:
- name: container-0
image: 'swr.ap-southeast-3.myhuaweicloud.com/[YOUR_UNIQUE_ORG_NAME]/spring_web:{{versionTag}}'
resources:
requests:
cpu: 250m
memory: 512Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
securityContext: {}
imagePullSecrets:
- name: default-secret
affinity: {}
schedulerName: default-scheduler
tolerations:
- key: node.kubernetes.io/not-ready
operator: Exists
effect: NoExecute
tolerationSeconds: 300
- key: node.kubernetes.io/unreachable
operator: Exists
effect: NoExecute
tolerationSeconds: 300
dnsConfig:
options:
- name: timeout
value: ''
- name: ndots
value: '5'
- name: single-request-reopen
strategy:
type: Recreate
revisionHistoryLimit: 10
progressDeadlineSeconds: 600