Movatterモバイル変換


[0]ホーム

URL:


CN115904404A - Application management method, device, equipment, medium and computer program product - Google Patents

Application management method, device, equipment, medium and computer program product
Download PDF

Info

Publication number
CN115904404A
CN115904404ACN202211339194.9ACN202211339194ACN115904404ACN 115904404 ACN115904404 ACN 115904404ACN 202211339194 ACN202211339194 ACN 202211339194ACN 115904404 ACN115904404 ACN 115904404A
Authority
CN
China
Prior art keywords
component
cluster
deployed
cloud platform
cross
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.)
Pending
Application number
CN202211339194.9A
Other languages
Chinese (zh)
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.)
Inspur Communication Technology Co Ltd
Original Assignee
Inspur Communication 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 Inspur Communication Technology Co LtdfiledCriticalInspur Communication Technology Co Ltd
Priority to CN202211339194.9ApriorityCriticalpatent/CN115904404A/en
Publication of CN115904404ApublicationCriticalpatent/CN115904404A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明提供一种应用管理方法、装置、设备、介质及计算机程序产品,该方法包括:创建待部署组件的目标脚本,根据所述待部署组件和所述目标脚本,在跨集群云平台上安装待部署组件;建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接;通过所述嵌入连接,将所述应用包仓库中的应用包下发到所述跨集群云平台对应的集群。本发明通过待部署组件的安装,应用包仓库与跨集群云平台之间的嵌入连接,以及应用包的下发,实现了应用资源在多集群场景下的管理调度。

Figure 202211339194

The present invention provides an application management method, device, device, medium, and computer program product. The method includes: creating a target script of a component to be deployed, and installing it on a cross-cluster cloud platform according to the component to be deployed and the target script. The component to be deployed; establishing an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform; sending the application package in the application package warehouse to the cross-cluster cloud platform through the embedded connection The cluster corresponding to the cluster cloud platform. The present invention implements the management and scheduling of application resources in a multi-cluster scenario through the installation of components to be deployed, the embedded connection between the application package warehouse and the cross-cluster cloud platform, and the distribution of application packages.

Figure 202211339194

Description

Translated fromChinese
应用管理方法、装置、设备、介质及计算机程序产品Application management method, device, device, medium and computer program product

技术领域technical field

本发明涉及云计算技术领域,尤其涉及一种应用管理方法、装置、设备、介质及计算机程序产品。The present invention relates to the technical field of cloud computing, in particular to an application management method, device, equipment, medium and computer program product.

背景技术Background technique

在大规模应用场景中,单集群难以满足生产环境的需求,通常需要把多个单集群组成多集群联邦的形式,在多集群联邦的控制平面对应用资源进行调度和管理,来减轻单个集群的业务负担,因此,如何实现应用资源在多集群场景下的管理调度便成为了亟待解决的技术问题。In large-scale application scenarios, it is difficult for a single cluster to meet the needs of the production environment. Usually, multiple single clusters need to be formed into a multi-cluster federation, and application resources are scheduled and managed on the control plane of the multi-cluster federation to reduce the burden on a single cluster. Therefore, how to realize the management and scheduling of application resources in a multi-cluster scenario has become an urgent technical problem to be solved.

发明内容Contents of the invention

本发明提供一种应用管理方法、装置、设备、介质及计算机程序产品,用以解决应用资源在多集群场景下的管理调度问题。The present invention provides an application management method, device, equipment, medium and computer program product, which are used to solve the problem of management and scheduling of application resources in a multi-cluster scenario.

本发明提供一种应用管理方法,包括:The present invention provides an application management method, including:

创建待部署组件的目标脚本,根据所述待部署组件和所述目标脚本,在跨集群云平台上安装待部署组件;Create a target script of the component to be deployed, and install the component to be deployed on the cross-cluster cloud platform according to the component to be deployed and the target script;

建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接;Establishing an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform;

通过所述嵌入连接,将所述应用包仓库中的应用包下发到所述跨集群云平台对应的集群。Through the embedded connection, the application package in the application package warehouse is delivered to the cluster corresponding to the cross-cluster cloud platform.

根据本发明提供的一种应用管理方法,所述根据所述待部署组件和所述目标脚本,在跨集群云平台上安装待部署组件包括:According to an application management method provided by the present invention, the installation of the component to be deployed on the cross-cluster cloud platform according to the component to be deployed and the target script includes:

在跨集群云平台与所述目标脚本的版本匹配的情况下,在跨集群云平台对应的任务列表中添加所述待部署组件对应的开关;In the case where the cross-cluster cloud platform matches the version of the target script, add a switch corresponding to the component to be deployed in the task list corresponding to the cross-cluster cloud platform;

通过所述开关及预设任务集,在跨集群云平台上安装待部署组件。Through the switch and the preset task set, the components to be deployed are installed on the cross-cluster cloud platform.

根据本发明提供的一种应用管理方法,所述应用管理方法还包括:According to an application management method provided by the present invention, the application management method further includes:

