CN111736949B - Kubernetes container cloud platform application importing method and system - Google Patents

Kubernetes container cloud platform application importing method and system Download PDF

Info

Publication number
CN111736949B
CN111736949B CN202010470131.1A CN202010470131A CN111736949B CN 111736949 B CN111736949 B CN 111736949B CN 202010470131 A CN202010470131 A CN 202010470131A CN 111736949 B CN111736949 B CN 111736949B
Authority
CN
China
Prior art keywords
application
kubernets
resources
resource
kubernetes
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.)
Active
Application number
CN202010470131.1A
Other languages
Chinese (zh)
Other versions
CN111736949A (en
Inventor
张少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010470131.1A priority Critical patent/CN111736949B/en
Publication of CN111736949A publication Critical patent/CN111736949A/en
Application granted granted Critical
Publication of CN111736949B publication Critical patent/CN111736949B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a Kubernetes container cloud platform application importing method and system, wherein the method comprises the following steps: detecting whether the Kubernetes resources have the resources needing to be introduced after being out of management; if the Kubernets resource needs to be introduced after being out of control, an organization is established in a Kubernets container cloud platform, and the organization is bound with a namespace of the Kubernets where the resource to be introduced is located; traversing resources under the name space at the bottom layer of Kubernets, and completing the introduction of Kubernets resource information by acquiring resource parameters; the import of the application information is done through the application information in the annotations in the metadata in the Kubernetes resource.

Description

Kubernetes container cloud platform application importing method and system
Technical Field
The invention relates to the technical field of cluster application management, in particular to a Kubernetes container cloud platform application importing method and system.
Background
The container technology is a virtualization technology which is more computing resource-saving and more flexible than the virtual machine technology. With the development of container technology, a number of container arrangement engines have emerged for managing containers, and kubernets technology has emerged as a de facto standard in the field of container arrangement. When the container technology is applied to an actual production environment, application system deployment is difficult only by using kubernets due to technical threshold, and therefore a software system for managing a kubernets cluster, namely a kubernets container cloud platform, needs to be developed. In a kubernets container cloud platform, a plurality of kubernets resources which are matched with each other are often required to be managed as a logic whole, and the logic whole is an application (also called a project and the like). The kubernets container cloud platform often needs to store kubernets resources and customized application information in a database for management; however, when database data in kubernets is lost, or application attribution is changed, or the resources need to be migrated to other kubernets container cloud platforms, it is often necessary to automatically import the resources into the kubernets container cloud platform under the condition of only kubernets resources, to generate resource information and application information, and to realize the admission of the off-pipe kubernets resources. A scheme for automatically importing resource information and application information into a kubernets container cloud platform needs to be designed.
Disclosure of Invention
In order to lead the resources into a Kubernets container cloud platform automatically under the condition that only the Kubernets resources exist, generate resource information and application information and realize the management of the unmanaged Kubernets resources when database data in the Kubernets are lost, application attribution is changed or the resources are required to be migrated to other Kubernets container cloud platforms, the invention provides an application leading-in method and an application leading-in system of the Kubernets container cloud platform.
The technical scheme of the invention is as follows:
on one hand, the technical scheme of the invention provides an application importing method of a Kubernetes container cloud platform, which comprises the following steps:
detecting whether resources needing to be introduced exist after Kubernets resources are out of control;
if the kubernets resource needs to be imported after being out of pipe is detected, creating an organization in a kubernets container cloud platform and binding the organization with a namespace of the kubernets where the resource to be imported is located;
traversing resources under the name space at the bottom layer of the Kubernetes, and completing the introduction of Kubernetes resource information by acquiring resource parameters;
the import of the application information is done through the application information in the annotations in the metadata in the Kubernetes resource.
Further, the step of traversing resources under the name space at the kubernets bottom layer and completing the importing of the kubernets resource information by acquiring the resource parameters includes:
traversing all Kubernetes resources under the name space bound by the organization, acquiring detailed parameter information of the resources through a Kubernetes API, storing the parameter information into a database of the cloud platform, establishing a corresponding relation between the resources and the organization, and completing the importing of the Kubernetes resource information.
Further, the step of completing the import of the application information through the application information in the annotation in the metadata in the kubernets resource includes:
acquiring application information according to comments in metadata of the Kubernetes resources, judging whether the application information is imported, if so, continuously traversing the next Kubernetes resource, and if not, creating a corresponding application to complete the import of the application information; and meanwhile, establishing corresponding relations between applications and organizations and between Kubernets resources and the applications.
Further, the step of creating the corresponding application further comprises:
when the Kubernets container cloud platform creates an application, resources are created on the Kubernets bottom layer through the Kubernets API, and application information is injected into annotation of metadata of all the resources when the resources are created.
Further, the application information includes a name and an ID of the application.
On the other hand, the technical scheme of the invention provides a Kubernetes container cloud platform application import system which comprises a detection module, an organization creation module, a resource import module and an application import module;
the detection module is used for detecting whether the Kubernets resource has the resource to be introduced after being out of control;
the organization creating module is used for creating an organization in the Kubernets container cloud platform and binding the organization with a name space in the Kubernets where the resources to be imported are located if the Kubernets resources need to be imported after being detected to be out of control by the detection module;
the resource import module is used for traversing resources under the name space at the Kubernetes bottom layer and completing the import of Kubernetes resource information by acquiring resource parameters;
and the application import module is used for completing the import of the application information by applying the application information in the annotation in the metadata in the Kubernetes resource.
Further, the system also comprises a corresponding relation establishing module;
the resource import module comprises a traversal unit, a parameter acquisition unit and an establishment unit;
the traversal unit is used for traversing all Kubernetes resources under the bound name space of the organization;
the parameter acquisition unit is used for acquiring detailed parameter information of the resources through a Kubernetes API and storing the parameter information into a database of the cloud platform;
and the corresponding relation establishing module is used for establishing the corresponding relation between the resources and the organization and finishing the import of the Kubernets resource information.
Further, the system also comprises an application creation module; the application import module comprises an application information acquisition unit, a judgment unit and an application creation unit;
the application information acquisition unit acquires application information from the comments in the metadata of the Kubernets resource;
the judging unit is used for judging whether the application information acquired by the application information acquisition unit is imported or not, if so, outputting the information to the traversing unit to continuously traverse the next Kubernets resource, and if not, outputting the information to the application establishing module to establish application to complete the import of the application information;
the application creation module is used for creating an application, and when the application is created, application information is injected into the annotation of Kubernets resource metadata;
and the corresponding relation establishing module is also used for establishing the corresponding relation between the application and the organization as well as between the Kubernets resources and the application after the application is imported.
Further, the application creation module is further configured to create resources through a kubernets API at a kubernets bottom layer when creating an application on the kubernets container cloud platform, and inject application information into the annotation of metadata of all resources when creating the resources.
Further, the application information includes a name and an ID of the application.
According to the technical scheme, the invention has the following advantages: after the application created by the Kubernets container cloud platform is taken off-line, the application does not need to be created again, only the organization creation is completed and the Kubernets namespaces to be led in are bound, one-key leading-in of the originally created application under the namespaces can be completed, the efficiency of receiving or transferring the kubernets container cloud platform application after being taken off-line is improved, and the expense caused by re-creation of the application is avoided.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Therefore, compared with the prior art, the invention has prominent substantive features and remarkable progress, and the beneficial effects of the implementation are also obvious.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a schematic flow diagram of a method of one embodiment of the invention.
Fig. 2 is an organization, application, kubernets resource relationship.
Detailed Description
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all 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.
The organization in the description of the invention is some logic division of the kubernets cluster management software, such as division according to regions, departments and the like, and the organization corresponds to namespaces in the kubernets one by one. The application introduction scheme described in the present invention is performed in units of namespace in kubernets. The acquisition of the resource information from Kubernetes can be completed through a native API of the Kubernetes or a software interface provided by a third party. The invention is limited to the import of applications created in the kubernets container cloud platform after extubation.
The embodiment of the invention provides a Kubernets container cloud platform application importing method, which comprises the following steps:
s1: detecting whether the Kubernetes resources have the resources needing to be introduced after being out of management;
s2: if the Kubernets resource needs to be imported after being out of control, an organization is created in a Kubernets container cloud platform, the organization is bound with a namespace of the Kubernets where the resource to be imported is located, and an annotation in Kubernets metadata is a mode of recording resource special information through key values in a character string format provided by the Kubernets. This step is a preparation for the application to be taken off-line so that it can be reintroduced into the cloud platform. After kubernets resource is off-line, when kubernets resource needs to be imported into a kubernets container cloud platform, firstly, a corresponding organization is created for kubernets namespace to be imported, and the organization and the corresponding namespace are bound (namely, the corresponding relation between the organization and the namespace is stored in a database). The namespace is a resource partitioning method of Kubernets, and the introduction of the application is performed by taking namespace as a unit.
S3: traversing resources under the name space at the bottom layer of Kubernets, and completing the introduction of Kubernets resource information by acquiring resource parameters; traversing all Kubernetes resources under the name space bound by the organization, acquiring detailed parameter information of the resources through a Kubernetes API, storing the parameter information into a database of the cloud platform, establishing a corresponding relation between the resources and the organization, and completing the importing of the Kubernetes resource information.
S4: the import of the application information is done through the application information in the annotations in the metadata in the kubernets resource. When Kubernets resource is imported, acquiring application information according to comments in metadata of the Kubernets resource, judging whether the application is imported or not, if so, continuing traversing next Kubernets resource, and if not, creating corresponding application according to application information recorded in an annotation in the metadata of the Kubernets resource, and completing the import of the application information; and meanwhile, establishing corresponding relations between applications and organizations and between Kubernets resources and the applications.
It should be noted that, when an application is created on the kubernets container cloud platform, resources need to be created on the kubernets bottom layer through the kubernets API, and information such as application names and IDs needs to be injected into the annotation of metadata of all resources when the resources are created, so that the application information can be conveniently acquired when the applications are imported after being taken off the management.
According to the implementation process, the application import comprises the import of two aspects of information, namely the import of Kubernets resource information subordinate to the application, namely the Kubernets self-defined resources comprise different types of resources such as Deployment, stateful, service and the like for providing services for users; and secondly, the information of the application is imported, the application is a logic whole defined by a container platform, the logic whole comprises a plurality of Kubernets resources of different types, and the Kubernets resources are used as a whole to provide specific services for users.
After the application import is completed, the affiliations of the organizations, the applications and the kubernets resources are shown in fig. 2, where the kubernets container cloud platform includes a plurality of organizations, each organization includes a plurality of applications, and each application includes a plurality of resources.
The embodiment of the invention also provides a Kubernets container cloud platform application import system, which comprises a detection module, an organization creation module, a resource import module and an application import module;
the detection module is used for detecting whether resources needing to be introduced exist after the Kubernets resources are offline;
the organization creating module is used for creating an organization in the Kubernets container cloud platform and binding the organization with a name space in the Kubernets where the resources to be imported are located if the detection module detects that the Kubernets resources need to be imported after being out of control;
the resource import module is used for traversing resources under the name space at the Kubernetes bottom layer and completing the import of Kubernetes resource information by acquiring resource parameters;
and the application import module is used for completing the import of the application information by applying the application information in the annotation in the metadata in the Kubernetes resource.
The system also comprises a corresponding relation establishing module; the resource import module comprises a traversal unit, a parameter acquisition unit and an establishment unit; the device comprises a traversing unit, a parameter acquiring unit and a parameter storing unit, wherein the traversing unit is used for traversing all Kubernets resources in a name space bound by an organization; and the corresponding relation establishing module is used for establishing the corresponding relation between the resources and the organization and completing the import of the Kubernetes resource information.
The system also includes an application creation module; the application import module comprises an application information acquisition unit, a judgment unit and an application creation unit; the application information acquisition unit is used for acquiring application information according to annotations in the metadata of the Kubernetes resource; the judging unit is used for judging whether the application information acquired by the application information acquisition single member is imported, if so, outputting the information to the traversing unit to continuously traverse the next Kubernets resource, and if not, outputting the information to the application creating module to create the application to complete the import of the application information; the application creation module is used for creating an application, and when the application is created, application information is injected into the annotation of Kubernets resource metadata; and the corresponding relation establishing module is also used for establishing the corresponding relation between the application and the organization as well as between the Kubernetes resources and the application after the application is imported.
And the application creation module is also used for creating resources on the Kubernets bottom layer through the Kubernets API when the Kubernets container cloud platform creates the application, and injecting application information into the annotation of the metadata of all the resources when the resources are created. The application information includes the name and ID of the application.
It should be noted that the resources described in the present invention are resources in kubernets, including but not limited to Pod, delivery, stateful, service, and Persistent Volume.
Although the present invention has been described in detail in connection with the preferred embodiments with reference to the accompanying drawings, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.

Claims (9)

1. A Kubernetes container cloud platform application importing method is characterized by comprising the following steps:
detecting whether resources needing to be introduced exist after Kubernets resources are out of control;
if the Kubernets resource needs to be introduced after being out of control, an organization is established in a Kubernets container cloud platform, and the organization is bound with a namespace of the Kubernets where the resource to be introduced is located;
traversing resources under the name space at the bottom layer of Kubernets, and completing the introduction of Kubernets resource information by acquiring resource parameters; traversing all Kubernetes resources under a name space bound by an organization, acquiring detailed parameter information of the resources through a Kubernetes API, storing the parameter information into a database of a cloud platform, establishing a corresponding relation between the resources and the organization, and completing the importing of the Kubernetes resource information;
the import of the application information is completed through the application information in the annotation in the metadata in the Kubernetes resource;
the organization is a certain logic division of Kubernets cluster management software, and the organization is in one-to-one correspondence with namespaces in the Kubernets.
2. The Kubernets container cloud platform application import method according to claim 1, wherein the step of completing the import of the application information through the application information in the annotation in the metadata in the Kubernets resource comprises:
acquiring application information according to the comments in the metadata of the Kubernets resource, judging whether the application information is imported, if so, continuing traversing the next Kubernets resource, and if not, creating a corresponding application according to the application information recorded in the comments in the metadata of the Kubernets resource, and completing the import of the application information; and meanwhile, establishing corresponding relations between applications and organizations and between Kubernets resources and the applications.
3. The Kubernetes container cloud platform application importing method according to claim 2, wherein the step of creating the corresponding application further includes:
when the Kubernetes container cloud platform creates an application, resources are created at the Kubernetes bottom layer through the Kubernetes API, and application information is injected into annotation of metadata of all the resources when the resources are created.
4. The Kubernetes container cloud platform application importing method according to claim 3, wherein the application information includes a name and an ID of an application.
5. A Kubernetes container cloud platform application import system is characterized by comprising a detection module, an organization creation module, a resource import module and an application import module;
the detection module is used for detecting whether resources needing to be introduced exist after the Kubernets resources are offline;
the organization creating module is used for creating an organization in the Kubernets container cloud platform and binding the organization with a name space in the Kubernets where the resources to be imported are located if the detection module detects that the Kubernets resources need to be imported after being out of control;
the resource import module is used for traversing resources under the name space at the Kubernetes bottom layer and completing the import of Kubernetes resource information by acquiring resource parameters;
and the application import module is used for completing the import of the application information by applying the application information in the annotation in the metadata in the Kubernetes resource.
6. The Kubernetes container cloud platform application import system according to claim 5, further comprising a correspondence relationship establishing module;
the resource import module comprises a traversal unit, a parameter acquisition unit and an establishment unit;
a traversing unit, which is used for traversing all Kubernets resources under the name space bound by the organization,
the parameter acquisition unit is used for acquiring detailed parameter information of the resources through a Kubernetes API and storing the parameter information into a database of the cloud platform;
and the corresponding relation establishing module is used for establishing the corresponding relation between the resources and the organization and completing the import of the Kubernetes resource information.
7. The Kubernetes container cloud platform application import system of claim 6, further comprising an application creation module; the application import module comprises an application information acquisition unit, a judgment unit and an application creation unit
The application information acquisition unit is used for acquiring application information from annotations in the metadata of the Kubernetes resource;
the judging unit is used for judging whether the application information acquired by the application information acquisition single member is imported or not, if so, outputting the information to the traversing unit to continuously traverse the next Kubernets resource, and if not, outputting the information to the application creating module to create the application to complete the import of the application information;
the application creation module is used for creating an application, and when the application is created, application information is injected into the annotation of Kubernets resource metadata;
and the corresponding relation establishing module is also used for establishing the corresponding relation between the application and the organization as well as between the Kubernetes resources and the application after the application is imported.
8. The system of claim 7, wherein the application creation module is further configured to create resources at a kubernets bottom layer through a kubernets API when creating the application on the kubernets container cloud platform, and inject application information into the annotation of metadata of all resources when creating the resources.
9. The Kubernetes container cloud platform application import system of claim 8, wherein the application information comprises a name and an ID of an application.
CN202010470131.1A 2020-05-28 2020-05-28 Kubernetes container cloud platform application importing method and system Active CN111736949B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010470131.1A CN111736949B (en) 2020-05-28 2020-05-28 Kubernetes container cloud platform application importing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010470131.1A CN111736949B (en) 2020-05-28 2020-05-28 Kubernetes container cloud platform application importing method and system

Publications (2)

Publication Number Publication Date
CN111736949A CN111736949A (en) 2020-10-02
CN111736949B true CN111736949B (en) 2023-01-10

Family

ID=72646689

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010470131.1A Active CN111736949B (en) 2020-05-28 2020-05-28 Kubernetes container cloud platform application importing method and system

Country Status (1)

Country Link
CN (1) CN111736949B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11900089B2 (en) 2021-05-04 2024-02-13 Red Hat, Inc. Automatically configuring and deploying a software operator in a distributed computing environment from a package
US11630812B2 (en) 2021-08-24 2023-04-18 Red Hat, Inc. Schema based type-coercion for structured documents

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10476745B1 (en) * 2018-05-31 2019-11-12 Illumio, Inc. Infrastructure-agnostic network-level visibility and policy enforcement for containers
CN110532058A (en) * 2019-07-26 2019-12-03 济南浪潮数据技术有限公司 Management method, device and equipment of container cluster service and readable storage medium
CN110532059A (en) * 2019-08-09 2019-12-03 济南浪潮数据技术有限公司 Quota management method and device for K8s cluster management software
CN110704164A (en) * 2019-09-30 2020-01-17 珠海市新德汇信息技术有限公司 Cloud native application platform construction method based on Kubernetes technology

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10476745B1 (en) * 2018-05-31 2019-11-12 Illumio, Inc. Infrastructure-agnostic network-level visibility and policy enforcement for containers
CN110532058A (en) * 2019-07-26 2019-12-03 济南浪潮数据技术有限公司 Management method, device and equipment of container cluster service and readable storage medium
CN110532059A (en) * 2019-08-09 2019-12-03 济南浪潮数据技术有限公司 Quota management method and device for K8s cluster management software
CN110704164A (en) * 2019-09-30 2020-01-17 珠海市新德汇信息技术有限公司 Cloud native application platform construction method based on Kubernetes technology

Also Published As

Publication number Publication date
CN111736949A (en) 2020-10-02

Similar Documents

Publication Publication Date Title
CN111736949B (en) Kubernetes container cloud platform application importing method and system
CN113114498B (en) Architecture system of trusted block chain service platform and construction method thereof
CN107688611A (en) A kind of Redis key assignments management system and method based on saltstack
CN108089912A (en) A kind of virtual machine surpasses emerging system construction method and device with container
CN108370385B (en) System, method and computer readable medium for transmitting container file over network
CN103150154B (en) The implementation method and device of a kind of application plug
US20150074043A1 (en) Distributed and open schema interactions management system and method
CN111400246B (en) Asynchronous file import method, device, computer equipment and storage medium
CN107040576A (en) Information-pushing method and device, communication system
CN104408178B (en) WEB controls loading device and method
CN102508916B (en) File fingerprint analyzing method for massive data
CN102999329B (en) The Active Directory interface exploitation method of configuration is mapped based on extend markup language
CN114780519A (en) DBC file generation method, device, equipment and medium based on CAN communication
CN108572888A (en) Disk snapshot creation method and disk snapshot creating device
CN105677579A (en) Data access method and system in cache system
CN102624894B (en) Method and system for depacketize and message analysis
CN102158351B (en) Method and device for managing device management tree under multiple servers of device management client
CN110008006B (en) Container-based big data tool deployment method and system
CN113590348B (en) Parameter transmission method, device, equipment and medium based on tree structure
CN114741441A (en) Multi-type storage engine object storage system, method and computer readable medium
CN103139227B (en) A kind of application data transmission system and method being applied to mobile terminal
CN115686497A (en) Business development data management method, development engine, electronic device, and storage medium
CN104216707A (en) Unified management method supporting multiple management modes
CN109525649B (en) Data processing method and device for zookeeper client
CN104077285A (en) File designation method and first electronic equipment

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
GR01 Patent grant
GR01 Patent grant