A method and device for deploying k8s container applications

By building a k8s cluster on the host server and creating application-type container applications in the control-type k8s container application, the repeated operation problem when deploying multiple container applications is solved, efficient deployment and operation simplification is achieved, and error rate is reduced.

CN113032104BActive Publication Date: 2024-12-20GUANGZHOU HUANWANG TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110416722.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-19
Publication Date
2024-12-20
Estimated Expiration
2041-04-19

AI Technical Summary

Technical Problem

The prior art requires repeated operations when deploying multiple container applications, resulting in inefficiency and high error rates.

Method used

By building an operating environment on the host server, deploying control-type k8s container applications based on the k8s cluster, and creating and deploying application-type k8s container applications in the control-type container application, simplifying the deployment steps, and all application-level operations are executed in the control-type container , realize the one-click online and offline application-oriented applications.

Benefits of technology

Simplifies the steps to deploy multiple container applications, reduces host operations, improves deployment efficiency and reduces error rates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113032104B_ABST
    Figure CN113032104B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and device for deploying a k8s container application, the method comprising: building a running environment on a host server; deploying a control-type k8s container application based on a k8s cluster; creating an application-type k8s container application in the control-type k8s container application; and implementing the deployment of the application-type k8s container application in the control-type k8s container application. The technical solution provided by the present application can not only simplify the deployment steps when deploying multiple container applications, but also liberate the operations on the host machine, so that all application layer operations are executed in the control-type k8s container, and the online and offline operations of the application-type application can be performed with one key, thereby reducing the error rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of container applications, and in particular relates to a method and device for deploying a k8s container application. Background Art

[0002] Traditional deployment of projects may involve a scenario where developers submit code from the development environment to the test environment and then to a higher-level environment. For example, developers write application code on Windows, but the upper-level environment (test, stage, or production environment) is based on Linux. In this case, when the operating system changes, some functions of the application may have problems. Therefore, generally when the supporting software environment is different, the probability of intermittent failures will be greater.

[0003] The emergence of containers solves this problem. Containers encapsulate all the relevant details necessary to run an application, such as application dependencies and operating systems. This makes it more flexible to port images from one environment to another. For example, the same image can run in Windows or Linux or in development, test, or stage environments.

[0004] There are many ways to deploy container applications. For example, deploying applications based on Docker: When using Docker to deploy applications, developers can package their applications and dependencies into a container and publish them to the popular Linux system. However, Docker has its own shortcomings. When deploying multiple container applications, repeated operations are required. Summary of the invention

[0005] In view of this, the purpose of the present invention is to overcome the shortcomings of the prior art and provide a method and device for deploying k8s container applications to solve the problem of repeated operations required when deploying multiple container applications in the prior art.

[0006] According to a first aspect of an embodiment of the present application, a method for deploying a k8s container application is provided, the method comprising:

[0007] Build the operating environment on the host server;

[0008] Deploy control-type k8s container applications based on k8s cluster;

[0009] Create an application-type k8s container application in the control-type k8s container application;

[0010] Implement the deployment of application-type k8s container applications in control-type k8s container applications.

[0011] Furthermore, the said setting up of the operating environment on the host server includes:

[0012] Step 11: Use the kubeadm method to deploy the k8s cluster;

[0013] Step 12: Deploy the gitlab service to store application program files;

[0014] Step 13: Deploy the harbor service to store the image files of the container application;

[0015] Step 14: Deploy the Jenkins platform to connect with GitLab, and configure Jenkins to be triggered when submitting a program to GitLab;

[0016] Step 15: Deploy the nfs service to create a mount directory for the container.

[0017] Furthermore, the control-type k8s container application based on the k8s cluster deployment includes:

[0018] Step 21: Create an nfs mount directory for the application-type k8s container application on the host server;

[0019] Step 22: Write the yaml file of the control k8s container application;