根据所述跨集群云平台对应的集群的资源类型,确定各所述集群的状态;Determine the state of each cluster according to the resource type of the cluster corresponding to the cross-cluster cloud platform;

根据各所述集群的状态,通过集群标准集对各所述集群进行管理。According to the state of each of the clusters, each of the clusters is managed through a cluster standard set.

根据本发明提供的一种应用管理方法,所述建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接包括:According to an application management method provided by the present invention, the establishment of the embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform includes:

通过预设集群认证及配置所述应用包仓库,建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接。Through preset cluster authentication and configuration of the application package warehouse, an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform is established.

根据本发明提供的一种应用管理方法,所述待部署组件包括第一组件和第二组件;所述创建待部署组件的目标脚本包括:According to an application management method provided by the present invention, the component to be deployed includes a first component and a second component; the target script for creating the component to be deployed includes:

通过运维自动化工具和预设插件方式在跨集群云平台上部署所述第一组件;Deploying the first component on a cross-cluster cloud platform by means of an operation and maintenance automation tool and a preset plug-in;

通过软件包管理工具部署所述第二组件;deploying the second component through a software package management tool;

在所述第一组件和所述第二组件部署的情况下,创建所述第一组件的第一脚本和所述第二组件的第二脚本。In case the first component and the second component are deployed, a first script of the first component and a second script of the second component are created.

根据本发明提供的一种应用管理方法,所述将所述应用包仓库中的应用包下发到所述跨集群云平台对应的集群包括:According to an application management method provided by the present invention, delivering the application package in the application package warehouse to the cluster corresponding to the cross-cluster cloud platform includes:

确定所述应用包仓库中的待下发应用包;determining the application packages to be delivered in the application package repository;

获取所述待下发应用包对应的项目标识,以及所述跨集群云平台对应的与所述项目标识绑定的目标集群;Acquiring the project identifier corresponding to the application package to be delivered, and the target cluster bound to the project identifier corresponding to the cross-cluster cloud platform;

将所述待下发应用包下发到所述目标集群。Delivering the application package to be delivered to the target cluster.

本发明还提供一种应用管理装置,包括:The present invention also provides an application management device, including:

组件安装模块,用于创建待部署组件的目标脚本,根据所述待部署组件和所述目标脚本,在跨集群云平台上安装待部署组件;The component installation module is used to create the target script of the component to be deployed, and install the component to be deployed on the cross-cluster cloud platform according to the component to be deployed and the target script;

嵌入连接建立模块,用于建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接;An embedded connection establishing module, configured to establish an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform;

应用包下发模块,用于通过所述嵌入连接,将所述应用包仓库中的应用包下发到所述跨集群云平台对应的集群。An application package delivery module, configured to deliver the application package in the application package warehouse to the cluster corresponding to the cross-cluster cloud platform through the embedded connection.

本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述应用管理方法。The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the program, it implements any one of the above-mentioned application management methods .

本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述应用管理方法。The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any one of the above-mentioned application management methods is implemented.

本发明还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述任一种所述应用管理方法。The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, any one of the application management methods described above is implemented.

本发明提供的应用管理方法、装置、设备、介质及计算机程序产品,通过创建待部署组件的目标脚本,并根据待部署组件和目标脚本,在跨集群云平台上安装待部署组件,在安装待部署组件后,建立待部署组件对应的应用包仓库与跨集群云平台之间的嵌入连接,最终通过嵌入连接,将应用包仓库中的应用包下发到跨集群云平台对应的集群,通过待部署组件的安装,应用包仓库与跨集群云平台之间的嵌入连接,以及应用包的下发,实现了应用资源在多集群场景下的管理调度。The application management method, device, equipment, medium and computer program product provided by the present invention, by creating the target script of the component to be deployed, and according to the component to be deployed and the target script, the component to be deployed is installed on the cross-cluster cloud platform, and the component to be deployed is installed. After the components are deployed, establish an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform. Finally, through the embedded connection, the application package in the application package warehouse is delivered to the cluster corresponding to the cross-cluster cloud platform. The installation of deployment components, the embedded connection between the application package warehouse and the cross-cluster cloud platform, and the distribution of application packages realize the management and scheduling of application resources in multi-cluster scenarios.

附图说明Description of drawings

为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the present invention or the technical solutions in the prior art, the accompanying drawings that need to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are the present invention. For some embodiments of the invention, those skilled in the art can also obtain other drawings based on these drawings without creative effort.

图1是本发明提供的应用管理方法的流程示意图之一;Fig. 1 is one of the schematic flow charts of the application management method provided by the present invention;

图2是本发明提供的应用管理方法的流程示意图之二;Fig. 2 is the second schematic flow diagram of the application management method provided by the present invention;

图3是本发明提供的应用管理装置的结构示意图;Fig. 3 is a schematic structural diagram of an application management device provided by the present invention;

图4是本发明提供的电子设备的结构示意图。Fig. 4 is a schematic structural diagram of an electronic device provided by the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention , but not all examples. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

