CN111984368A - Component modification method, system, device and readable storage medium - Google Patents
Component modification method, system, device and readable storage medium Download PDFInfo
- Publication number
- CN111984368A CN111984368A CN202010738636.1A CN202010738636A CN111984368A CN 111984368 A CN111984368 A CN 111984368A CN 202010738636 A CN202010738636 A CN 202010738636A CN 111984368 A CN111984368 A CN 111984368A
- Authority
- CN
- China
- Prior art keywords
- component
- container
- image file
- file
- new
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
- 238000002715 modification method Methods 0.000 title claims abstract description 27
- 230000004048 modification Effects 0.000 claims abstract description 40
- 238000012986 modification Methods 0.000 claims abstract description 40
- 238000000034 method Methods 0.000 claims abstract description 23
- 230000008569 process Effects 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 10
- 230000009471 action Effects 0.000 claims description 6
- 238000012790 confirmation Methods 0.000 claims description 3
- 230000005540 biological transmission Effects 0.000 abstract description 9
- 238000012827 research and development Methods 0.000 abstract description 6
- 238000013515 script Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000012217 deletion Methods 0.000 description 1
- 230000037430 deletion Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000010076 replication Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
- G06F8/63—Image based installation; Cloning; Build to order
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45562—Creating, deleting, cloning virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45575—Starting, stopping, suspending or resuming virtual machine instances
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45595—Network integration; Enabling network access in virtual machine instances
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a component modification method, which is applied to the technical field of K8S and comprises the following steps: acquiring a container in a pod corresponding to a component to be modified; entering the container, and performing modification operation corresponding to the component to be modified; after the modification operation is completed, generating a new image file according to the container; and pushing the new image file into an image warehouse. According to the method and the device, the online container is modified correspondingly under the operating environment, then the container is made into a new image file, the image file is pushed to the image warehouse for the operating environment to use, the copied file does not need to be transmitted to the image warehouse locally, the bandwidth and the transmission time are saved, the rapid updating and the timely feedback of the K8S application are realized, and the research and development efficiency is improved. Correspondingly, the application also discloses a component modification system, a device and a readable storage medium.
Description
Technical Field
The invention relates to the field of K8S, in particular to a component modification method, a system, a device and a readable storage medium.
Background
With the rapid development of cloud computing technology, the K8S (kubernets) technology comes, and is a brand-new container technology-based distributed architecture built on docker. The K8S appears to provide functions of resource scheduling, deployment and operation, service discovery, capacity expansion and capacity reduction, and the like for containerized applications.
One of the important features of K8S is automation, which means that automatic deployment, automatic restart, automatic replication, automatic scaling/expansion, etc. can be achieved. Since K8S is based on docker technology, mirroring is an important element of K8S operation. For normal platform environment deployment, the needed images are uploaded to an image warehouse, and then the K8S realizes pulling, deployment, starting and the like of the images through scripts.
If a certain component or some components are upgraded, a new image file needs to be generated, the new image file is pushed to an image warehouse again, and then deployment or upgrading is automatically performed through a K8S script. If a certain image file or some image files are large (larger than 1G), the transmission and copy of the image file packet will occupy larger bandwidth, especially the transmission of the image under the environment of limited network speed directly affects the efficiency.
Therefore, how to provide a solution to the above technical problems is a problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, the present invention provides a component modification method, system, device and readable storage medium. The specific scheme is as follows:
a component modification method is applied to the technical field of K8S and comprises the following steps:
acquiring a container in a pod corresponding to a component to be modified;
entering the container, and performing modification operation corresponding to the component to be modified;
after the modification operation is completed, generating a new image file according to the container;
and pushing the new image file into an image warehouse.
Preferably, after pushing the new image file into the image repository, the method further includes:
modifying the configuration file of the pod so that the new image file in the image warehouse is pulled after the pod is restarted;
and restarting the pod, and pulling the new image file to start the corresponding new container.
Preferably, the process of pushing the new image file into the image repository includes:
and modifying the path and tag of the new image file, and pushing the new image file into an image warehouse.
Preferably, the process of performing the modification operation corresponding to the component to be modified includes:
newly building a file or a folder in the container;
and/or editing files in the container;
and/or copying files or folders from local to the container;
and/or delete files or folders in the container.
Preferably, after pushing the new image file into the image repository, the method further includes:
and generating a tar file corresponding to the new image file and storing the tar file to the local.
Preferably, the process of performing the modification operation corresponding to the component to be modified includes:
and carrying out upgrading operation corresponding to the component to be modified.
Correspondingly, the invention also discloses a component modification method, which is applied to the technical field of K8S and comprises the following steps:
the confirmation module is used for acquiring a container in the pod corresponding to the component to be modified;
the action module is used for entering the container and carrying out modification operation corresponding to the component to be modified;
the mirror image module is used for generating a new mirror image file according to the container after the modification operation is finished;
and the warehouse module is used for pushing the new mirror image file into the mirror image warehouse.
Preferably, the component modification system further includes:
the restart module is used for modifying the configuration file of the pod so as to pull the new image file in the image warehouse after the pod is restarted; and restarting the pod, and pulling the new image file to start the corresponding new container.
Correspondingly, the invention also discloses a device for modifying the components, which comprises:
a memory for storing a computer program;
a processor for implementing the steps of the component modification method as described in any one of the above when said computer program is executed.
Accordingly, the present invention also discloses a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the component modification method as described in any of the above.
The invention discloses a component modification method, which is applied to the technical field of K8S and comprises the following steps: acquiring a container in a pod corresponding to a component to be modified; entering the container, and performing modification operation corresponding to the component to be modified; after the modification operation is completed, generating a new image file according to the container; and pushing the new image file into an image warehouse. According to the invention, the online container is modified correspondingly under the operating environment, then the container is made into a new image file, and the image file is pushed to the image warehouse for the operating environment, so that the copy file is not required to be transmitted to the image warehouse locally, the bandwidth and the transmission time are saved, the rapid update and the timely feedback of the K8S application are realized, and the research and development efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flow chart illustrating steps of a component modification method according to an embodiment of the present invention;
FIG. 2 is a block diagram of a component modification system according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, if a certain component or some components are upgraded, a new image file needs to be generated, the new image file is pushed to an image warehouse again, and then deployment or upgrading is automatically executed through a K8S script. If a certain image file or some image files are large (larger than 1G), the transmission and copy of the image file packet will occupy larger bandwidth, especially the transmission of the image under the environment of limited network speed directly affects the efficiency.
According to the invention, the online container is modified correspondingly under the operating environment, then the container is made into a new image file, and the image file is pushed to the image warehouse for the operating environment, so that the copy file is not required to be transmitted to the image warehouse locally, the bandwidth and the transmission time are saved, the rapid update and the timely feedback of the K8S application are realized, and the research and development efficiency is improved.
The embodiment of the invention discloses a component modification method, which is applied to the technical field of K8S and shown in figure 1, and comprises the following steps:
s1: acquiring a container in a pod corresponding to a component to be modified;
specifically, in this step, the pod name and the container ID corresponding to the component to be modified are mainly obtained.
S2: entering a container, and performing modification operation corresponding to the component to be modified;
it can be understood that, in the embodiment, the purpose of the component modification method is to update or upgrade a component, and therefore, the process of performing the modification operation corresponding to the component to be modified may include: and carrying out upgrading operation corresponding to the component to be modified.
Specifically, the process of performing the modification operation corresponding to the component to be modified includes: newly building a file or a folder in the container; and/or editing files in containers; and/or copying files or folders from local to the container; and/or delete files or folders in the container.
It is understood that the type of the operation object of the modification operation in this step includes directory files and/or folders in the container, and the specific operation includes new creation, editing, deletion, copying, and the like.
S3: after the modification operation is completed, generating a new image file according to the container;
it will be appreciated that if only the container is upgraded for modification, the modified configuration will revert to the configuration content of the pre-modification image once the pod is restarted. Therefore, a new image file must be generated for the modified container, and the configuration of the new image file does not change as the pod status changes.
S4: and pushing the new image file into an image warehouse.
Specifically, considering that the new image file is convenient to store and search in the image repository, the path and tag of the new image file can be modified, and the new image file is pushed into the image repository. Here, the path and tag of the specified warehouse need to be modified based on the actual environment warehouse.
Further, after pushing the new image file into the image repository, the method further includes:
s5: modifying the configuration file of the pod so as to pull a new image file in the image warehouse after the pod is restarted;
s6: and restarting the pod, and pulling the new image file to start the corresponding new container.
It can be understood that the steps S5 and S6 ensure that the modification effect does not roll back with the change of pod, and ensure the reliability of the current modification or application upgrade. Meanwhile, the modification operation is performed based on the online docker container, so that modification and debugging of the online application container file in the operating environment can be realized, timely feedback is obtained, and the research and development efficiency is further improved.
Further, after pushing the new image file into the image repository, the method further includes:
s7: and generating a tar file corresponding to the new image file and storing the tar file to the local.
It will be appreciated that execution of this step will generate a local-image name.tar file under the current directory, which can be persisted locally for later use or transfer.
The embodiment of the invention discloses a component modification method, which is applied to the technical field of K8S and comprises the following steps: acquiring a container in a pod corresponding to a component to be modified; entering a container, and performing modification operation corresponding to the component to be modified; after the modification operation is completed, generating a new image file according to the container; and pushing the new image file into an image warehouse. According to the invention, the online container is modified correspondingly under the operating environment, then the container is made into a new image file, and the image file is pushed to the image warehouse for the operating environment, so that the copy file is not required to be transmitted to the image warehouse locally, the bandwidth and the transmission time are saved, the rapid update and the timely feedback of the K8S application are realized, and the research and development efficiency is improved.
Correspondingly, the embodiment of the invention also discloses a component modification method, which is applied to the technical field of K8S and shown in fig. 2, and comprises the following steps:
the confirmation module 1 is used for acquiring a container in the pod corresponding to the component to be modified;
the action module 2 is used for entering the container and carrying out modification operation corresponding to the component to be modified;
the mirror image module 3 is used for generating a new mirror image file according to the container after the modification operation is finished;
and the warehouse module 4 is used for pushing the new image file into the image warehouse.
In some specific embodiments, the component modification system further comprises:
the restarting module 5 is used for modifying the configuration file of the pod so as to pull a new image file in the image warehouse after the pod is restarted; and restarting the pod, and pulling the new image file to start the corresponding new container.
In some specific embodiments, the warehouse module 4 is specifically configured to:
and modifying the path and tag of the new image file, and pushing the new image file into the image warehouse.
In some specific embodiments, the process of performing the modification operation corresponding to the component to be modified includes:
newly building a file or a folder in the container;
and/or editing files in containers;
and/or copying files or folders from local to the container;
and/or delete files or folders in the container.
In some specific embodiments, after pushing the new image file into the image repository, the repository module 4 further includes:
and generating a tar file corresponding to the new image file and storing the tar file to the local.
In some specific embodiments, the process of performing the modification operation corresponding to the component to be modified includes: and carrying out upgrading operation corresponding to the component to be modified.
According to the invention, the online container is modified correspondingly under the operating environment, then the container is made into a new image file, and the image file is pushed to the image warehouse for the operating environment, so that the copy file is not required to be transmitted to the image warehouse locally, the bandwidth and the transmission time are saved, the rapid update and the timely feedback of the K8S application are realized, and the research and development efficiency is improved.
Correspondingly, the embodiment of the invention also discloses a component modifying device, which comprises:
a memory for storing a computer program;
a processor for implementing the steps of the component modification method as described in any one of the above when the computer program is executed.
Correspondingly, the embodiment of the invention also discloses a readable storage medium, wherein a computer program is stored on the readable storage medium, and when being executed by a processor, the computer program realizes the steps of the component modification method.
The details of the component modification method may refer to the description in the above embodiments, and are not repeated herein.
The device for modifying an element and the readable storage medium in this embodiment have the same advantages as the method for modifying an element in the foregoing embodiment, and are not described herein again.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above detailed description is provided for a component modification method, system, apparatus and readable storage medium, and the specific examples are applied herein to illustrate the principles and embodiments of the present invention, and the above descriptions of the embodiments are only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. The component modification method is applied to the technical field of K8S and comprises the following steps:
acquiring a container in a pod corresponding to a component to be modified;
entering the container, and performing modification operation corresponding to the component to be modified;
after the modification operation is completed, generating a new image file according to the container;
and pushing the new image file into an image warehouse.
2. The component modification method of claim 1, wherein after pushing the new image file into an image repository, further comprising:
modifying the configuration file of the pod so that the new image file in the image warehouse is pulled after the pod is restarted;
and restarting the pod, and pulling the new image file to start the corresponding new container.
3. The component modification method according to claim 2, wherein the process of pushing the new image file into an image repository comprises:
and modifying the path and tag of the new image file, and pushing the new image file into an image warehouse.
4. The component modification method according to claim 3, wherein the process of performing the modification operation corresponding to the component to be modified includes:
newly building a file or a folder in the container;
and/or editing files in the container;
and/or copying files or folders from local to the container;
and/or delete files or folders in the container.
5. The component modification method according to any one of claims 1 to 4, wherein after pushing the new image file into an image repository, further comprising:
and generating a tar file corresponding to the new image file and storing the tar file to the local.
6. The component modification method according to claim 5, wherein the process of performing the modification operation corresponding to the component to be modified includes:
and carrying out upgrading operation corresponding to the component to be modified.
7. A component modification system is applied to the technical field of K8S and comprises the following components:
the confirmation module is used for acquiring a container in the pod corresponding to the component to be modified;
the action module is used for entering the container and carrying out modification operation corresponding to the component to be modified;
the mirror image module is used for generating a new mirror image file according to the container after the modification operation is finished;
and the warehouse module is used for pushing the new mirror image file into the mirror image warehouse.
8. The component modification system of claim 7, further comprising:
the restart module is used for modifying the configuration file of the pod so as to pull the new image file in the image warehouse after the pod is restarted; and restarting the pod, and pulling the new image file to start the corresponding new container.
9. A component modification apparatus, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the component modification method of any one of claims 1 to 6 when executing the computer program.
10. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the component modification method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010738636.1A CN111984368A (en) | 2020-07-28 | 2020-07-28 | Component modification method, system, device and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010738636.1A CN111984368A (en) | 2020-07-28 | 2020-07-28 | Component modification method, system, device and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111984368A true CN111984368A (en) | 2020-11-24 |
Family
ID=73444567
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010738636.1A Withdrawn CN111984368A (en) | 2020-07-28 | 2020-07-28 | Component modification method, system, device and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111984368A (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107015995A (en) * | 2016-01-28 | 2017-08-04 | 华为技术有限公司 | The amending method and device of a kind of image file |
-
2020
- 2020-07-28 CN CN202010738636.1A patent/CN111984368A/en not_active Withdrawn
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107015995A (en) * | 2016-01-28 | 2017-08-04 | 华为技术有限公司 | The amending method and device of a kind of image file |
Non-Patent Citations (1)
Title |
---|
NOT_SAY: "修改容器内容并发布为新的镜像", 《HTTPS://BLOG.CSDN.NET/NOT_SAY/ARTICLE/DETAILS/104617465》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109117425B (en) | Method, system, and medium for digital asset synchronization | |
JP6774499B2 (en) | Providing access to hybrid applications offline | |
CN108196915B (en) | Code processing method and device based on application container engine and storage medium | |
CN107066296B (en) | Method and device for cleaning mirror image in cluster node | |
CN112287007B (en) | Industrial production data real-time processing method and system based on Flink SQL engine | |
CN108563440B (en) | Automatic adding method and device of list controller codes and readable storage medium | |
US10929350B2 (en) | Enhanced techniques for copying cloud stored files | |
CN101719073A (en) | Intelligent client-based on-demand downloading realization method | |
CN111159099B (en) | Online data generation method and device, electronic equipment and storage medium | |
CN109165206B (en) | High-availability implementation method for HDFS (Hadoop distributed File System) based on container | |
AU2018202510A1 (en) | Client storage for cloud-synchronized digital media assets | |
CN114024951B (en) | Cloud edge collaboration-based power edge heterogeneous deployment method | |
CN114860344B (en) | Container starting method, device, computer equipment and storage medium | |
CN113672436B (en) | Disaster recovery backup method, device, equipment and storage medium | |
US20150242282A1 (en) | Mechanism to update software packages | |
CN115421740A (en) | Deployment method and device of cloud native application | |
CN112262378B (en) | Hierarchical hydration of dehydrated documents | |
CN111984368A (en) | Component modification method, system, device and readable storage medium | |
CN115586872A (en) | Container mirror image management method, device, equipment and storage medium | |
CN114996236A (en) | Data processing method, device and equipment for converged storage system and storage medium | |
CN115061741B (en) | Target plug-in operation method and device, electronic equipment and storage medium | |
CN117055936B (en) | Incremental upgrade method, system, computer device and readable storage medium | |
CN117742813B (en) | Cloud edge terminal AI model management method, storage medium and electronic equipment | |
CN118445505A (en) | Method and device for setting page identification picture of baseboard management controller | |
CN109996262B (en) | AC starting method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20201124 |