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 owncloud:latest images from the warehouse on the node1 node, create the /root/wproject/docker-compse.yaml file, arrange and deploy owncloud, and set the restart policy.
4.Stop and delete the owncloud 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 mysql database component, Chinaskillmall front-end nginx component and Chinaskillmall business backend as required. Other components have been containerized. Just pull the image from the warehouse and run the container (Chinaskillmall-Redis:v1.1, Chinaskillmall-Zookeeper :v1.1, Chinaskillmall-Kafka:v1.1):
1. Write a Dockerfile to create a database MySQL image, generate an image named Chinaskillmall-mysql: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 mariadb database and use the root user to initialize the database; set the database to support UTF-8 encoding; set the root user's password to 123456, and grant remote access permission to the root user;
(4) Create the database Chinaskillmall and use the Chinaskillmall database, import Chinaskillmalldb.sql;
(5) Open port 3306;
(6) Set the service to start automatically.
2. Write a Dockerfile to create an nginx image for the web application system, generate an image named Chinaskillmall-nginx: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 nginx service, transfer the provided dest directory to the image, and copy the front-end files in the dest directory to nginx work Directory;
(4) Expose port 80;
(5) Set the service to start automatically.
3. Write a Dockerfile to create a back-end service image for the web application system. The generated image is named Chinaskillmall-jar:v1.1 and pushed to the private warehouse. The specific requirements are as follows:
(1) Use the CentOS base image;
(2) Specify the author as Chinaskill;
(3) Install the java JDK environment and transfer the provided jar package to the image;
(5) Write the startup script and set the script 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 + Gitlab-runner to build a CICD environment to shorten the development and launch cycle of new functions, meet customer needs in a timely manner, realize part of the DevOps process, reduce the burden of deployment and operation, and visualize container life cycle management and application release. and version iterative updates, please complete the CICD environment deployment of GitLab + Gitlab-runner:
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 gitlab-runner image from the private image warehouse and run the gitlab-runner container on the cicd-node node.
4.Complete the configuration of gitlab-runner, write gitlab-ci.yaml, register the runner, 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.

Need to send private messages to bloggers about the environment! !

おすすめ

転載: blog.csdn.net/Aluxian_/article/details/132966032