下面结合图1-图2描述本发明的应用管理方法。The application management method of the present invention will be described below with reference to FIGS. 1-2 .

请参照图1,本发明提供一种应用管理方法,包括:Referring to Figure 1, the present invention provides an application management method, including:

步骤100,创建待部署组件的目标脚本,根据所述待部署组件和所述目标脚本,在跨集群云平台上安装待部署组件;Step 100, creating a target script of the component to be deployed, and installing the component to be deployed on the cross-cluster cloud platform according to the component to be deployed and the target script;

具体地,本实施例提供一种基于Kubernetes的跨集群应用管理方法,Kubernetes是一个开源的,用于管理云平台中多个主机上的容器化的应用。以跨集群云平台为基础,通过运维自动化工具Ansible离线部署组件Karmada(开源的云原生多云容器编排平台)、ArgoCD(遵循声明式理念的持续部署工具,可在Git存储库更改时自动同步和部署应用程序)、Gitlab(用于仓库管理系统的开源项目)及Harbor(容器镜像仓库开源项目),即本实施例中的待部署组件,创建待部署组件的task脚本(即本实施例中的目标脚本)。Specifically, this embodiment provides a cross-cluster application management method based on Kubernetes. Kubernetes is an open source and is used to manage containerized applications on multiple hosts in a cloud platform. Based on the cross-cluster cloud platform, through the operation and maintenance automation tool Ansible offline deployment components Karmada (an open source cloud-native multi-cloud container orchestration platform), ArgoCD (a continuous deployment tool following the declarative concept, which can automatically synchronize and Deploy application program), Gitlab (open source project for warehouse management system) and Harbor (container image warehouse open source project), that is, the components to be deployed in this embodiment, create the task script of the components to be deployed (that is, the task script in this embodiment target script).

Karmada通过kubectl-karmada插件的方式部署,保存crd压缩包到本地并拼接安装命令,ArgoCD和Harbor以Helm(kubernetes生态系统中的一个软件包管理工具)方式部署,task脚本中需获取kubelet(kubernetes主要的节点代理)的版本信息,以便在Karmada中的API server组件与控制面集群的版本保持一致,指定容器镜像为本地离线镜像,在任务列表中分别添加几个组件的开关,如果不需要或已有某个组件则关闭开关,避免重复部署导致问题。通过执行编写好的任务集,依次在将要作为控制面集群的云平台上安装各待部署组件。Karmada is deployed through the kubectl-karmada plug-in, save the crd compressed package locally and splice installation commands, ArgoCD and Harbor are deployed by Helm (a software package management tool in the kubernetes ecosystem), and the task script needs to obtain kubelet (kubernetes main The version information of the node agent) so that the version of the API server component in Karmada is consistent with the version of the control plane cluster, specify the container image as a local offline image, and add switches for several components in the task list. If there is a certain component, turn off the switch to avoid problems caused by repeated deployment. By executing the written task set, each component to be deployed is installed on the cloud platform that will be used as the control plane cluster in sequence.

步骤200,建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接;Step 200, establishing an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform;

具体地,以ArgoCD的主要功能为基础创建应用管理界面,在其中嵌入连接Harbor的Helm应用包仓库界面,展示已连接的Harbor私有仓库中已经上传的应用包,并增加集群认证、Harbor和Git仓库的配置入口,配置完成后,应用管理相关组件可以成功连接集群和仓库,为跨集群应用创建做准备。Specifically, create an application management interface based on the main functions of ArgoCD, embed the Helm application package warehouse interface connected to Harbor, display the uploaded application packages in the connected Harbor private warehouse, and add cluster authentication, Harbor and Git warehouse After the configuration is completed, the application management related components can successfully connect to the cluster and the warehouse, preparing for the creation of cross-cluster applications.

步骤300,通过所述嵌入连接,将所述应用包仓库中的应用包下发到所述跨集群云平台对应的集群。Step 300, deliver the application package in the application package repository to the cluster corresponding to the cross-cluster cloud platform through the embedded connection.

具体地,以Helm应用为例,首先,确认已经连接了的应用包仓库和集群,选择应用包仓库和应用包名称,选择集群为已经添加的多集群平面(karmada-api-server端口),确认后创建应用,同步应用使其在ArgoCD注册过的集群即多集群平面上创建,此时应用包含的资源在等待绑定Propagation后下发到成员集群,选择要创建该应用的成员集群,分发策略中每个在ArgoCD界面中创建的资源都需要设置,然后应用分发策略,随后资源的ResourceBinding被创建,其中包含资源对象的Template。从而生成Work对象,同步下发到对应的集群上,当多集群控制平面中的所有Helm应用创建的资源对象状态都检测到正常后,前端界面会显示资源运行成功。Specifically, taking the Helm application as an example, first, confirm the connected application package repository and cluster, select the application package repository and application package name, select the cluster as the added multi-cluster plane (karmada-api-server port), and confirm After creating the application, synchronize the application so that it is created on the multi-cluster plane of the ArgoCD registered cluster. At this time, the resources contained in the application are sent to the member clusters after waiting for the binding Propagation. Select the member cluster to create the application, and the distribution strategy Each resource created in the ArgoCD interface needs to be set, and then the distribution strategy is applied, and then the ResourceBinding of the resource is created, which contains the Template of the resource object. In this way, Work objects are generated and delivered to the corresponding clusters synchronously. When the status of resource objects created by all Helm applications in the multi-cluster control plane is detected to be normal, the front-end interface will display that the resources have run successfully.