[0020] Step 23: Write a Dockerfile file of the control type k8s container application, and place the Dockerfile file of the control type k8s container application in the directory of the control type k8s container application program;

[0021] Step 24: Use the gitlab service to create a gitlab warehouse and submit the program files of the control-type k8s container application to the gitlab warehouse;

[0022] Step 25: Use the harbor service to create a first harbor warehouse for storing the image file of the control-type k8s container application;

[0023] Step 26: Create a Jenkins project for the control type k8s container application on the Jenkins platform.

[0024] Furthermore, the step 22 includes:

[0025] Step 221: Mount the host docker command and the host k8s command;

[0026] Step 222: Mount the nfs mount directory of the application-type k8s container application.

[0027] Furthermore, the step 26 includes:

[0028] Step 261: Pull the program file of the control type k8s container application from the gitlab platform;

[0029] Step 262: compile the program file of the control type k8s container application and the Dockerfile file of the control type k8s container application, package the program file of the control type k8s container application and the Dockerfile file of the control type k8s container application into an image file, and push the image file to the first harbor warehouse;

[0030] Step 263: Run the yaml file of the control type k8s container application to obtain the image file in step 262 from the first harbor warehouse, and use the image file to deploy the control type k8s container application.

[0031] Further, creating an application-type k8s container application in a control-type k8s container application includes:

[0032] Step 31: Using the background of the control-type k8s container application, create the application-type k8s container application;

[0033] Step 32: Output the relevant files of the application-type k8s container application to the nfs mount directory of the application-type k8s container application.

[0034] Furthermore, the deployment of the application-type k8s container application in the control-type k8s container application includes:

[0035] Step 41: Use the harbor service to create a second harbor warehouse for storing the image file of the application-type k8s container application;

[0036] Step 42: Write a Dockerfile file of the application-type k8s container application, and put the Dockerfile file of the application-type k8s container application into the nfs mount directory of the application-type k8s container application;

[0037] Step 43: Write and execute a script for packaging the Dockerfile file of the application-type k8s container application and the nfs mount directory of the application-type k8s container application into a mirror file using the mounted host docker command;

[0038] Step 44: Push the image file in step 43 to the second harbor warehouse;

[0039] Step 45: Write a YAML file of the application-type k8s container application, and run the YAML file of the application-type k8s container application with the mounted host k8s command to read the image file in step 43 from the second harbor warehouse, and publish the image file as an application-type k8s container application.

[0040] According to a second aspect of an embodiment of the present application, a device for deploying a k8s container application is provided, the device comprising:

[0041] Initialization unit, used to build the operating environment on the host server;

[0042] Deployment unit, used to deploy control-type k8s container applications based on k8s cluster;

[0043] A creation unit is used to create an application-type k8s container application in a control-type k8s container application;

[0044] The implementation unit is used to implement the deployment of application-type k8s container applications in control-type k8s container applications.

[0045] According to a second aspect of an embodiment of the present application, an electronic device is provided, including a processor and a memory, wherein the memory stores a computer medium, and when the computer medium is executed by the processor, the code publishing method described in any of the above technical solutions is executed.

[0046] According to a second aspect of an embodiment of the present application, a computer medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the code publishing method described in any technical solution is executed.

[0047] The present invention adopts the above technical scheme, and the beneficial effects that can be achieved include: by building a running environment on the host server, deploying a control-type k8s container application based on the k8s cluster, creating an application-type k8s container application in the control-type k8s container application, and implementing the deployment of the application-type k8s container application in the control-type k8s container application, and implementing the deployment of the k8s container application, which not only simplifies the deployment steps when deploying multiple container applications; it also liberates the operations on the host machine, allowing all application-layer operations to be executed in the control-type k8s container, and the online and offline operations of the application-type application are one-click operations, reducing the error rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 It is a flowchart of a method for deploying a k8s container application according to an exemplary embodiment;

[0050] Figure 2 It is a flowchart of a method for deploying a k8s container application according to an exemplary embodiment;

