National Vocational Skills Competition Cloud Computing--Higher Vocational Group Competition Question Paper ④ (Container Cloud)

The second session topic: Container cloud platform deployment and operation and maintenance

Note: This task provides 4 servers master, node1, node2 and cicd-node, all of which are installed with the centos7.5 operating system. All files of the CentOS-7-x86_64-DVD-1804 system CD are available in the /opt/centos directory. , in the /opt/containerk8s directory, there are all the files required for this container cloud operation and maintenance.
The product development and launch cycle of a certain company's technology department is long, and customers' needs often cannot be responded to in a timely manner. The introduction of CICD (Continuous Integration, Continuous Delivery) has become a top priority for the company. The R&D team decided to build a CICD environment based on Kubernetes, hoping to implement part of the DevOps process based on this platform to reduce the burden of development, deployment, and operation and maintenance. .
In order to enable the web application system products developed by the company to be based on server performance, reliability, high availability and convenient maintenance, the R&D department decided to use a microservice architecture to implement containerized deployment based on Kubernetes.

Task 1 Docker CE and private warehouse installation task (5 points)

1. Install DockerCE and docker-compose in each node of master, node1, node2, and cicd-node respectively.
2. Install the Harbor private warehouse on the cicd-node node, import all images in the /opt/containerk8s/docker/images directory, and push them to the Harbor private warehouse.
3. Pull the mysql:latest and wordpress:latest images from the warehouse on the node1 node, create the /root/wproject/docker-compse.yaml file, orchestrate the deployment of wordpress, and set the restart policy.
4.Stop and delete the wordpress container deployed above on the node1 node.

Task 2 Container-based web application system deployment task (15 points)

The web application system Chinaskillmall developed by the company based on microservice architecture will be fully containerized (all software packages required for containerization of the web application system Chinaskillmall are in the /opt/containerk8s/Chinaskillmall directory). The Chinaskillmall application system architecture diagram is as follows:

Insert image description here

Insert image description here

Please containerize the Zookeeper component, redis component and Chinaskillmall front-end Nginx component as required. Other components have been containerized. Just pull the image from the warehouse and run the container (Chinaskillmall-mysql:v1.1, Chinaskillmall-Kafka:v1 .1. Chinaskillmall-jar:v1.1):
1. Write a Dockerfile to create a Redis image, generate an image named Chinaskillmall-Redis:v1.1, and push it to the private warehouse. The specific requirements are as follows:
(1) Based on the centos basic image;
(2) Specify the author as Chinaskill;
(3) Install the Redis service and expose the 6379 port;
(4) Set the service to start automatically.
2. Write a Dockerfile to create a Zookeeper image, generate an image named Chinaskillmall-Zookeeper:v1.1, and push it to the private warehouse. The specific requirements are as follows:
(1) Based on centos basic image;
(2) Specify the author as Chinaskill;
(3) Install the Zookeeper service and expose port 2181;
(4) Set the service to start automatically.
3. Write a Dockerfile to create an nginx image for the web application system. The generated image is named Chinaskillmall-nginx:v1.1 and pushed to the private warehouse. The specific requirements are as follows:
The mall website implements Chinaskillmall front-end containerization,
(1) based on centos basic image;
(2) designated author as Chinaskill;
(3) Install the nginx service, transfer the provided dest directory to the image, and copy the front-end files in the dest directory to the nginx working directory; (4)
Expose port 80;
(5) Set the service to start automatically.
4.Create the /root/Chinaskillmallproject/docker-compose.yaml file, and use the above image to orchestrate and deploy the Chinaskillmall application system.

Task 3 Container-based continuous integration deployment task (15 points)

The company decided to use GitLab + Jenkins to build a CICD environment to shorten the development and launch cycle of new functions, meet customer needs in a timely manner, implement part of the DevOps process to reduce the burden of deployment and operation, and visualize container life cycle management, application releases and versions For iterative updates, please complete the CICD environment deployment of GitLab + Jenkins:
1. Pull the gitlab:latest image from the private warehouse, create the /root/devops/docker-compose.yaml file, start the gitlab service, and enable the web browser to access the gitlab service normally.
2. Create a gitlab user (username: Chinaskill), create a gitlab project (project name: ChinaskillProject), and clone the project through SSH link.
3. Pull the Jenkins image from the private image warehouse, run and deploy the Jenkins container on the cicd-node node, and map the container's 8080 port to the host's 8080 port.
4.Create a new Jenkins task, configure Jenkins webhook, and push the image to the Harbor private warehouse.
5. Clone the ChinaskillProject project in the master node/root directory, modify the "Hello, word!" in the index.html file (/root/ChinaskillProject/templates/index.html) in the project to "Hello, ChinaSkill!", submit and Push code.

Task 4 Kubernetes container cloud platform deployment and operation (15 points, this task only announces the exam scope, not the competition questions)

The content of this task is: Kubernetes cluster environment construction and operation and maintenance, Kubernetes cluster-based application system deployment and operation and maintenance.

If you need the environment, you can send a private message to the blogger! ! !

Guess you like

Origin blog.csdn.net/Aluxian_/article/details/132969459