本实施例通过创建待部署组件的目标脚本,并根据待部署组件和目标脚本,在跨集群云平台上安装待部署组件,在安装待部署组件后,建立待部署组件对应的应用包仓库与跨集群云平台之间的嵌入连接,最终通过嵌入连接,将应用包仓库中的应用包下发到跨集群云平台对应的集群,通过待部署组件的安装,应用包仓库与跨集群云平台之间的嵌入连接,以及应用包的下发,实现了应用资源在多集群场景下的管理调度。In this embodiment, the target script of the component to be deployed is created, and the component to be deployed is installed on the cross-cluster cloud platform according to the component to be deployed and the target script. After the component to be deployed is installed, the application package warehouse corresponding to the component to be deployed is established. Embedded connections between cluster cloud platforms, and finally through embedded connections, the application packages in the application package warehouse are delivered to the clusters corresponding to the cross-cluster cloud platform. Through the installation of components to be deployed, the connection between the application package warehouse and the cross-cluster cloud platform Embedded connections and delivery of application packages realize the management and scheduling of application resources in multi-cluster scenarios.

在一个实施例中,本申请实施例提供的应用管理方法,还可以包括:In an embodiment, the application management method provided in the embodiment of this application may further include:

步骤140,在跨集群云平台与所述目标脚本的版本匹配的情况下,在跨集群云平台对应的任务列表中添加所述待部署组件对应的开关;Step 140, when the cross-cluster cloud platform matches the version of the target script, add a switch corresponding to the component to be deployed in the task list corresponding to the cross-cluster cloud platform;

步骤150,通过所述开关及预设任务集,在跨集群云平台上安装待部署组件。Step 150, install the components to be deployed on the cross-cluster cloud platform through the switch and the preset task set.

具体地,通过运维自动化工具Ansible离线部署各个组件,创建每一个组件的目标脚本,其中Karmada通过kubectl-karmada插件的方式部署,保存crd压缩包到本地并拼接安装命令,ArgoCD和Harbor以Helm方式部署,目标脚本中需获取kubelet的版本信息,以便在Karmada中的api-server组件与控制面集群的版本保持一致,即本实施例中跨集群云平台与目标脚本的版本匹配,这种情况下,指定容器镜像为本地离线镜像,在任务列表中分别添加待部署组件的开关,如果不需要或者已有某个待部署组件,则关闭开关,避免重复部署。通过执行编写好的任务集,依次在将要作为控制面集群的跨集群云平台上安装各组件。Specifically, each component is deployed offline through the operation and maintenance automation tool Ansible, and the target script of each component is created. Karmada is deployed through the kubectl-karmada plug-in, and the crd compressed package is saved locally and the installation command is spliced. ArgoCD and Harbor use Helm Deployment, the version information of kubelet needs to be obtained in the target script, so that the version of the api-server component in Karmada is consistent with the version of the control plane cluster, that is, the cross-cluster cloud platform in this embodiment matches the version of the target script. In this case , specify the container image as a local offline image, and add the switches of the components to be deployed in the task list. If it is not needed or there is a component to be deployed, turn off the switch to avoid repeated deployment. By executing the written task set, each component is sequentially installed on the cross-cluster cloud platform that will be used as the control plane cluster.

本实施例通过在任务列表中添加待部署组件对应的开关,以及在跨集群云平台上安装待部署组件,实现了应用资源在多集群场景下的管理调度。In this embodiment, by adding switches corresponding to the components to be deployed in the task list and installing the components to be deployed on the cross-cluster cloud platform, management and scheduling of application resources in a multi-cluster scenario are realized.

在一个实施例中,本申请实施例提供的应用管理方法,还可以包括:In an embodiment, the application management method provided in the embodiment of this application may further include:

步骤400,根据所述跨集群云平台对应的集群的资源类型,确定各所述集群的状态;Step 400, according to the resource type of the cluster corresponding to the cross-cluster cloud platform, determine the state of each cluster;

步骤500,根据各所述集群的状态,通过集群标准集对各所述集群进行管理。Step 500, according to the state of each of the clusters, manage each of the clusters through a cluster standard set.

通过组织调用各待部署组件的API(Application Program Interface,应用程序界面),如前端界面通过直接操作集群API实现对集群的添加和删除等操作,并实时监控集群资源类型的内容来确定平面内成员集群的状态,使添加成员集群不再需要在后台多次操作,可在前端界面直接输入Kubeconfig文件(组织有关集群、用户、命名空间和身份认证机制的信息)实现,并在界面上展示多集群平面中的所有集群。Call the API (Application Program Interface, application program interface) of each component to be deployed through the organization, such as the front-end interface can directly operate the cluster API to realize operations such as adding and deleting the cluster, and monitor the content of the cluster resource type in real time to determine the members in the plane The state of the cluster makes adding member clusters no longer require multiple operations in the background. It can be implemented by directly entering the Kubeconfig file (organizing information about clusters, users, namespaces, and authentication mechanisms) on the front-end interface, and displaying multiple clusters on the interface All clusters in the plane.