[0051] Figure 3 It is a block diagram of a device for deploying a k8s container application according to an exemplary embodiment. DETAILED DESCRIPTION

[0052] To make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be described in detail below. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0053] Figure 1 is a flowchart of a method for deploying a k8s container application according to an exemplary embodiment. Figure 1 As shown, the method can be but is not limited to being used in a terminal, and includes the following steps:

[0054] Step 1: Set up the operating environment on the host server;

[0055] Step 2: Deploy the control-type k8s container application based on the k8s cluster;

[0056] Step 3: Create an application-type k8s container application in the control-type k8s container application;

[0057] Step 4: Implement the deployment of application-type k8s container applications in control-type k8s container applications.

[0058] In some optional embodiments, see Figure 2 , step 1 can be achieved by but not limited to the following process:

[0059] Step 1.1: Deploy the k8s cluster using the kubeadm method;

[0060] Step 1.2: Deploy the gitlab service to store application program files;

[0061] Step 1.3: Deploy the harbor service to store the image files of the container application;

[0062] Step 1.4: Deploy the Jenkins platform to connect with GitLab, and configure Jenkins to be triggered when submitting a program to GitLab;

[0063] Step 1.5: Deploy the nfs service to create a mount directory for the container.

[0064] It should be noted that the "kubeadm method, gitlab service, harbor service and jenkins platform" involved in the embodiment of the present invention are well known to those skilled in the art, and therefore, their specific implementation methods are not described in detail.

[0065] In some optional embodiments, see Figure 2 , step 2 can be achieved by but not limited to the following process:

[0066] Step 2.1: Create an nfs mount directory for the application-type k8s container application on the host server;

[0067] Step 2.2: Write the yaml file of the control k8s container application;

[0068] Step 2.3: Write the Dockerfile file of the control type k8s container application, and put the Dockerfile file of the control type k8s container application in the directory of the control type k8s container application;

[0069] Step 2.4: Use the gitlab service to create a gitlab warehouse and submit the program files of the control k8s container application to the gitlab warehouse;

[0070] Step 2.5: Use the harbor service to create the first harbor warehouse to store the image files of the control-type k8s container application;

[0071] Step 2.6: Create a Jenkins project for the control k8s container application on the Jenkins platform.

[0072] Specifically, optional step 2.2 includes:

[0073] Step 2.2.1: Mount the host docker command and the host k8s command;

[0074] Step 2.2.2: Mount the nfs mount directory of the application-type k8s container application.

[0075] It should be noted that mounting the host docker command and the host k8s command means calling the host docker / k8s command in the container.

[0076] Specifically, optional step 2.6 includes:

[0077] Step 2.6.1: Pull the program files of the control-type k8s container application from the gitlab platform;

[0078] Step 2.6.2: Compile the program files of the control type k8s container application and the Dockerfile file of the control type k8s container application, package the program files of the control type k8s container application and the Dockerfile file of the control type k8s container application into a mirror file, and push the mirror file to the first harbor warehouse;

[0079] Step 2.6.3: Run the yaml file of the control-type k8s container application to obtain the image file in step 2.6.2 from the first harbor warehouse, and use the image file to deploy the control-type k8s container application.

[0080] In some optional embodiments, see Figure 2 , step 3 can be achieved by but not limited to the following process:

[0081] Step 3.1: Use the background of the control-type k8s container application to create an application-type k8s container application;

[0082] Step 3.2: Output the relevant files of the application-type k8s container application to the nfs mount directory of the application-type k8s container application.

[0083] In some optional embodiments, see Figure 2 , step 4 can be achieved by but not limited to the following process:

[0084] Step 4.1: Use the harbor service to create a second harbor warehouse to store the image files of the application-type k8s container application;

[0085] Step 4.2: Write the Dockerfile file of the application-type k8s container application, and put the Dockerfile file of the application-type k8s container application into the nfs mount directory of the application-type k8s container application;