本实施例通过集群资源类型和集群状态对集群进行管理,实现了多集群场景下集群的管理。In this embodiment, clusters are managed through cluster resource types and cluster states, and cluster management in a multi-cluster scenario is realized.

在一个实施例中,本申请实施例提供的应用管理方法,还可以包括:In an embodiment, the application management method provided in the embodiment of this application may further include:

步骤210,通过预设集群认证及配置所述应用包仓库,建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接。Step 210, establish an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform through preset cluster authentication and configuration of the application package warehouse.

具体地,以ArgoCD的主要功能为基础创建应用管理界面,在其中嵌入连接待部署组件的Helm应用包仓库界面,展示已连接的待部署组件私有仓库中已经上传的应用包,并增加集群认证(即本实施例中的预设集群认证)、Harbor和Git仓库的配置入口,配置完成后,应用管理相关组件可以成功连接集群和仓库,为跨集群应用创建做准备。Specifically, create an application management interface based on the main functions of ArgoCD, embed the Helm application package warehouse interface connected to the components to be deployed, display the uploaded application packages in the private warehouse of the connected components to be deployed, and add cluster authentication ( That is, the default cluster authentication in this embodiment), the configuration entry of Harbor and Git warehouse, after the configuration is completed, the application management related components can successfully connect to the cluster and warehouse, and prepare for the creation of cross-cluster applications.

本实施例通过集群认证及配置应用包仓库,建立待部署组件对应的应用包仓库与跨集群云平台之间的嵌入连接,通过嵌入连接实现应用资源在多集群场景下的管理调度。In this embodiment, the embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform is established through cluster authentication and configuration of the application package warehouse, and management and scheduling of application resources in a multi-cluster scenario are realized through the embedded connection.

请参照图2,在一个实施例中,本申请实施例提供的应用管理方法,还可以包括:Please refer to FIG. 2. In one embodiment, the application management method provided in the embodiment of the present application may further include:

步骤110,通过运维自动化工具和预设插件方式在跨集群云平台上部署所述第一组件;Step 110, deploying the first component on the cross-cluster cloud platform by means of operation and maintenance automation tools and preset plug-ins;

步骤120,通过软件包管理工具部署所述第二组件;Step 120, deploying the second component through a software package management tool;

步骤130,在所述第一组件和所述第二组件部署的情况下,创建所述第一组件的第一脚本和所述第二组件的第二脚本。Step 130, when the first component and the second component are deployed, create a first script of the first component and a second script of the second component.

具体地,以跨集群云平台为基础,通过运维自动化工具Ansible离线部署组件Karmada、ArgoCD及Harbor,即本实施例中的待部署组件,Karmada(即本实施例中的第一组件)通过运维自动化工具Ansible及kubectl-karmada插件的方式部署,保存crd压缩包到本地并拼接安装命令,ArgoCD和Harbor(即本实施例中的第二组件)以Helm方式部署,然后创建待部署组件中第一组件的第一脚本,以及待部署组件中第二组件的第二脚本。Specifically, based on the cross-cluster cloud platform, the offline deployment components Karmada, ArgoCD and Harbor through the operation and maintenance automation tool Ansible, that is, the components to be deployed in this embodiment, Karmada (that is, the first component in this embodiment) through operation Deploy by way of Ansible and kubectl-karmada plug-in, save the crd compressed package locally and splicing installation commands, ArgoCD and Harbor (that is, the second component in this embodiment) are deployed by Helm, and then create the first component in the component to be deployed A first script for a component, and a second script for a second component of the components to be deployed.

本实施例通过组件部署和脚本创建,实现应用资源在多集群场景下的管理调度。In this embodiment, management and scheduling of application resources in a multi-cluster scenario are implemented through component deployment and script creation.

在一个实施例中,本申请实施例提供的应用管理方法,还可以包括:In an embodiment, the application management method provided in the embodiment of this application may further include:

步骤310,确定所述应用包仓库中的待下发应用包;Step 310, determining the application packages to be delivered in the application package repository;

步骤320,获取所述待下发应用包对应的项目标识,以及所述跨集群云平台对应的与所述项目标识绑定的目标集群;Step 320, obtaining the project identifier corresponding to the application package to be delivered, and the target cluster bound to the project identifier corresponding to the cross-cluster cloud platform;

步骤330,将所述待下发应用包下发到所述目标集群。Step 330, deliver the application package to be delivered to the target cluster.