[0086] Step 4.3: Write and execute a script to use the mounted host docker command to package the Dockerfile file of the application-type k8s container application and the nfs mount directory of the application-type k8s container application into an image file;

[0087] Step 4.4: Push the image file in step 4.3 to the second harbor warehouse;

[0088] Step 4.5: Write the YAML file of the application-type k8s container application, and run the YAML file of the application-type k8s container application with the mounted host k8s command to read the image file in step 4.3 from the second harbor warehouse and publish the image file as an application-type k8s container application.

[0089] A method for deploying a k8s container application provided by an embodiment of the present invention builds a running environment on a host server, deploys a control-type k8s container application based on a k8s cluster, creates an application-type k8s container application in the control-type k8s container application, and implements the deployment of the application-type k8s container application in the control-type k8s container application, thereby implementing the deployment of the k8s container application, and when multiple container applications are deployed, the deployment steps can be simplified (i.e., an application-type k8s container application is created in the control-type k8s container application); the operations on the host are liberated, so that all application-layer operations are executed in the control-type k8s container, and the online and offline operations of the application-type application are performed with one click, thereby reducing the error rate.

[0090] In order to cooperate with the above-mentioned method for deploying k8s container applications, an embodiment of the present invention provides a device for deploying k8s container applications, such as Figure 3 As shown, the device comprises:

[0091] Initialization unit, used to build the operating environment on the host server;

[0092] Deployment unit, used to deploy control-type k8s container applications based on k8s cluster;

[0093] A creation unit is used to create an application-type k8s container application in a control-type k8s container application;

[0094] The implementation unit is used to implement the deployment of application-type k8s container applications in control-type k8s container applications.

[0095] Further optionally, the initialization unit includes:

[0096] The first deployment module is used to deploy the k8s cluster using the kubeadm method;

[0097] The second deployment module is used to deploy the gitlab service and store application program files;

[0098] The third deployment module is used to deploy the harbor service and store the image files of the container application;

[0099] The fourth deployment module is used to deploy the Jenkins platform to connect with GitLab, and to configure Jenkins to be triggered when submitting a program to GitLab;

[0100] The fifth deployment module is used to deploy the nfs service and to create a mount directory for the container.

[0101] Further optionally, the deployment unit includes:

[0102] The first creation module is used to create an nfs mount directory for the application-type k8s container application on the host server;

[0103] The first writing module is used to write the yaml file of the control-type k8s container application;

[0104] The second writing module is used to write the Dockerfile file of the control type k8s container application, and put the Dockerfile file of the control type k8s container application in the directory of the control type k8s container application program;

[0105] The second creation module is used to create a gitlab warehouse using the gitlab service and submit the program files of the control-type k8s container application to the gitlab warehouse;

[0106] The third creation module is used to create a first harbor warehouse using the harbor service, which is used to store the image file of the control type k8s container application;

[0107] The fourth creation module is used to create a Jenkins project for the control type k8s container application on the Jenkins platform.

[0108] Specifically, the first writing module includes:

[0109] The first mounting submodule is used to mount the host docker command and the host k8s command;

[0110] The second mounting submodule is used to mount the nfs mounting directory of the application-type k8s container application.

[0111] Specifically, the fourth creation module includes:

[0112] Pull submodule, used to pull program files of control-type k8s container applications from the gitlab platform;

[0113] The packaging submodule is used to compile the program files of the control type k8s container application and the Dockerfile file of the control type k8s container application, package the program files of the control type k8s container application and the Dockerfile file of the control type k8s container application into an image file, and push the image file to the first harbor warehouse;

[0114] The deployment submodule is used to run the yaml file of the control-type k8s container application to obtain the image file in the packaging submodule from the first harbor warehouse, and use the image file to deploy the control-type k8s container application.

[0115] Optionally, create a unit including:

[0116] The fifth creation module is used to create an application-type k8s container application by using the background of the control-type k8s container application;

[0117] The output module is used to output the relevant files of the application-type k8s container application to the nfs mount directory of the application-type k8s container application.

[0118] Further optionally, the implementation unit includes:

[0119] The sixth creation module is used to create a second harbor warehouse using the harbor service to store the image file of the application-type k8s container application;

[0120] The third writing module is used to write the Dockerfile file of the application-type k8s container application, and put the Dockerfile file of the application-type k8s container application into the nfs mount directory of the application-type k8s container application;

[0121] The fourth writing module is used to write and execute a script, which is used to package the Dockerfile file of the application-type k8s container application and the nfs mount directory of the application-type k8s container application into a mirror file using the mounted host docker command;

[0122] The push module is used to push the image file in the fourth writing module to the second harbor warehouse;

[0123] The fifth writing module is used to write the YAML file of the application-type k8s container application, and use the mounted host k8s command to run the YAML file of the application-type k8s container application to read the image file in the fourth writing module from the second harbor warehouse and publish the image file as an application-type k8s container application.

[0124] An embodiment of the present invention provides a device for deploying a k8s container application. An initialization unit builds a running environment on a host server. A deployment unit deploys a control-type k8s container application based on a k8s cluster. A creation unit creates an application-type k8s container application in a control-type k8s container application. An implementation unit implements the deployment of an application-type k8s container application in a control-type k8s container application, thereby implementing the deployment of a k8s container application. When multiple container applications are deployed, the deployment steps can be simplified (i.e., an application-type k8s container application is created in a control-type k8s container application). Operations on the host are liberated, so that all application-layer operations are executed in the control-type k8s container. The online and offline operations of the application-type application are performed with one click, thereby reducing the error rate.

[0125] It can be understood that the device embodiment provided above corresponds to the method embodiment described above, and the corresponding specific contents can be referenced to each other and will not be repeated here.

[0126] An embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores a computer medium, and when the computer medium is executed by the processor, the code publishing method in any of the above embodiments is executed.

[0127] An embodiment of the present invention further provides a computer medium, on which a computer program is stored. When the computer program is executed by a processor, the code publishing method in any of the above embodiments is executed.

[0128] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0129] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram and the combination of the processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0130] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction method, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0132] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for deploying a k8s container application, characterized in that: The method comprises: Build the operating environment on the host server, including: Step 11: Use the kubeadm method to deploy the k8s cluster; Step 12: Deploy the gitlab service to store the application program files; Step 13: Deploy the harbor service to store the image files of the container application; Step 14: Deploy the jenkins platform to connect with gitlab, and configure Jenkins to be triggered when submitting the program to gitlab; Step 15: Deploy the nfs service to create a mount directory for the container; Deploy a control-type k8s container application based on a k8s cluster, including: step 21: creating an nfs mount directory for the application-type k8s container application on the host server; Step 22: Write a yaml file for the control-type k8s container application; specifically including: Step 221: Mount the host docker command and the host k8s command; Step 222: Mount the nfs mount directory of the application-type k8s container application; Step 23: Write a Dockerfile file of the control type k8s container application, and place the Dockerfile file of the control type k8s container application in the directory of the control type k8s container application program; Step 24: Use the gitlab service to create a gitlab warehouse and submit the program files of the control-type k8s container application to the gitlab warehouse; Step 25: Use the harbor service to create a first harbor warehouse for storing the image file of the control-type k8s container application; Step 26: Create a Jenkins project for the control type k8s container application on the Jenkins platform; Create an application-type k8s container application in the control-type k8s container application; Implementing the deployment of application-type k8s container applications in control-type k8s container applications includes: step 41: using the harbor service to create a second harbor warehouse for storing image files of application-type k8s container applications; step 42: writing a Dockerfile file of the application-type k8s container application, and putting the Dockerfile file of the application-type k8s container application into the nfs mount directory of the application-type k8s container application; step 43: writing and executing a script for packaging the Dockerfile file of the application-type k8s container application and the nfs mount directory of the application-type k8s container application into an image file using the mounted host docker command; step 44: pushing the image file in step 43 to the second harbor warehouse; step 45: writing a yaml file of the application-type k8s container application, and running the yaml file of the application-type k8s container application with the mounted host k8s command to read the image file in step 43 from the second harbor warehouse, and publish the image file as an application-type k8s container application.