具体地,确认已经连接了的应用包仓库和集群,选择应用包仓库和应用包名称(即确定应用包仓库中的待下发应用包),选择集群为已经添加的多集群平面(karmada-api-server端口),确认后创建应用,同步应用使其在ArgoCD注册过的集群即多集群平面上创建,此时应用包含的资源在等待绑定Propagation后下发到成员集群,选择要创建该应用的成员集群,分发策略中每个在ArgoCD界面中创建的资源都需要设置,然后应用分发策略,随后资源的ResourceBinding被创建,其中包含资源对象的Template。从而生成Work对象,同步下发到对应的集群上,多集群之间的项目为了避免冲突,可通过项目绑定命名空间的方式,实现多集群项目之间的资源隔离。Specifically, confirm the connected application package warehouse and cluster, select the application package warehouse and the name of the application package (that is, determine the application package to be delivered in the application package warehouse), and select the cluster as the added multi-cluster plane (karmada-api -server port), create the application after confirmation, and synchronize the application so that it is created on the ArgoCD-registered cluster, that is, the multi-cluster plane. At this time, the resources contained in the application are sent to the member clusters after waiting for binding Propagation, and choose to create the application In the member cluster of the distribution strategy, each resource created in the ArgoCD interface needs to be set, and then the distribution strategy is applied, and then the ResourceBinding of the resource is created, which contains the Template of the resource object. In this way, Work objects are generated and delivered to the corresponding clusters synchronously. In order to avoid conflicts between projects in multiple clusters, resource isolation between projects in multiple clusters can be achieved by binding the project to a namespace.

本实施例通过嵌入连接实现应用资源在多集群场景下的管理调度。In this embodiment, the management and scheduling of application resources in a multi-cluster scenario are implemented through embedded connections.

下面对本发明提供的应用管理装置进行描述,下文描述的应用管理装置与上文描述的应用管理方法可相互对应参照。The application management device provided by the present invention is described below, and the application management device described below and the application management method described above can be referred to in correspondence.

请参照图3,本发明还提供一种应用管理装置,包括:Referring to Figure 3, the present invention also provides an application management device, including:

组件安装模块301,用于创建待部署组件的目标脚本,根据所述待部署组件和所述目标脚本,在跨集群云平台上安装待部署组件;Thecomponent installation module 301 is used to create the target script of the component to be deployed, and install the component to be deployed on the cross-cluster cloud platform according to the component to be deployed and the target script;

嵌入连接建立模块302,用于建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接;An embeddedconnection establishment module 302, configured to establish an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform;

应用包下发模块303,用于通过所述嵌入连接,将所述应用包仓库中的应用包下发到所述跨集群云平台对应的集群。The applicationpackage delivery module 303 is configured to deliver the application package in the application package warehouse to the cluster corresponding to the cross-cluster cloud platform through the embedded connection.

可选地,所述组件安装模块包括:Optionally, the component installation module includes:

开关添加单元,用于在跨集群云平台与所述目标脚本的版本匹配的情况下,在跨集群云平台对应的任务列表中添加所述待部署组件对应的开关;A switch adding unit, configured to add a switch corresponding to the component to be deployed in the task list corresponding to the cross-cluster cloud platform when the cross-cluster cloud platform matches the version of the target script;

组件安装单元,用于通过所述开关及预设任务集,在跨集群云平台上安装待部署组件。The component installation unit is used to install the components to be deployed on the cross-cluster cloud platform through the switch and the preset task set.

可选地,所述应用管理装置,还包括:Optionally, the application management device further includes:

集群状态确定单元,用于根据所述跨集群云平台对应的集群的资源类型,确定各所述集群的状态;A cluster state determining unit, configured to determine the state of each cluster according to the resource type of the cluster corresponding to the cross-cluster cloud platform;

集群管理单元,用于根据各所述集群的状态,通过集群标准集对各所述集群进行管理。The cluster management unit is configured to manage each of the clusters through a cluster standard set according to the state of each of the clusters.

可选地,所述嵌入连接建立模块包括:Optionally, the embedded connection establishment module includes:

嵌入连接建立单元,用于通过预设集群认证及配置所述应用包仓库,建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接。The embedded connection establishment unit is configured to establish an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform through preset cluster authentication and configuration of the application package warehouse.

可选地,所述待部署组件包括第一组件和第二组件;所述组件安装模块包括:Optionally, the component to be deployed includes a first component and a second component; the component installation module includes:

第一组件部署单元,用于通过运维自动化工具和预设插件方式在跨集群云平台上部署所述第一组件;The first component deployment unit is configured to deploy the first component on the cross-cluster cloud platform by means of operation and maintenance automation tools and preset plug-ins;

第二组件部署单元,用于通过软件包管理工具部署所述第二组件;a second component deployment unit, configured to deploy the second component through a software package management tool;

脚本创建单元,用于在所述第一组件和所述第二组件部署的情况下,创建所述第一组件的第一脚本和所述第二组件的第二脚本。A script creating unit, configured to create a first script of the first component and a second script of the second component when the first component and the second component are deployed.

可选地,所述应用包下发模块包括:Optionally, the application package delivery module includes:

待下发应用包确定单元,用于确定所述应用包仓库中的待下发应用包;an application package determination unit to be delivered, configured to determine the application package to be delivered in the application package warehouse;

获取单元,用于获取所述待下发应用包对应的项目标识,以及所述跨集群云平台对应的与所述项目标识绑定的目标集群;An acquisition unit, configured to acquire the project identifier corresponding to the application package to be delivered, and the target cluster bound to the project identifier corresponding to the cross-cluster cloud platform;

应用包下发单元,用于将所述待下发应用包下发到所述目标集群。An application package delivering unit, configured to deliver the application package to be delivered to the target cluster.

图4示例了一种电子设备的实体结构示意图,如图4所示,该电子设备可以包括:处理器(processor)410、通信接口(Communications Interface)420、存储器(memory)430和通信总线440,其中,处理器410,通信接口420,存储器430通过通信总线440完成相互间的通信。处理器410可以调用存储器430中的逻辑指令,以执行应用管理方法。FIG. 4 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 4, the electronic device may include: a processor (processor) 410, a communication interface (Communications Interface) 420, a memory (memory) 430 and acommunication bus 440, Wherein, theprocessor 410 , thecommunication interface 420 , and the memory 430 communicate with each other through thecommunication bus 440 . Theprocessor 410 can invoke logic instructions in the memory 430 to execute the application management method.

此外,上述的存储器430中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above logic instructions in the memory 430 may be implemented in the form of software function units and be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. .

另一方面,本发明还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,计算机程序可存储在非暂态计算机可读存储介质上,所述计算机程序被处理器执行时,计算机能够执行上述各方法所提供的应用管理方法。On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can Execute the application management method provided by each of the above methods.

又一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的应用管理方法。In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it is implemented to execute the application management method provided by the above methods.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative effort.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (10)

Translated fromChinese
1.一种应用管理方法,其特征在于,包括:1. An application management method, characterized in that, comprising:创建待部署组件的目标脚本,根据所述待部署组件和所述目标脚本,在跨集群云平台上安装待部署组件;Create a target script of the component to be deployed, and install the component to be deployed on the cross-cluster cloud platform according to the component to be deployed and the target script;建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接;Establishing an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform;通过所述嵌入连接,将所述应用包仓库中的应用包下发到所述跨集群云平台对应的集群。Through the embedded connection, the application package in the application package warehouse is delivered to the cluster corresponding to the cross-cluster cloud platform.2.根据权利要求1所述的应用管理方法,其特征在于,所述根据所述待部署组件和所述目标脚本,在跨集群云平台上安装待部署组件包括:2. The application management method according to claim 1, wherein the installation of the component to be deployed on the cross-cluster cloud platform according to the component to be deployed and the target script comprises:在跨集群云平台与所述目标脚本的版本匹配的情况下,在跨集群云平台对应的任务列表中添加所述待部署组件对应的开关;In the case where the cross-cluster cloud platform matches the version of the target script, add a switch corresponding to the component to be deployed in the task list corresponding to the cross-cluster cloud platform;通过所述开关及预设任务集,在跨集群云平台上安装待部署组件。Through the switch and the preset task set, the components to be deployed are installed on the cross-cluster cloud platform.3.根据权利要求1所述的应用管理方法,其特征在于,所述应用管理方法还包括:3. The application management method according to claim 1, further comprising:根据所述跨集群云平台对应的集群的资源类型,确定各所述集群的状态;Determine the state of each cluster according to the resource type of the cluster corresponding to the cross-cluster cloud platform;根据各所述集群的状态,通过集群标准集对各所述集群进行管理。According to the state of each of the clusters, each of the clusters is managed through a cluster standard set.4.根据权利要求1所述的应用管理方法,其特征在于,所述建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接包括:4. The application management method according to claim 1, wherein said establishing the embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform comprises:通过预设集群认证及配置所述应用包仓库,建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接。Through preset cluster authentication and configuration of the application package warehouse, an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform is established.5.根据权利要求1所述的应用管理方法,其特征在于,所述待部署组件包括第一组件和第二组件;所述创建待部署组件的目标脚本包括:5. The application management method according to claim 1, wherein the component to be deployed comprises a first component and a second component; the target script for creating the component to be deployed comprises:通过运维自动化工具和预设插件方式在跨集群云平台上部署所述第一组件;Deploying the first component on a cross-cluster cloud platform by means of an operation and maintenance automation tool and a preset plug-in;通过软件包管理工具部署所述第二组件;deploying the second component through a software package management tool;在所述第一组件和所述第二组件部署的情况下,创建所述第一组件的第一脚本和所述第二组件的第二脚本。In case the first component and the second component are deployed, a first script of the first component and a second script of the second component are created.6.根据权利要求1所述的应用管理方法,其特征在于,所述将所述应用包仓库中的应用包下发到所述跨集群云平台对应的集群包括:6. The application management method according to claim 1, wherein delivering the application package in the application package warehouse to the cluster corresponding to the cross-cluster cloud platform comprises:确定所述应用包仓库中的待下发应用包;determining the application packages to be delivered in the application package repository;获取所述待下发应用包对应的项目标识,以及所述跨集群云平台对应的与所述项目标识绑定的目标集群;Acquiring the project identifier corresponding to the application package to be delivered, and the target cluster bound to the project identifier corresponding to the cross-cluster cloud platform;将所述待下发应用包下发到所述目标集群。Delivering the application package to be delivered to the target cluster.7.一种应用管理装置,其特征在于,包括:7. An application management device, comprising:组件安装模块,用于创建待部署组件的目标脚本,根据所述待部署组件和所述目标脚本,在跨集群云平台上安装待部署组件;The component installation module is used to create the target script of the component to be deployed, and install the component to be deployed on the cross-cluster cloud platform according to the component to be deployed and the target script;嵌入连接建立模块,用于建立所述待部署组件对应的应用包仓库与所述跨集群云平台之间的嵌入连接;An embedded connection establishing module, configured to establish an embedded connection between the application package warehouse corresponding to the component to be deployed and the cross-cluster cloud platform;应用包下发模块,用于通过所述嵌入连接,将所述应用包仓库中的应用包下发到所述跨集群云平台对应的集群。An application package delivery module, configured to deliver the application package in the application package warehouse to the cluster corresponding to the cross-cluster cloud platform through the embedded connection.8.一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1至6任一项所述应用管理方法。8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor according to claim 1 is implemented when executing the program. The application management method described in any one of to 6.9.一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述应用管理方法。9. A non-transitory computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the application management method according to any one of claims 1 to 6 is implemented.10.一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述应用管理方法。10. A computer program product, comprising a computer program, characterized in that, when the computer program is executed by a processor, the application management method according to any one of claims 1 to 6 is realized.
CN202211339194.9A2022-10-282022-10-28Application management method, device, equipment, medium and computer program productPendingCN115904404A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202211339194.9ACN115904404A (en)2022-10-282022-10-28Application management method, device, equipment, medium and computer program product

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202211339194.9ACN115904404A (en)2022-10-282022-10-28Application management method, device, equipment, medium and computer program product