2. The method according to claim 1, characterized in that The step 26 comprises: Step 261: Pull the program files of the control-type k8s container application from the gitlab repository; Step 262: compile the program file of the control type k8s container application and the Dockerfile file of the control type k8s container application, package the program file of the control type k8s container application and the Dockerfile file of the control type k8s container application into an image file, and push the image file to the first harbor warehouse; Step 263: Run the yaml file of the control type k8s container application to obtain the image file in step 262 from the first harbor warehouse, and use the image file to deploy the control type k8s container application.

3. The method according to claim 1, characterized in that: The step of creating an application-type k8s container application in a control-type k8s container application includes: Step 31: Using the background of the control-type k8s container application, create the application-type k8s container application; Step 32: Output the relevant files of the application-type k8s container application to the nfs mount directory of the application-type k8s container application.

4. A device for deploying k8s container applications, characterized in that: The device comprises: Initialization unit, used to build the operating environment on the host server; specifically used in step 11: deploy the k8s cluster using the kubeadm method; step 12: deploy the gitlab service to store the application program files; step 13: deploy the harbor service to store the image files of the container application; step 14: deploy the jenkins platform to connect with gitlab, and configure jenkins to be triggered when submitting the program to gitlab; step 15: deploy the nfs service to create a mount directory for the container; A deployment unit is used to deploy a control-type k8s container application based on a k8s cluster; specifically used for: Step 21: creating an nfs mount directory for the application-type k8s container application on the host server; Step 22: Write a yaml file for the control-type k8s container application; specifically including: Step 221: Mount the host docker command and the host k8s command; Step 222: Mount the nfs mount directory of the application-type k8s container application; Step 23: Write a Dockerfile file of the control type k8s container application, and place the Dockerfile file of the control type k8s container application in the directory of the control type k8s container application program; Step 24: Use the gitlab service to create a gitlab warehouse and submit the program files of the control-type k8s container application to the gitlab warehouse; Step 25: Use the harbor service to create a first harbor warehouse for storing the image file of the control-type k8s container application; Step 26: Create a Jenkins project for the control type k8s container application on the Jenkins platform; A creation unit is used to create an application-type k8s container application in a control-type k8s container application; An implementation unit is used to implement the deployment of an application-type k8s container application in a control-type k8s container application; specifically used in step 41: using the harbor service to create a second harbor warehouse for storing the image file of the application-type k8s container application; step 42: writing a Dockerfile file of the application-type k8s container application, and putting the Dockerfile file of the application-type k8s container application into the nfs mount directory of the application-type k8s container application; step 43: writing and executing a script for using the mounted host docker command to package the Dockerfile file of the application-type k8s container application and the nfs mount directory of the application-type k8s container application into an image file; step 44: pushing the image file in step 43 to the second harbor warehouse; step 45: writing a yaml file of the application-type k8s container application, and running the yaml file of the application-type k8s container application with the mounted host k8s command to read the image file in step 43 from the second harbor warehouse, and publish the image file as an application-type k8s container application.

5. An electronic device, characterized in that: It includes a processor and a memory, the memory stores a computer medium, and when the computer medium is executed by the processor, it runs the method for deploying a k8s container application as described in any one of claims 1 to 3.

6. A computer medium, characterized in that The computer medium stores a computer program, and when the computer program is executed by the processor, the method for deploying a k8s container application as described in any one of claims 1 to 3 is executed.