Publications (1)

Publication NumberPublication Date
CN115904404Atrue CN115904404A (en)2023-04-04

Family

ID=86490325

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202211339194.9APendingCN115904404A (en)2022-10-282022-10-28Application management method, device, equipment, medium and computer program product

Country Status (1)

CountryLink
CN (1)CN115904404A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116506437A (en)*2023-05-062023-07-28中国人民解放军国防科技大学Simulation application mixed layout system and method based on simulation cloud application market
CN118860670A (en)*2024-09-252024-10-29浪潮云信息技术股份公司 A kind of automatic management and optimization method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116506437A (en)*2023-05-062023-07-28中国人民解放军国防科技大学Simulation application mixed layout system and method based on simulation cloud application market
CN118860670A (en)*2024-09-252024-10-29浪潮云信息技术股份公司 A kind of automatic management and optimization method and device
CN118860670B (en)*2024-09-252025-01-24浪潮云信息技术股份公司 A kind of automatic management and optimization method and device

Similar Documents

PublicationPublication DateTitle
CN115292026B (en)Management method, device and equipment of container cluster and computer readable storage medium
CN110752947B (en)K8s cluster deployment method and device, and deployment platform
CN109120678B (en)Method and apparatus for service hosting of distributed storage system
US10613788B2 (en)Data migration between cloud storage systems
US8615588B2 (en)Accelerate copying of virtual machine images
CN108984179B (en) A kind of compiling processing method and device under Linux
CN112564979B (en)Execution method and device of construction task, computer equipment and storage medium
CN113626286A (en)Multi-cluster instance processing method and device, electronic equipment and storage medium
CN115499308B (en)Distributed FTP container deployment method, device, terminal and storage medium
CN115904404A (en)Application management method, device, equipment, medium and computer program product
US20150012669A1 (en)Platform runtime abstraction
CN116860266A (en)Application containerized deployment method and device, electronic equipment and storage medium
US8938490B2 (en)System and method for accessing mainframe system automation from a process automation application
CN105404530B (en)It is a kind of to realize easy deployment and the system and method using private clound
CN113254156A (en)Container group deployment method and device, electronic equipment and storage medium
CN114896027A (en)Method, terminal, medium, and program for pipeline cross-cluster deployment application
CN115129250B (en) Object storage method, device and readable storage medium
CN113805858A (en)Method and device for continuously deploying software developed by scripting language
CN116225617A (en)Management migration method and device for container instance, electronic equipment and storage medium
CN115480910A (en)Multi-cluster resource management method and device and electronic equipment
CN114416290B (en)Method and equipment for automatically building container platform based on onsible
CN114747180B (en) Method for realizing cloud host permission linkage for cloud host and cloud bastion host
CN116737662A (en)Method, device, electronic equipment and storage medium for processing business data
CN116541035A (en)Method, system, equipment and medium for upgrading container orchestration engine
CN114564211A (en)Cluster deployment method, cluster deployment device, equipment and medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp