[go: up one dir, main page]

CN114598484A - Certificate updating method, device, cluster and storage medium - Google Patents

Certificate updating method, device, cluster and storage medium Download PDF

Info

Publication number
CN114598484A
CN114598484A CN202011399522.5A CN202011399522A CN114598484A CN 114598484 A CN114598484 A CN 114598484A CN 202011399522 A CN202011399522 A CN 202011399522A CN 114598484 A CN114598484 A CN 114598484A
Authority
CN
China
Prior art keywords
certificate
cluster
service cluster
resource
update
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.)
Granted
Application number
CN202011399522.5A
Other languages
Chinese (zh)
Other versions
CN114598484B (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.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software 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 China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202011399522.5A priority Critical patent/CN114598484B/en
Publication of CN114598484A publication Critical patent/CN114598484A/en
Application granted granted Critical
Publication of CN114598484B publication Critical patent/CN114598484B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0823Network architectures or network communication protocols for network security for authentication of entities using certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the application discloses a certificate updating method, a certificate updating device, a cluster and a storage medium, wherein the method comprises the following steps: acquiring the validity period of the certificate of each service cluster in the sub-resource pool; determining the service cluster with the validity period not meeting the preset condition as a target service cluster; sending an access request to the target service cluster; and after the target service cluster receives the access request, triggering the target service cluster to complete certificate updating through the jobtype resource. The technical scheme provided by the embodiment of the application improves the management performance of the handling control and the system for the expired service cluster certificate, achieves the purpose of service cluster management, greatly reduces the operation and maintenance cost, and improves the satisfaction degree of users.

Description

一种证书更新方法、装置、集群及存储介质A certificate updating method, device, cluster and storage medium

技术领域technical field

本申请实施例涉及软件领域,涉及但不限于一种证书更新方法、装置、集群及存储介质。The embodiments of the present application relate to the field of software, and relate to, but are not limited to, a method, apparatus, cluster, and storage medium for updating a certificate.

背景技术Background technique

在kubernetes云平台中,出于安全性考虑,默认证书的有效期是1年,因此依赖于kubernetes集群部署的产品或者业务集群,都存在证书过期不可用而影响业务的问题。In the kubernetes cloud platform, for security reasons, the validity period of the default certificate is 1 year. Therefore, products or business clusters that rely on the kubernetes cluster deployment have the problem that the certificate expires and becomes unavailable, which affects the business.

基于这样的问题,社区官方出台了对应的手动更新证书的方法,主要是依赖于特定的工具kubeadm,由人工手动完成证书的更新及对应配置文件的更新,然后重启集群中各节点的服务,从而保障集群的可用。这种方式需要专门的运维流程,管理集群证书,及针对过期集群进行的更新证书的操作流程,流程步骤比较繁杂,且容易出错。在集群节点数量比较多的情况下,更新证书的流程将变得更加不可控且效率低下。Based on this problem, the community officially introduced a corresponding method of manually updating the certificate, mainly relying on the specific tool kubeadm, manually completing the update of the certificate and the update of the corresponding configuration file, and then restarting the services of each node in the cluster, thereby Guarantee the availability of the cluster. This method requires a special operation and maintenance process, the management of cluster certificates, and the operation process of updating certificates for expired clusters. The process steps are complicated and error-prone. In the case of a large number of cluster nodes, the process of renewing certificates will become more uncontrollable and inefficient.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本申请实施例为解决现有技术中存在的至少一个问题而提供一种证书更新方法、装置、集群及存储介质,至少解决了现有技术由人工手动完成证书的更新更新带来的不可控问题和,在集群节点数量比较多的情况下,更新证书的流程不可控且效率低下的问题。In view of this, the embodiments of the present application provide a certificate update method, device, cluster and storage medium to solve at least one problem in the prior art, which at least solves the problem caused by manually completing the update and update of the certificate in the prior art. The problem of uncontrollable problems and, in the case of a large number of cluster nodes, the process of updating the certificate is uncontrollable and inefficient.

本申请实施例的技术方案是这样实现的:The technical solutions of the embodiments of the present application are implemented as follows:

第一方面,本申请实施例提供一种证书更新方法,包括:获取子资源池中每一业务集群的证书的有效期;将有效期不满足预设条件的业务集群确定为目标业务集群;向所述目标业务集群发送访问请求;在所述目标业务集群接收所述访问请求后,通过job类型的资源触发所述目标业务集群完成证书更新。In a first aspect, an embodiment of the present application provides a method for updating a certificate, including: acquiring the validity period of a certificate of each service cluster in a sub-resource pool; determining a service cluster whose validity period does not meet a preset condition as a target service cluster; The target service cluster sends an access request; after the target service cluster receives the access request, the target service cluster is triggered to complete the certificate update through a resource of job type.

第二方面,本申请实施例提供一种证书更新方法,包括:接收管理集群发送的访问请求;响应所述访问请求,接收所述管理集群发送的job类型的资源;利用job类型的资源获取证书更新包;运行所述证书更新包以完成证书更新。In a second aspect, an embodiment of the present application provides a method for updating a certificate, including: receiving an access request sent by a management cluster; in response to the access request, receiving a resource of a job type sent by the management cluster; and using the resource of the job type to obtain a certificate Update package; run the certificate update package to complete the certificate update.

第三方面,本申请实施例提供一种证书更新装置,包括:访问缓存模块,用于获取子资源池中每一业务集群的证书的有效期;证书管理模块,用于将有效期不满足条件的业务集群确定为目标业务集群;所述访问缓存模块,还用于向所述目标业务集群发送访问请求;所述证书管理模块,还用于在所述目标业务集群接收所述访问请求后,通过job类型的资源触发所述目标业务集群完成证书更新。In a third aspect, an embodiment of the present application provides a certificate update device, including: an access cache module for acquiring the validity period of a certificate for each service cluster in a sub-resource pool; a certificate management module for updating services whose validity period does not meet a condition The cluster is determined to be the target business cluster; the access cache module is further configured to send an access request to the target business cluster; the certificate management module is further configured to, after the target business cluster receives the access request, use the job The type of resource triggers the target service cluster to complete the certificate update.

第四方面,本申请实施例提供一种证书更新装置,包括:第一接收模块,用于业务集群接收管理集群发送的访问请求;第二接收模块,用于响应所述访问请求,所述业务集群接收所述管理集群发送的job类型的资源;获取模块,用于所述业务集群利用job类型的资源获取证书更新包;运行模块,用于所述业务集群运行所述证书更新包以完成证书更新。In a fourth aspect, an embodiment of the present application provides an apparatus for updating a certificate, including: a first receiving module, used for a service cluster to receive an access request sent by a management cluster; a second receiving module, used for responding to the access request, the service The cluster receives the resource of the job type sent by the management cluster; the obtaining module is used for the business cluster to obtain the certificate update package by using the resource of the job type; the operation module is used for the business cluster to run the certificate update package to complete the certificate renew.

第五方面,本申请实施例提供一种计算机集群,包括存储器和处理器,所述存储器存储有可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述方法的证书更新方法。In a fifth aspect, an embodiment of the present application provides a computer cluster, including a memory and a processor, the memory stores a computer program that can be run on the processor, and the processor implements the certificate update of the above method when the program executes method.

第六方面,本申请实施例提供一种计算机存储介质,存储有可执行指令,用于引起处理器执行时,实现上述方法的证书更新方法。In a sixth aspect, an embodiment of the present application provides a computer storage medium storing executable instructions for implementing the certificate updating method of the above method when the processor is caused to execute.

本申请实施例提供一种证书更新方法、装置、集群及存储介质,首先管理集群获取对应的子资源池中每一业务集群的证书的有效期,然后将有效期不满足条件的业务集群确定为目标业务集群,最后通过在所述目标业务集群中创建job类型的资源以完成证书更新。这样,管理集群可以有效的确定证书即将过期的业务集群,及时通过在所述目标业务集群中创建job类型的资源以完成证书更新,提升对于业务集群证书过期的把控和系统的管理性能,达到了对业务集群管理的目的,大大减低了运维的成本,提升了用户的满意度。The embodiments of the present application provide a certificate update method, device, cluster, and storage medium. First, the management cluster obtains the validity period of the certificate of each service cluster in the corresponding sub-resource pool, and then determines the service cluster whose validity period does not meet the conditions as the target service Cluster, and finally complete the certificate update by creating a job type resource in the target business cluster. In this way, the management cluster can effectively determine the business cluster whose certificate is about to expire, and complete the certificate update by creating a job type resource in the target business cluster in a timely manner. For the purpose of business cluster management, the cost of operation and maintenance is greatly reduced, and the satisfaction of users is improved.

附图说明Description of drawings

图1为本申请实施例提供的一种证书更新方法的实现流程示意图;FIG. 1 is a schematic flowchart of the implementation of a method for updating a certificate according to an embodiment of the present application;

图2A为本申请实施例提供的一种证书更新总体架构的示意图;FIG. 2A is a schematic diagram of an overall architecture of certificate update provided by an embodiment of the present application;

图2B为本申请实施例提供的一种证书更新方法的实现流程示意图;FIG. 2B is a schematic diagram of an implementation flow of a certificate updating method provided by an embodiment of the present application;

图3为本申请实施例提供的一种证书更新方法的实现流程示意图;3 is a schematic diagram of the implementation flow of a certificate updating method provided by an embodiment of the present application;

图4A为本申请实施例提供的一种证书更新方法的实现流程示意图;4A is a schematic diagram of an implementation flow of a certificate updating method provided by an embodiment of the present application;

图4B为本申请实施例提供一种节点证书更新方法的实现流程示意图;FIG. 4B provides a schematic flowchart of an implementation of a method for updating a node certificate according to an embodiment of the present application;

图5A为本申请实施例提供的证书更新装置的组成结构示意图;FIG. 5A is a schematic diagram of the composition and structure of a certificate updating apparatus provided by an embodiment of the present application;

图5B为本申请实施例提供的证书更新装置的组成结构示意图;FIG. 5B is a schematic diagram of the composition and structure of the certificate updating apparatus provided by the embodiment of the present application;

图6为本申请实施例提供的计算机集群的一种硬件实体示意图。FIG. 6 is a schematic diagram of a hardware entity of a computer cluster provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.

应当理解,此处所描述的一些实施例仅仅用以解释本申请的技术方案,并不用于限定本申请的技术范围。It should be understood that some embodiments described herein are only used to explain the technical solutions of the present application, and are not used to limit the technical scope of the present application.

本申请实施例提供的一种证书更新方法,如图1所示,该方法包括:A method for updating a certificate provided by an embodiment of the present application, as shown in FIG. 1 , includes:

步骤S101、获取子资源池中每一业务集群的证书的有效期;Step S101, obtaining the validity period of the certificate of each business cluster in the sub-resource pool;

业务集群指用户创建的各集群,这些集群为用户所有。一个子资源池中可以包含至少一个业务集群。对应不同的子资源池部署不同的管理集群,每套管理集群管理对应管理子资源池中的业务集群。这里业务集群的证书包括证书颁发机构(CertificateAuthority,CA)、电子证书(CA key)、客户端认证(Client)等证书。这里,证书的有效期指在有效期内证书可以正常使用不影响业务集群的业务,如果证书使用的时间超出了有效期,业务集群则不能正在开展业务。管理集群可以用于管理对应业务集群的证书的有效期。管理集群需要获取对应的子资源池中每一业务集群的证书的有效期。Business clusters refer to clusters created by users, and these clusters are owned by users. A sub-resource pool can contain at least one business cluster. Deploy different management clusters corresponding to different sub-resource pools, and each management cluster manages the corresponding business clusters in the management sub-resource pools. The certificate of the business cluster here includes certificates such as a certificate authority (Certificate Authority, CA), an electronic certificate (CA key), and a client authentication (Client). Here, the validity period of the certificate means that the certificate can be used normally within the validity period and does not affect the service of the service cluster. If the time of use of the certificate exceeds the validity period, the service cluster cannot conduct business. The management cluster can be used to manage the validity period of the certificate of the corresponding service cluster. The management cluster needs to obtain the validity period of the certificate of each business cluster in the corresponding sub-resource pool.

步骤S102、将有效期不满足预设条件的业务集群确定为目标业务集群;Step S102, determining a service cluster whose validity period does not meet a preset condition as a target service cluster;

证书有效期不满足条件,条件可以指有效时长,即在有效期不满足有效时长的情况下,也就是说证书距离到期时间还有一定时长的情况下,管理集群将不满足条件的业务集群确定为目标业务集群,即,管理集群将证书距离到期时间还有一定时长的业务集群确定为目标业务集群。例如:将证书有效期将要过期3个月内的业务集群信息,及时通知用户。如果用户侧没有在特定时间内在平台发起自动更新流程,则在业务集群的证书有效期过期前的1天,发起业务集群证书的更新流程。管理集群通过向业务集群发送访问请求,请求业务集群进行业务集群证书更新。The validity period of the certificate does not meet the conditions, and the conditions can refer to the validity period, that is, if the validity period does not meet the validity period, that is to say, if the certificate has a certain period of time before the expiration time, the management cluster will determine the business cluster that does not meet the conditions as The target business cluster, that is, the management cluster determines the business cluster whose certificate has a certain period of time to expire as the target business cluster. For example, notify users of the business cluster information that the certificate validity period will expire within 3 months. If the user side does not initiate an automatic update process on the platform within a specific time, the update process of the service cluster certificate is initiated 1 day before the validity period of the service cluster certificate expires. The management cluster requests the business cluster to update the business cluster certificate by sending an access request to the business cluster.

步骤S103、向所述目标业务集群发送访问请求;Step S103, sending an access request to the target service cluster;

步骤S104、在所述目标业务集群接收所述访问请求后,通过job类型的资源触发所述目标业务集群完成证书更新。Step S104: After the target service cluster receives the access request, trigger the target service cluster to complete the certificate update through a resource of job type.

这里,job类型的资源指的就是一次性任务。通过job运行一个容器,当其任务执行完以后,就自动退出,集群也不再重新将其唤醒。通过在目标业务集群中创建job类型的资源并运行对应的脚本可以完成证书更新。Here, a resource of type job refers to a one-time task. Running a container through a job will automatically exit when its task is completed, and the cluster will not wake it up again. The certificate update can be completed by creating a job type resource in the target business cluster and running the corresponding script.

本申请实施例中,首先管理集群获取对应的子资源池中每一业务集群的证书的有效期,然后将有效期不满足条件的业务集群确定为目标业务集群,最后通过在所述目标业务集群中创建job类型的资源以完成证书更新。这样,管理集群可以有效的确定证书即将过期的业务集群,及时通过在所述目标业务集群中创建job类型的资源以完成证书更新,提升对于业务集群证书过期的把控和系统的管理性能,达到了对业务集群管理的目的,大大减低了运维的成本,提升了用户的满意度。In the embodiment of the present application, the management cluster first obtains the validity period of the certificate of each business cluster in the corresponding sub-resource pool, then determines the business cluster whose validity period does not meet the conditions as the target business cluster, and finally creates a business cluster in the target business cluster by creating A resource of type job to complete the certificate update. In this way, the management cluster can effectively determine the business cluster whose certificate is about to expire, and complete the certificate update by creating a job type resource in the target business cluster in a timely manner. For the purpose of business cluster management, the cost of operation and maintenance is greatly reduced, and the satisfaction of users is improved.

本申请实施例提供的一种证书更新方法,该方法包括:A method for updating a certificate provided by an embodiment of the present application, the method includes:

步骤S111、确定资源池中每一所述业务集群所属的位置;Step S111, determining the location to which each of the service clusters in the resource pool belongs;

位置可以指的是地址位置,比如华南、华北、华中等地理位置,也可以指以公网IP的前3位不同的进行划分的虚拟位置。每一业务集群都会部署在不同的位置,管理集群可以先确定资源池中每一业务集群所属的位置。The location may refer to an address location, such as the geographic location of South China, North China, and Central China, or it may refer to a virtual location divided by the first three digits of the public network IP. Each business cluster will be deployed in a different location. The management cluster can first determine the location of each business cluster in the resource pool.

步骤S112、根据每一所述业务集群所属的位置,对所述资源池进行划分,得到至少一个子资源池;Step S112, dividing the resource pool according to the location to which each of the service clusters belongs to obtain at least one sub-resource pool;

这里,指的是将资源池中业务集群属于同一位置的业务集群划分为一个子资源池。管理集群根据每一所述业务集群所属的位置,将所述资源池划分为至少一个子资源池。Here, it refers to dividing the service clusters in the resource pool that belong to the same location into a sub-resource pool. The management cluster divides the resource pool into at least one sub-resource pool according to the location to which each of the service clusters belongs.

步骤S113、为所述至少一个子资源池中的每一子资源池确定对应的管理集群;Step S113, determining a corresponding management cluster for each sub-resource pool in the at least one sub-resource pool;

为至少一个子资源池中的每一子资源池确定对应的管理集群,可以解决大规模的用户集群问题,每个子资源池的服务资源及能力,存在理论上的上限值,通过在不同子资源池部署对应的管理集群,达到资源分治而高效处理的目的。Determining the corresponding management cluster for each sub-resource pool in at least one sub-resource pool can solve the problem of large-scale user clusters. The service resources and capabilities of each sub-resource pool have a theoretical upper limit. The resource pool deploys the corresponding management cluster to achieve the purpose of resource division and efficient processing.

步骤S114、获取对应的子资源池中每一业务集群的证书的有效期;Step S114, obtaining the validity period of the certificate of each business cluster in the corresponding sub-resource pool;

步骤S115、将有效期不满足预设条件的业务集群确定为目标业务集群;Step S115, determining the service cluster whose validity period does not meet the preset condition as the target service cluster;

步骤S116、向所述目标业务集群发送访问请求;Step S116, sending an access request to the target service cluster;

步骤S117、在所述目标业务集群接收所述访问请求后,通过job类型的资源触发所述目标业务集群完成证书更新。Step S117: After the target service cluster receives the access request, trigger the target service cluster to complete the certificate update through a resource of job type.

本申请实施例中,管理集群根据资源池中业务集群的位置划分为至少一个子资源池,可以解决大规模的用户集群问题,每个子资源池的服务资源及能力,存在理论上的上限值,通过在不同子资源池部署管理集群的服务,达到资源分治而高效处理的目的。In the embodiment of the present application, the management cluster is divided into at least one sub-resource pool according to the position of the business cluster in the resource pool, which can solve the problem of large-scale user clusters. The service resources and capabilities of each sub-resource pool have a theoretical upper limit. , by deploying and managing cluster services in different sub-resource pools, to achieve the purpose of resource division and efficient processing.

图2A为本申请实施例提供的一种证书更新总体架构的示意图,如图2A所示,该证书更新总体架构包括:管理集群201业务集群202。其中,管理集群201,用于根据业务集群位置进行划分,主要是解决大规模的用户集群问题,每个子资源池的服务资源及能力,存在理论上的上限值,通过在不同子资源池部署管理集群的服务,达到资源分治而高效处理的目的;管理集群201包括证书管理模块2011和访问缓存模块2012,其中,证书管理模块2011,用于处理对于业务集群证书的创建、更新过程,即通过这个模块,可以实现对集群证书的过期时间的管理;访问缓存模块2012,用于监听业务集群的证书过期时间,等业务集群状态正常后采集高可用集群的访问信息,并将采集到的访问信息同步到访问缓存模块2012,用于业务集群的访问,可以实现实时更新的路由功能。业务集群202指用户创建的各集群,这些集群为用户所有。运维侧无法通过密码方式访问上去,即业务集群202对运维用户屏蔽,保障用户集群的安全性。FIG. 2A is a schematic diagram of a certificate update overall architecture provided by an embodiment of the present application. As shown in FIG. 2A , the certificate update overall architecture includes: a management cluster 201 and a service cluster 202 . Among them, the management cluster 201 is used to divide the business cluster according to the location, mainly to solve the problem of large-scale user clusters. The service resources and capabilities of each sub-resource pool have a theoretical upper limit. By deploying in different sub-resource pools The service of the management cluster achieves the purpose of resource division and efficient processing; the management cluster 201 includes a certificate management module 2011 and an access cache module 2012, wherein the certificate management module 2011 is used to process the creation and update process of the business cluster certificate, namely Through this module, the management of the expiration time of the cluster certificate can be realized; the access cache module 2012 is used to monitor the certificate expiration time of the business cluster, collect the access information of the high-availability cluster after the business cluster is in a normal state, and store the collected access information. The information is synchronized to the access cache module 2012, which is used for the access of the business cluster, and can realize the routing function of real-time update. The service cluster 202 refers to each cluster created by the user, and these clusters are owned by the user. The operation and maintenance side cannot be accessed by password, that is, the business cluster 202 shields the operation and maintenance users to ensure the security of the user cluster.

本申请实施例提供的一种证书更新方法,其中,所述管理集群包括访问缓存模块和证书管理模块,如图2B所示,该方法包括:A certificate update method provided by an embodiment of the present application, wherein the management cluster includes an access cache module and a certificate management module, as shown in FIG. 2B , the method includes:

步骤S201、所述访问缓存模块获取对应的子资源池中每一业务集群的证书的有效期;Step S201, the access cache module obtains the validity period of the certificate of each business cluster in the corresponding sub-resource pool;

如图2A所示,管理集群201包括证书管理模块2011和访问缓存模块2012,访问缓存模块2012用于获取对应的每一业务集群202的证书,这里,访问缓存模块2012可以将获取到的业务集群202的证书存放到证书管理模块2011,并实时更新证书,以使得证书管理模块2011中的证书与业务集群202的证书保持一致。例如:在创建业务集群202的过程中,提前将业务集群依赖的CA、CA key、Client等证书生成好,和业务集群部署过程中的CA、CA key证书保持一致,并通过访问缓存模块2012获取到证书的有效期,保存至证书管理模块。As shown in FIG. 2A , the management cluster 201 includes a certificate management module 2011 and an access cache module 2012. The access cache module 2012 is used to obtain the corresponding certificate of each service cluster 202. Here, the access cache module 2012 can store the obtained service cluster The certificate of 202 is stored in the certificate management module 2011, and the certificate is updated in real time, so that the certificate in the certificate management module 2011 is consistent with the certificate of the business cluster 202. For example: in the process of creating the business cluster 202, the certificates such as CA, CA key, and Client that the business cluster depends on are generated in advance, which are consistent with the CA and CA key certificates in the business cluster deployment process, and are obtained by accessing the cache module 2012. To the validity period of the certificate, save it to the certificate management module.

步骤S202、在所述证书管理模块确定所述有效期不满足条件的情况下,所述证书管理模块将有效期不满足条件的业务集群确定为目标业务集群;Step S202, when the certificate management module determines that the validity period does not meet the condition, the certificate management module determines the service cluster whose validity period does not meet the condition as the target service cluster;

所述证书管理模块通过定期在证书管理模块中查询业务集群的证书有效期,确定有效期不满足条件的业务集群为目标业务集群。The certificate management module regularly checks the certificate validity period of the business cluster in the certificate management module, and determines the business cluster whose validity period does not meet the condition as the target business cluster.

步骤S203、所述访问缓存模块向所述目标业务集群发送访问请求;Step S203, the access cache module sends an access request to the target service cluster;

步骤S204、在所述目标业务集群接收所述访问请求后,所述证书管理模块通过在所述目标业务集群中创建job类型的资源以完成证书更新。Step S204: After the target service cluster receives the access request, the certificate management module completes the certificate update by creating a resource of job type in the target service cluster.

这里,访问缓存模块保存了目标业务集群的访问信息,即,访问缓存模块保存了目标业务集群的访问路由,访问缓存模块相当于实现了可以实时更新的路由功能。证书管理模块通过访问缓存模块在所述目标业务集群中创建job类型的资源以完成证书更新。Here, the access cache module saves the access information of the target service cluster, that is, the access cache module saves the access route of the target service cluster, and the access cache module is equivalent to realizing a routing function that can be updated in real time. The certificate management module creates a job type resource in the target business cluster by accessing the cache module to complete the certificate update.

本申请实施例中,管理集群包括访问缓存模块和证书管理模块,描述了在监听和更新证书时,访问缓存模块和证书管理模块的作用。这样,将管理集群按照不同的功能划分为访问缓存模块和证书管理模块,可以实现两个模块合理分工,高效实现对于业务集群证书合理管控,提升用户对于业务集群过期的把控。In the embodiment of the present application, the management cluster includes an access cache module and a certificate management module, and the functions of the access cache module and the certificate management module are described when monitoring and updating certificates. In this way, the management cluster is divided into the access cache module and the certificate management module according to different functions, which can realize a reasonable division of labor between the two modules, effectively realize the reasonable management and control of the business cluster certificate, and improve the user's control over the expiration of the business cluster.

本申请实施例提供的一种证书更新方法,所述管理集群包括访问缓存模块和证书管理模块,该方法包括:In a certificate update method provided by an embodiment of the present application, the management cluster includes an access cache module and a certificate management module, and the method includes:

步骤S211、所述访问缓存模块获取每一所述业务集群的证书的有效期,并保存在所述证书管理模块中;Step S211, the access cache module obtains the validity period of the certificate of each of the business clusters, and saves it in the certificate management module;

步骤S212、所述访问缓存模块通过访问所述证书管理模块,获取所述业务集群的证书有效期;Step S212, the access cache module obtains the validity period of the certificate of the service cluster by accessing the certificate management module;

这里,因为证书管理模块中保存了业务集群的证书的有效期,所以访问缓存模块可以通过访问证书管理模块来获取业务集群的证书有效期。Here, because the validity period of the certificate of the business cluster is stored in the certificate management module, the access cache module can obtain the validity period of the certificate of the business cluster by accessing the certificate management module.

步骤S213、所述证书管理模块确定每一所述证书的剩余有效时长;Step S213, the certificate management module determines the remaining validity period of each certificate;

这里,证书的剩余有效时长指的是证书距离有效期过期剩余的时长,访问模块需要根据证书的有效期来确定每一证书的剩余有效时长。Here, the remaining validity period of the certificate refers to the remaining period of validity until the certificate expires, and the access module needs to determine the remaining valid period of each certificate according to the validity period of the certificate.

步骤S214、在所述证书管理模块确定所述剩余有效时长在特定时长内的情况下,将剩余有效时长在特定时长内的证书对应的业务集群确定为目标业务集群;Step S214, in the case that the certificate management module determines that the remaining valid duration is within a specific duration, determine the service cluster corresponding to the certificate whose remaining valid duration is within the specified duration as the target service cluster;

这里特定时长可以由用户根据实际情况来设置。例如可以设置特定时长为1天,那么在访问缓存模块确定证书剩余有效时长为1天的业务集群为目标业务集群。The specific duration here can be set by the user according to the actual situation. For example, the specific duration can be set to 1 day, then the service cluster whose certificate has a remaining valid duration of 1 day is determined by the access cache module as the target service cluster.

步骤S215、所述访问缓存模块向所述目标业务集群发送访问请求;Step S215, the access cache module sends an access request to the target service cluster;

步骤S216、在所述目标业务集群接收所述访问请求后,所述证书管理模块通过在所述目标业务集群中创建job类型的资源以完成证书更新。Step S216: After the target service cluster receives the access request, the certificate management module completes the certificate update by creating a resource of job type in the target service cluster.

本申请实施例中,访问缓存模块通过确定每一所述证书的剩余有效时长来确定目标业务集群,用户根据实际情况设置特定时长,可以达到及时更新将要过期证书的效果,满足用户的实际需求。In the embodiment of the present application, the access cache module determines the target service cluster by determining the remaining valid duration of each of the certificates, and the user sets a specific duration according to the actual situation, which can achieve the effect of updating the expired certificate in time and meet the actual needs of the user.

本申请实施例提供的一种证书更新方法,所述管理集群包括访问缓存模块和证书管理模块,所述特定时长包括第一时长,该方法包括:In a certificate update method provided by an embodiment of the present application, the management cluster includes an access cache module and a certificate management module, the specific duration includes a first duration, and the method includes:

步骤S221、所述访问缓存模块获取每一所述业务集群的证书的有效期,并保存在所述证书管理模块中;Step S221, the access cache module obtains the validity period of the certificate of each of the business clusters, and saves it in the certificate management module;

步骤S222、所述访问缓存模块通过访问所述证书管理模块,获取所述业务集群的证书有效期;Step S222, the access cache module obtains the certificate validity period of the service cluster by accessing the certificate management module;

步骤S223、所述证书管理模块确定每一所述证书的剩余有效时长;Step S223, the certificate management module determines the remaining validity period of each certificate;

步骤S224、所述证书管理模块获取预先设定的所述第一时长,将剩余有效时长在所述第一时长内的证书对应的业务集群确定为目标业务集群;Step S224, the certificate management module obtains the preset first duration, and determines the service cluster corresponding to the certificate whose remaining valid duration is within the first duration as the target service cluster;

这里,第一时长可以根据用户的实际需求进行设置。例如可以设置第一时长为1天,那么将余有效时长为1天要的证书对应的业务集群确定为目标业务集群。Here, the first duration may be set according to the actual needs of the user. For example, the first duration can be set to 1 day, then the service cluster corresponding to the certificate whose remaining valid duration is 1 day is determined as the target service cluster.

步骤S225、所述访问缓存模块向所述目标业务集群发送访问请求;Step S225, the access cache module sends an access request to the target service cluster;

步骤S226、在所述目标业务集群接收所述访问请求后,所述证书管理模块通过在所述目标业务集群中创建job类型的资源以完成证书更新。Step S226: After the target service cluster receives the access request, the certificate management module completes the certificate update by creating a job type resource in the target service cluster.

本申请实施例中,描述了确定证书剩余有效时长在第一时长情况下,如何自动实现证书的更新,这样,可以实现在不需要人工干预的情况下,在证书即将到期的情况下,自动完成证书的更新。In the embodiment of this application, it is described how to automatically update the certificate when the remaining valid duration of the certificate is determined in the case of the first duration. Complete the renewal of the certificate.

本申请实施例提供的一种证书更新方法,所述管理集群包括访问缓存模块和证书管理模块,所述特定时长包括第二时长,所述第二时长大于所述第一时长,该方法包括:In a certificate update method provided by an embodiment of the present application, the management cluster includes an access cache module and a certificate management module, the specific duration includes a second duration, and the second duration is greater than the first duration, and the method includes:

步骤S231、所述访问缓存模块获取每一所述业务集群的证书的有效期,并保存在所述证书管理模块中;Step S231, the access cache module obtains the validity period of the certificate of each of the service clusters, and saves it in the certificate management module;

步骤S232、所述访问缓存模块通过访问所述证书管理模块,获取所述业务集群的证书有效期;Step S232, the access cache module obtains the validity period of the certificate of the service cluster by accessing the certificate management module;

步骤S233、所述证书管理模块确定每一所述证书的剩余有效时长;Step S233, the certificate management module determines the remaining valid duration of each certificate;

步骤S234、所述证书管理模块获取预先设定的所述第二时长,向剩余有效时长在所述第二时长内的证书对应的业务集群,发送通知消息,所述通知消息用于通知所述业务集群的用户所述证书需要更新;Step S234, the certificate management module obtains the preset second duration, and sends a notification message to the service cluster corresponding to the certificate whose remaining valid duration is within the second duration, where the notification message is used to notify the The certificate described by the user of the business cluster needs to be updated;

这里,第二时长大于第一时长。例如当第一时长确定为1天的情况下,第二时长可以确定为3个月。这样在访问缓存模块确定剩余有效时长在3个月的情况下发送通知消息,用于通知业务集群的用户证书需要更新,这时,用户可以选择手动更新证书或者使用本申请提供的方法自动更新证书。Here, the second duration is greater than the first duration. For example, when the first duration is determined to be 1 day, the second duration may be determined to be 3 months. In this way, when the access cache module determines that the remaining validity period is 3 months, a notification message is sent to notify the user that the certificate of the business cluster needs to be updated. At this time, the user can choose to manually update the certificate or use the method provided in this application to automatically update the certificate .

步骤S235、所述访问缓存模块向所述目标业务集群发送访问请求;Step S235, the access cache module sends an access request to the target service cluster;

步骤S236、在所述目标业务集群接收所述访问请求后,所述证书管理模块通过在所述目标业务集群中创建job类型的资源以完成证书更新。Step S236: After the target service cluster receives the access request, the certificate management module completes the certificate update by creating a job type resource in the target service cluster.

本申请实施例中,描述了确定证书剩余有效时长在第一时长情况下,如何发送通知消息,通知业务集群的用户证书需要更新。这样,用户收到通知消息后可以根据实际情况选择适合的证书更新方式,是一种更合理的业务集群证书管控方式,提升了用户对于业务集群证书过期的把控。不会出现集群更新瓶颈问题。对于每个集群证书的更新,开启单独的线程,完成更新,彼此互相不干扰。通过这种策略,业务集群的证书更新,可以实现分流又高效的处理。对于大规模用户的请求,首先被资源池分流,然后通过资源池的更新,又被不同用户所处的时间点,进行了分散。In the embodiment of the present application, it is described how to send a notification message to notify that the user certificate of the service cluster needs to be updated when the remaining valid duration of the certificate is determined to be the first duration. In this way, after receiving the notification message, the user can select an appropriate certificate update method according to the actual situation, which is a more reasonable management and control method for the business cluster certificate, and improves the user's control over the expiration of the business cluster certificate. There will be no cluster update bottlenecks. For each cluster certificate update, a separate thread is started to complete the update without interfering with each other. Through this strategy, the certificate update of the business cluster can be distributed and processed efficiently. For large-scale user requests, they are first distributed by the resource pool, and then distributed by the time points of different users through the update of the resource pool.

本申请实施例提供的一种证书更新方法,所述管理集群包括访问缓存模块和证书管理模块,该方法包括:In a certificate update method provided by an embodiment of the present application, the management cluster includes an access cache module and a certificate management module, and the method includes:

步骤S241、所述访问缓存模块获取对应的子资源池中每一业务集群的证书的有效期;Step S241, the access cache module obtains the validity period of the certificate of each business cluster in the corresponding sub-resource pool;

步骤S242、在所述证书管理模块确定所述有效期不满足条件的情况下,所述证书管理模块将有效期不满足条件的业务集群确定为目标业务集群;Step S242, when the certificate management module determines that the validity period does not meet the condition, the certificate management module determines the service cluster whose validity period does not meet the condition as the target service cluster;

步骤S243、所述访问缓存模块向所述目标业务集群发送访问请求;Step S243, the access cache module sends an access request to the target service cluster;

步骤S244、所述证书管理模块发送所述job类型的资源给所述目标业务集群,以使得所述业务集群根据所述job类型的资源完成证书更新;其中,所述job类型的资源是由所述证书管理模块生成。Step S244, the certificate management module sends the resource of the job type to the target business cluster, so that the business cluster completes the certificate update according to the resource of the job type; The certificate management module described above is generated.

本申请实施例中,证书管理模块通过问缓存模块发送job类型的资源给所述目标业务集群,以使得业务集群根据job类型的资源完成证书更新,可以高效实现更新证书的任务,从而大大降低了对用户业务的影响。In the embodiment of the present application, the certificate management module sends the resource of the job type to the target business cluster through the cache module, so that the business cluster can complete the certificate update according to the resource of the job type, and the task of updating the certificate can be efficiently realized, thereby greatly reducing the cost of Impact on user business.

本申请实施例提供的一种证书更新方法,所述管理集群包括访问缓存模块和证书管理模块,所述目标业务集群包括至少一个主节点和至少一个工作节点,该方法包括:In a certificate update method provided by an embodiment of the present application, the management cluster includes an access cache module and a certificate management module, the target service cluster includes at least one master node and at least one worker node, and the method includes:

步骤S251、所述访问缓存模块获取对应的子资源池中每一业务集群的证书的有效期;Step S251, the access cache module obtains the validity period of the certificate of each business cluster in the corresponding sub-resource pool;

步骤S252、在所述证书管理模块确定所述有效期不满足条件的情况下,所述证书管理模块将有效期不满足条件的业务集群确定为目标业务集群;Step S252, when the certificate management module determines that the validity period does not meet the condition, the certificate management module determines the service cluster whose validity period does not meet the condition as the target service cluster;

步骤S253、所述访问缓存模块向所述目标业务集群发送访问请求;Step S253, the access cache module sends an access request to the target service cluster;

步骤S254、所述证书管理模块从所述至少一个主节点中确定一个主节点为目标主节点;Step S254, the certificate management module determines one master node from the at least one master node as the target master node;

步骤S255、所述证书管理模块获取所述目标主节点对应的第一job类型的资源,将对应job类型的资源给所述目标主节点,以使得所述目标主节点根据所述第一job类型的资源以完成证书更新;Step S255, the certificate management module obtains the resource of the first job type corresponding to the target master node, and gives the resource corresponding to the job type to the target master node, so that the target master node can be based on the first job type. resources to complete the certificate renewal;

步骤S256、在所述目标主节点对应的证书完成更新的情况下,所述访问缓存模块确定除所述目标主节点上之外的其余主节点;所述访问缓存模块获取所述其余主节点对应第二job类型的资源,将所述第二job类型的资源给所述其余主节点,以使得所述其余主节点根据所述第二job类型的资源以完成证书更新;Step S256, in the case that the certificate corresponding to the target master node is updated, the access cache module determines the remaining master nodes except on the target master node; the access cache module obtains the corresponding master nodes of the remaining master nodes. resources of the second job type, giving the resources of the second job type to the remaining master nodes, so that the remaining master nodes can complete the certificate update according to the resources of the second job type;

步骤S257、在所述其余主节点对应的证书完成更新的情况下,所述访证书管理模块获取所述至少一个工作节点对应第三job类型的资源,将所述第三job类型的资源给所述至少一个工作节点,以使得所述至少一个工作节点根据所述第三job类型的资源以完成证书更新。Step S257, in the case that the certificates corresponding to the remaining master nodes are updated, the access certificate management module obtains the resources of the third job type corresponding to the at least one worker node, and gives the resources of the third job type to all the resources of the third job type. the at least one worker node, so that the at least one worker node completes the certificate update according to the resource of the third job type.

本申请实施例中,更新流程是先选择一个主节点更新证书,再更新剩余所有主节点的证书,最后更新工作节点的证书。这样,更新的过程均匀分散在每个节点上,保障每个节点运行更新证书的任务。从而充分利用了平台本身的调度策略,达到快速运行脚本的目的。从而大大较低了对用户业务的影响。In the embodiment of the present application, the update process is to first select a master node to update the certificate, then update the certificates of all remaining master nodes, and finally update the certificates of the worker nodes. In this way, the update process is evenly distributed on each node, ensuring that each node runs the task of updating the certificate. Thus, the scheduling strategy of the platform itself is fully utilized to achieve the purpose of running the script quickly. This greatly reduces the impact on user services.

本申请实施例提供的一种证书更新方法,应用于业务集群中,如图3所示,该方法包括:A certificate update method provided by an embodiment of the present application is applied to a business cluster. As shown in FIG. 3 , the method includes:

步骤S301、接收管理集群发送的访问请求;Step S301, receiving an access request sent by the management cluster;

步骤S302、响应所述访问请求,接收所述管理集群发送的job类型的资源;Step S302, in response to the access request, receiving the resource of the job type sent by the management cluster;

步骤S303、利用job类型的资源获取证书更新包;Step S303, using the resource of job type to obtain a certificate update package;

步骤S304、运行所述证书更新包以完成证书更新。Step S304, run the certificate update package to complete the certificate update.

本申请实施例中,业务集群根据job类型的资源完成证书更新,可以高效实现更新证书的任务,从而大大降低了对用户业务的影响。In the embodiment of the present application, the business cluster completes the certificate update according to the resource of the job type, which can efficiently realize the task of updating the certificate, thereby greatly reducing the impact on the user's business.

本申请实施例提供的一种证书更新方法,所述证书更新包包括脚本文件,该方法包括:A certificate update method provided by an embodiment of the present application, the certificate update package includes a script file, and the method includes:

步骤S311、业务集群接收管理集群发送的访问请求;Step S311, the service cluster receives the access request sent by the management cluster;

步骤S312、响应所述访问请求,所述业务集群接收所述管理集群发送的job类型的资源;Step S312, in response to the access request, the business cluster receives the resource of the job type sent by the management cluster;

步骤S313、所述业务集群利用job类型的资源获取证书更新包;Step S313, the business cluster obtains a certificate update package by using a resource of job type;

步骤S314、所述业务集群执行所述脚本文件完成以下操作:所述业务集群移除所述业务集群的证书信息,并备份自身的节点信息;所述业务集群配置kubelet,得到用于更新证书的kubelet;所述业务集群运行所述更新证书的kubelet以完成所述节点的证书更新。Step S314, the business cluster executes the script file to complete the following operations: the business cluster removes the certificate information of the business cluster and backs up its own node information; the business cluster configures kubelet, and obtains the information for updating the certificate. kubelet; the business cluster runs the kubelet for updating the certificate to complete the certificate update of the node.

在每个节点(node)上都要运行一个worker对容器进行生命周期的管理,这个worker程序就是kubelet。A worker must run on each node to manage the life cycle of the container. This worker program is the kubelet.

本申请实施例中,当管理集群发起对其中一台主节点的证书更新job,然后在业务集群该节点上,拉取对应的部署包,这里的部署包,即更新包,然后更新包中包含脚本及可执行程序。每个脚本的执行过程,包含步骤S314的执行过程,分别是做好对应的备份、移除工作,自动配置好对应的配置文件,然后执行更新,最后重启服务,最后更新好访问的配置文件。这样,业务集群证书的自动化更新的详细流程,不需要用户在云平台上具有相对的专业知识,只需要点击更新按钮,即可完成对于业务集群的证书更新。In the embodiment of this application, when the management cluster initiates a certificate update job for one of the master nodes, and then pulls the corresponding deployment package on the node of the business cluster, the deployment package here is the update package, and then the update package contains Scripts and executable programs. The execution process of each script, including the execution process of step S314, is to do the corresponding backup and removal work, automatically configure the corresponding configuration file, then execute the update, finally restart the service, and finally update the accessed configuration file. In this way, the detailed process of automatic update of the business cluster certificate does not require the user to have relative professional knowledge on the cloud platform, and only needs to click the update button to complete the certificate update for the business cluster.

当前现有基于kubernetes集群证书更新,还有一种方案是定期升级集群,这相当于用新部署的高版本集群替代当前已过期的集群方案,这种方式风险比较高,并且会长时间断开用户的业务。如果升级不成功,引发的业务问题比较难以处理,且这种方案的管理工作非常大。At present, there is an existing kubernetes-based cluster certificate update. Another solution is to regularly upgrade the cluster, which is equivalent to replacing the current expired cluster solution with a newly deployed high-version cluster. This method is relatively risky and will disconnect users for a long time. Business. If the upgrade is unsuccessful, the business problems caused are difficult to deal with, and the management of this solution is very large.

现有技术中,还可以通过修改证书的过期时间,比如修改到100年,这样做的安全风险巨大,初始化的工作繁琐。这种方案的安全性比较低,因此没有厂商选择这种方案进行部署,这也不是开源社区推荐的方案。In the prior art, it is also possible to modify the expiration time of the certificate, for example, to 100 years, which involves huge security risks and cumbersome initialization work. The security of this solution is relatively low, so no manufacturer chooses this solution for deployment, and this is not a solution recommended by the open source community.

现有kubernetes的部署,采用默认的部署方式,即证书的过期时间是1年的有效期。而集群证书过期的管理,主要是运维增强证书的流程管理,当发现集群证书即将过期,需要提交集群证书更新的业务流程,之后才能进行变更。The existing kubernetes deployment adopts the default deployment method, that is, the expiration time of the certificate is 1 year. The management of the cluster certificate expiration is mainly the process management of the operation and maintenance enhanced certificate. When it is found that the cluster certificate is about to expire, the business process of cluster certificate update needs to be submitted before the change can be made.

私有云场景下,通常需要业务侧用户同意后,方可在合适的时间,执行手动操作,并且需要严格按照证书更新的流程,执行操作。在更新完成后,需要确保用户的业务不受影响。这种方案,需要长时间断开用户的业务。当节点数量比较多的时候,还需要仔细的检查,以防止误操作或者漏操作的节点。In a private cloud scenario, the user on the business side usually needs to agree to perform manual operations at an appropriate time, and the operations must be performed in strict accordance with the certificate update process. After the update is completed, it is necessary to ensure that the user's business is not affected. In this solution, the user's service needs to be disconnected for a long time. When the number of nodes is relatively large, careful inspection is also required to prevent misoperation or missed nodes.

在公有云场景下,用户需要根据运维的文档,手动执行更新的流程,从而保障集群的正常运行。这种方案与运维人员的过程类似,也是需要仔细操作,如果没有按照文档严格执行而出现的问题,需要用户自己负责,这种方案带来的用户体验及信赖感大大降低。因此公有云场景下,自动化证书更新方案,更加迫切需要。In the public cloud scenario, users need to manually perform the update process according to the operation and maintenance documents, so as to ensure the normal operation of the cluster. This solution is similar to the process of operation and maintenance personnel, and it also requires careful operation. If there is a problem that is not strictly implemented in accordance with the document, the user needs to be responsible for it. The user experience and trust brought by this solution are greatly reduced. Therefore, in the public cloud scenario, an automated certificate update solution is more urgently needed.

此外,当用户的数量变得很大,尤其是公有云场景下,面对上万级至百万级别的用户,如果集群证书的更新,还需要依赖于运维同事的定期检查,这个管理的工作量无疑是非常巨大的。但是,如果将证书更新的操作,整理成通用的文档,并且需要用户根据文档的操作进行更新。首先,文档需要用户具备一定的平台专业知识,否则可能出现读不懂甚至误操作的情况,从而引发很多的异常甚至工单处理流程。其次,文档的操作顺序需要严格遵守,用户自己执行,不确定性比较多,因此出错的概率会大大提升。另外,对于执行证书更新的时间,用户可能没办法把控。如果证书的过期时间还很远,提前执行,这样做的意义并不大,如果证书已经过期,这将导致业务中断。In addition, when the number of users becomes large, especially in the public cloud scenario, in the face of tens of thousands to millions of users, if the cluster certificate is updated, it needs to rely on the regular inspection of the operation and maintenance colleagues. This management The workload is undoubtedly enormous. However, if the operation of certificate update is organized into a common document, and the user needs to update according to the operation of the document. First of all, the document requires users to have certain platform expertise, otherwise it may be incomprehensible or even misoperation, which will cause many exceptions and even work order processing processes. Secondly, the operation order of the document needs to be strictly followed, and the user can execute it by himself, so there are many uncertainties, so the probability of error will be greatly increased. In addition, the user may have no control over when to perform certificate renewal. If the expiration time of the certificate is still far away, it does not make much sense to execute it in advance. If the certificate has expired, it will cause business interruption.

本申请提出的一种基于kubernetes集群的证书自动更新方案,设计了一种符合云平台下大规模多用户集群的自动化集群证书更新方案。This application proposes an automatic certificate update scheme based on kubernetes cluster, and designs an automatic cluster certificate update scheme that conforms to a large-scale multi-user cluster under the cloud platform.

本申请实施例提供一种证书更新方法,参照图4A所示的证书更新示意图,包括:An embodiment of the present application provides a certificate update method, referring to the schematic diagram of certificate update shown in FIG. 4A , including:

步骤S401、更新第一个主节点证书;Step S401, update the first master node certificate;

首先业务集群更新其中一台主节点,并且保障其正常执行完成,这样集群中的主节点即稳定出现。这里,第一个主节点可以指第一个创建的主节点,也就是按照创建的先后时间顺序,确定的第一主节点。First, the business cluster updates one of the master nodes and ensures its normal execution, so that the master node in the cluster appears stably. Here, the first master node may refer to the first created master node, that is, the first master node determined according to the chronological order of creation.

步骤S402、同步更新所有的其它主节点;Step S402, update all other master nodes synchronously;

然后业务集群同步更新所有的其它主节点,主节点上面主要跑的是数据库等核心业务,因此集群中的所有主节点的稳定性,也是非常重要的。Then the business cluster updates all other master nodes synchronously. The master node mainly runs core services such as databases. Therefore, the stability of all master nodes in the cluster is also very important.

步骤S403、在所有的主节点更新完成的情况下,更新集群中所有的工作节点;Step S403, when all master nodes are updated, update all worker nodes in the cluster;

等所有的主节点更新完成后,业务集群执行下一步更新集群中所有的工作节点。After all master nodes are updated, the business cluster performs the next step to update all worker nodes in the cluster.

步骤S404、在工作节点更新完成的情况下,在管理集群中更新业务集群的证书。Step S404 , when the update of the working node is completed, update the certificate of the service cluster in the management cluster.

本申请实施例中的每一个步骤,都是在如图2A所示的管理集群201中主线控制。并且通过管理集群201中的cache业务集群访问的缓存模块2012,发起对业务集群202的访问,通过在业务集群202创建的job类型的资源实现。job的实现过程,是在对于的节点上,根据节点的所处的角色(master主节点或者是worker工作节点),执行不同的流程,具体的流程,是通过在业务集群中job中,在指定的节点上,拉取执行更新的脚本,而脚本中,会自动判定节点的角色,然后执行相应的操作。Each step in this embodiment of the present application is controlled by the main line in the management cluster 201 as shown in FIG. 2A . And through the cache module 2012 that manages the access of the cache service cluster in the cluster 201 , the access to the service cluster 202 is initiated, and the access to the service cluster 202 is realized by the resource of the job type created in the service cluster 202 . The implementation process of the job is to execute different processes on the corresponding node according to the role of the node (master master node or worker worker node). The specific process is through the job in the business cluster. On the node, pull and execute the updated script, and in the script, the role of the node will be automatically determined, and then the corresponding operation will be performed.

本申请实施例中,设计了一种基于kubernetes集群证书自动更新方案,提升用户业务集群长期稳定发展;提出并设计了业务集群证书的管理方案,设计对于业务集群证书合理管控,提升用户对于业务集群证书过期的把控;提升了系统的管理性能,也达到了对业务集群管理的目的,大大减低了运维的成本,提升用户的满意度。In the embodiment of this application, an automatic update scheme based on kubernetes cluster certificate is designed to improve the long-term and stable development of user business clusters; a management scheme for business cluster certificates is proposed and designed, and the design is designed to reasonably manage and control business cluster certificates, so as to improve users' understanding of business clusters The control of certificate expiration; the management performance of the system is improved, and the purpose of business cluster management is also achieved, which greatly reduces the cost of operation and maintenance and improves user satisfaction.

本申请实施例提供一种节点证书更新的方法,参照图4B所示的节点证书更新示意图,包括:An embodiment of the present application provides a method for updating a node certificate. Referring to the schematic diagram of updating a node certificate shown in FIG. 4B , the method includes:

步骤S411、创建轮换(rotate)job;Step S411, creating a rotation (rotate) job;

管理集群发送指令给业务集群创建轮换job,即管理集群发起对其中一台主节点的证书更新job。The management cluster sends an instruction to the business cluster to create a rotation job, that is, the management cluster initiates a certificate update job for one of the master nodes.

步骤S412、获取更新业务集群证书的脚本;Step S412, obtaining a script for updating the service cluster certificate;

业务集群根据轮换job,拉取对应的部署包,这里的部署包,即更新包,更新包中包含脚本及可执行程序。The business cluster pulls the corresponding deployment package according to the rotation job. The deployment package here is the update package, and the update package contains scripts and executable programs.

步骤S413、脚本执行备份、更新过程;Step S413, the script executes the backup and update process;

执行过程举例:1、据每个主(master)节点的容器集合(pod),备份主节点的信息,根据每个主节点的容器集合,备份主节点的信息;2、主节点给kubelet配置文件,加上轮换(rotate)的参数,用于支持轮换(rotate)证书;3、在当前节点下,移除/var/lib/kubelet/pki/*下的内容,备份到新目录;4、创建自建证书必须依赖的集群角色(clusterrole,cr),用于更新及应用程序接口(Application Programming Interface,API)通讯的权限过程;5、给pod控制器(kube-controller-manager)添加支持轮换的启动参数;6、重启kubelet服务;7、更新客户端(client)、应用程序接口服务器、kubelet-客户端的证书;8、更新api服务器、主控制器、调度程序(scheduler)、kubelet的证书配置文件;9、使用docker命令重启api服务器、控制器、调度程序服务;10、更新配置集群访问信息的文件(kubeconfig)的证书。Example of the execution process: 1. According to the container set (pod) of each master node, backup the information of the master node, according to the container set of each master node, backup the information of the master node; 2. The master node configures the kubelet file , plus the parameter of rotation to support the rotation of certificates; 3. Under the current node, remove the content under /var/lib/kubelet/pki/* and back it up to a new directory; 4. Create The cluster role (clusterrole, cr) that the self-created certificate must rely on, the permission process for updating and application programming interface (API) communication; 5. Add support for rotation to the pod controller (kube-controller-manager) Startup parameters; 6. Restart the kubelet service; 7. Update the certificate of the client (client), application program interface server, and kubelet-client; 8. Update the certificate configuration file of the api server, main controller, scheduler (scheduler), and kubelet 9. Use the docker command to restart the api server, controller, and scheduler services; 10. Update the certificate of the file (kubeconfig) that configures the cluster access information.

每个脚本的执行过程,包含10步过程,分别是做好对应的备份、移除工作,自动配置好对应的配置文件,然后执行更新,最后重启服务,最后更新好访问的配置文件。当管理集群发起对工作(worker)节点的证书更新job,然后同master节点的更新证书过程,只是排除apiserver等过程的更新,也就是说在worker节点上没有的服务,不需要更新。通过这个自动化的过程,即完成了集群证书的更新。The execution process of each script includes 10 steps, which are to do the corresponding backup and removal work, automatically configure the corresponding configuration file, then execute the update, finally restart the service, and finally update the accessed configuration file. When the management cluster initiates the certificate update job for the worker node, and then the same as the master node's certificate update process, it only excludes the update of the apiserver and other processes, that is to say, the services that are not on the worker node do not need to be updated. Through this automated process, the cluster certificate update is completed.

步骤S414、获取job执行结果;Step S414, obtaining the job execution result;

管理集群获取job执行结果。The management cluster obtains the job execution result.

步骤S415、如果更新成功,记录CA时间,反之返回更新失败。Step S415, if the update is successful, record the CA time, otherwise, return the update failure.

管理集群同步更新node节点的证书,排除apiserver证书的过程。The management cluster synchronously updates the certificate of the node node, and excludes the process of the apiserver certificate.

本申请实施例,通过在管理集群在业务集群创建对应的job,而这些job被设计了一定的策略,带来的好处是,均匀分散在每个节点上,保障每个节点运行更新证书的任务。从而充分利用了kubernetes本身的调度策略,达到快速运行脚本的目的。从而大大降低了对用户业务的影响。提出并设计了集群证书自动更新详细步骤过程,不需要用户在云平台上具有相对的专业知识,只需要点击更新按钮,即可完成对于集群的证书更新。In the embodiment of the present application, by creating corresponding jobs in the management cluster and the business cluster, and these jobs are designed with certain policies, the advantage is that they are evenly distributed on each node, ensuring that each node runs the task of updating the certificate . In this way, the scheduling strategy of kubernetes itself is fully utilized to achieve the purpose of running scripts quickly. This greatly reduces the impact on user services. This paper proposes and designs the detailed steps for the automatic update of cluster certificates, which does not require users to have relative professional knowledge on the cloud platform, and only needs to click the update button to complete the certificate update for the cluster.

基于前述的实施例,本申请实施例提供一种证书更新装置,该装置包括所包括的各模块,可以通过计算机集群中的处理器来实现;当然也可通过具体的逻辑电路实现;在实施的过程中,处理器可以为中央处理器(CPU)、微处理器(MPU)、数字信号处理器(DSP)或现场可编程门阵列(FPGA)等。Based on the foregoing embodiments, the embodiments of the present application provide a certificate updating device, the device includes each module included, and can be implemented by a processor in a computer cluster; of course, it can also be implemented by a specific logic circuit; In the process, the processor may be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), a field programmable gate array (FPGA), or the like.

图5A为本申请实施例提供的证书更新装置的组成结构示意图,如图5A所示,所述装置500包括访问缓存模块501和证书管理模块502,其中:FIG. 5A is a schematic diagram of the composition structure of a certificate updating apparatus provided by an embodiment of the present application. As shown in FIG. 5A , the apparatus 500 includes an access cache module 501 and a certificate management module 502, wherein:

访问缓存模块501,用于获取子资源池中每一业务集群的证书的有效期;Access cache module 501, used to obtain the validity period of the certificate of each business cluster in the sub-resource pool;

证书管理模块502,用于将所述有效期不满足预设条件的业务集群确定为目标业务集群;A certificate management module 502, configured to determine a service cluster whose validity period does not meet a preset condition as a target service cluster;

访问缓存模块501,用于向所述目标业务集群发送访问请求;an access cache module 501, configured to send an access request to the target service cluster;

证书管理模块502,用于在所述目标业务集群接收所述访问请求后,通过job类型的资源触发所述目标业务集群完成证书更新。The certificate management module 502 is configured to trigger the target business cluster to complete the certificate update through a resource of job type after the target business cluster receives the access request.

基于前述的实施例,所述证书管理模块,还用于确定资源池中每一所述业务集群所属的位置;用于根据每一所述业务集群所属的位置,对所述资源池进行划分,得到至少一个子资源池;用于为所述至少一个子资源池中的每一子资源池确定对应的管理集群。Based on the foregoing embodiment, the certificate management module is further configured to determine the position to which each of the service clusters in the resource pool belongs; and to divide the resource pool according to the position to which each of the service clusters belongs, Obtaining at least one sub-resource pool; for determining a corresponding management cluster for each sub-resource pool in the at least one sub-resource pool.

基于前述的实施例,所述访问缓存模块,还用于获取每一所述业务集群的证书的有效期,并保存在所述证书管理模块中;用于通过访问所述证书管理模块,获取所述业务集群的证书有效期。Based on the foregoing embodiment, the access cache module is further configured to obtain the validity period of the certificate of each of the service clusters, and store it in the certificate management module; and to obtain the certificate management module by accessing the certificate management module. The certificate validity period of the business cluster.

基于前述的实施例,所述证书管理模块,还用于确定每一所述证书的剩余有效时长;用于将剩余有效时长在特定时长内的证书对应的业务集群确定为目标业务集群。Based on the foregoing embodiment, the certificate management module is further configured to determine the remaining valid duration of each certificate; and to determine the service cluster corresponding to the certificate whose remaining valid duration is within a specific duration as the target service cluster.

基于前述的实施例,所述特定时长包括预设的第一时长和预设的第二时长,所述第二时长大于所述第一时长,,所述证书管理模块,还用于在确定所述剩余有效时长在所述第二时长内的情况下,发送通知消息,所述通知消息用于指示所述业务集群的用户对所述证书进行更新;在确定所述剩余有效时长在所述第一时长内的情况下,向所述目标业务集群发送访问请求。Based on the foregoing embodiment, the specific duration includes a preset first duration and a preset second duration, the second duration is greater than the first duration, and the certificate management module is further configured to determine the When the remaining valid duration is within the second duration, a notification message is sent, where the notification message is used to instruct the user of the service cluster to update the certificate; after determining that the remaining valid duration is within the second duration In the case of a period of time, an access request is sent to the target service cluster.

基于前述的实施例,所述证书管理模块,还用于发送所述job类型的资源给所述目标业务集群,以使得所述业务集群根据所述job类型的资源完成证书更新;其中,所述job类型的资源是由所述证书管理模块生成。Based on the foregoing embodiment, the certificate management module is further configured to send the resource of the job type to the target business cluster, so that the business cluster completes the certificate update according to the resource of the job type; wherein, the A resource of type job is generated by the certificate management module.

基于前述的实施例,所述目标业务集群包括至少一个主节点和至少一个工作节点,对应地,所述证书管理模块,还用于:Based on the foregoing embodiment, the target service cluster includes at least one master node and at least one worker node, and correspondingly, the certificate management module is further configured to:

从所述至少一个主节点中确定一个主节点为目标主节点;获取所述目标主节点对应的第一job类型的资源,将对应job类型的资源给所述目标主节点,以使得所述目标主节点根据所述第一job类型的资源完成证书更新;在所述目标主节点对应的证书完成更新的情况下,确定除所述目标主节点上之外的其余主节点;获取所述其余主节点对应第二job类型的资源,将所述第二job类型的资源给所述其余主节点,以使得所述其余主节点根据所述第二job类型的资源完成证书更新;在所述其余主节点对应的证书完成更新的情况下,获取所述至少一个工作节点对应第三job类型的资源,将所述第三job类型的资源给所述至少一个工作节点,以使得所述至少一个工作节点根据所述第三job类型的资源完成证书更新。Determine one master node from the at least one master node as the target master node; obtain the resource of the first job type corresponding to the target master node, and give the resource corresponding to the job type to the target master node, so that the target master node The master node completes the certificate update according to the resource of the first job type; when the certificate corresponding to the target master node is updated, determine the remaining master nodes except on the target master node; obtain the remaining master nodes The node corresponds to the resources of the second job type, and gives the resources of the second job type to the remaining master nodes, so that the remaining master nodes complete the certificate update according to the resources of the second job type; When the certificate corresponding to the node is updated, obtain the resource of the third job type corresponding to the at least one work node, and give the resource of the third job type to the at least one work node, so that the at least one work node The certificate update is completed according to the resource of the third job type.

图5B为本申请实施例提供的证书更新装置的组成结构示意图,如图5B所示,所述装置510包括第一接收模块511、第二接收模块512、获取模块513和运行模块514,其中:FIG. 5B is a schematic diagram of the composition structure of the certificate updating apparatus provided by the embodiment of the application. As shown in FIG. 5B , the apparatus 510 includes a first receiving module 511, a second receiving module 512, an obtaining module 513 and an operating module 514, wherein:

第一接收模块511,用于接收管理集群发送的访问请求;The first receiving module 511 is configured to receive an access request sent by the management cluster;

第二接收模块512,用于响应所述访问请求,接收所述管理集群发送的job类型的资源;The second receiving module 512 is configured to respond to the access request and receive the resource of the job type sent by the management cluster;

获取模块513,用于利用job类型的资源获取证书更新包;Obtaining module 513, used for obtaining the certificate update package by utilizing the resource of job type;

运行模块514,用于运行所述证书更新包以完成证书更新。The running module 514 is used for running the certificate update package to complete the certificate update.

基于前述的实施例,所述证书更新包包括脚本文件,所述业务集群运行所述证书更新包以完成证书更新,所述运行模块514包括执行子模块、移除子模块、配置子模块和运行子模块,其中,执行子模块,用于执行所述脚本文件完成以下操作:移除子模块,用于移除所述业务集群的证书信息,并备份自身的节点信息;配置子模块,用于群配置kubelet,得到用于更新证书的kubelet;运行子模块,用于运行所述更新证书的kubelet以完成所述节点的证书更新。Based on the foregoing embodiment, the certificate update package includes a script file, the service cluster runs the certificate update package to complete the certificate update, and the operation module 514 includes an execution submodule, a removal submodule, a configuration submodule, and an execution submodule. A sub-module, wherein the execution sub-module is used to execute the script file to complete the following operations: remove the sub-module, used to remove the certificate information of the business cluster, and back up its own node information; configure the sub-module, used for The group configures the kubelet to obtain the kubelet for renewing the certificate; runs the submodule, which is used for running the kubelet for renewing the certificate to complete the certificate renewal of the node.

以上装置实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本申请装置实施例中未披露的技术细节,请参照本申请方法实施例的描述而理解。The descriptions of the above apparatus embodiments are similar to the descriptions of the above method embodiments, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the device embodiments of the present application, please refer to the descriptions of the method embodiments of the present application for understanding.

需要说明的是,本申请实施例中,如果以软件功能模块的形式实现上述的证书更新方法,并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得计算机集群执行本申请各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本申请实施例不限制于任何特定的硬件和软件结合。It should be noted that, in the embodiments of the present application, if the above-mentioned certificate updating method is implemented in the form of a software function module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied in the form of software products in essence or the parts that make contributions to related technologies. The computer software products are stored in a storage medium and include several instructions to make The computer cluster performs all or part of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a removable hard disk, a read only memory (Read Only Memory, ROM), a magnetic disk or an optical disk and other mediums that can store program codes. As such, the embodiments of the present application are not limited to any specific combination of hardware and software.

对应地,本申请实施例提供一种计算机集群可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述实施例中提供的证书更新方法中的步骤。Correspondingly, the embodiments of the present application provide a computer cluster readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps in the certificate updating method provided in the above-mentioned embodiments.

对应地,本申请实施例提供一种计算机集群,图6为本申请实施例计算机集群的一种硬件实体示意图,如图6所示,该计算机集群600的硬件实体包括:包括存储器601和处理器602,所述存储器601存储有可在处理器602上运行的计算机程序,所述处理器602执行所述程序时实现上述实施例中提供的证书更新方法中的步骤。Correspondingly, an embodiment of the present application provides a computer cluster, and FIG. 6 is a schematic diagram of a hardware entity of a computer cluster according to an embodiment of the present application. As shown in FIG. 6 , the hardware entity of the computer cluster 600 includes: a memory 601 and a processor 602. The memory 601 stores a computer program that can be executed on the processor 602. When the processor 602 executes the program, the steps in the certificate updating method provided in the foregoing embodiment are implemented.

存储器601配置为存储由处理器602可执行的指令和应用,还可以缓存待处理器602以及计算机集群600中各模块待处理或已经处理的数据(例如,图像数据、音频数据、语音通信数据和视频通信数据),可以通过闪存(FLASH)或随机访问存储器(Random AccessMemory,RAM)实现。The memory 601 is configured to store instructions and applications executable by the processor 602, and can also cache data to be processed or processed by the processor 602 and modules in the computer cluster 600 (eg, image data, audio data, voice communication data and video communication data), which can be implemented by flash memory (FLASH) or random access memory (Random Access Memory, RAM).

这里需要指出的是:以上存储介质和集群实施例(可以理解为设备实施例)的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本申请存储介质和设备实施例中未披露的技术细节,请参照本申请方法实施例的描述而理解。It should be pointed out here that the descriptions of the above storage medium and cluster embodiments (which can be understood as device embodiments) are similar to the descriptions of the above method embodiments, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the embodiments of the storage medium and device of the present application, please refer to the description of the method embodiments of the present application for understanding.

应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。It is to be understood that reference throughout the specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic associated with the embodiment is included in at least one embodiment of the present application. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the embodiments of the present application. implementation constitutes any limitation. The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored, or not implemented. In addition, the coupling, or direct coupling, or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical or other forms. of.

上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元;既可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The unit described above as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit; it may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申请各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may all be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above integration The unit can be implemented either in the form of hardware or in the form of hardware plus software functional units.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by program instructions related to hardware, the aforementioned program may be stored in a computer-readable storage medium, and when the program is executed, the execution includes: The steps of the above method embodiments; and the aforementioned storage medium includes: a removable storage device, a read only memory (Read Only Memory, ROM), a magnetic disk or an optical disk and other media that can store program codes.

或者,本申请上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得计算机集群执行本申请各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied in the form of software products in essence or the parts that make contributions to related technologies. The computer software products are stored in a storage medium and include several instructions to make The computer cluster performs all or part of the methods described in the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.

本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined under the condition of no conflict to obtain new method embodiments.

本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in the several product embodiments provided in this application can be combined arbitrarily without conflict to obtain a new product embodiment.

本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。The features disclosed in several method or device embodiments provided in this application can be combined arbitrarily without conflict to obtain new method embodiments or device embodiments.

以上所述,仅为本申请的实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only the embodiment of the present application, but the protection scope of the present application is not limited to this. Covered within the scope of protection of this application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (13)

1. A certificate updating method, the method comprising:
acquiring the validity period of the certificate of each service cluster in the sub-resource pool;
determining the service cluster with the validity period not meeting the preset condition as a target service cluster;
sending an access request to the target service cluster;
and after the target service cluster receives the access request, triggering the target service cluster to complete certificate updating through the jobtype resource.
2. The method of claim 1, wherein prior to the obtaining the validity period of the certificate for each traffic cluster in the corresponding sub-resource pool, the method further comprises:
determining the position of each service cluster in a resource pool;
and dividing the resource pool according to the position of each service cluster to obtain at least one sub-resource pool.
3. The method of claim 1, wherein the obtaining the validity period of the certificate for each service cluster in the sub-resource pool comprises:
acquiring the validity period of the certificate of each service cluster;
and storing the validity period of the certificate of each service cluster to a certificate management module.
4. The method of claim 1, wherein the determining the service cluster of which the validity period does not satisfy the preset condition as the target service cluster comprises:
determining a remaining validity duration of each of the certificates;
and determining the service cluster corresponding to the certificate of which the residual effective duration is within the specific duration as a target service cluster.
5. The method of claim 4, wherein the specific duration comprises a preset first duration and a preset second duration, the second duration is longer than the first duration, and after the service cluster corresponding to the certificate with the remaining valid duration within the specific duration is determined as the target service cluster, the method further comprises:
sending a notification message under the condition that the residual effective duration is determined to be within the second duration, wherein the notification message is used for indicating a user of the service cluster to update the certificate;
correspondingly, the sending an access request to the target service cluster includes:
and sending an access request to the target service cluster under the condition that the remaining effective duration is determined to be within the first duration.
6. The method of claim 1, wherein the performing credential updates through a job-type resource after the target service cluster receives the access request comprises:
and sending the resource of the jobtype to the target service cluster so that the target service cluster completes certificate updating according to the resource of the jobtype.
7. The method of claim 6, wherein the target service cluster comprises at least one master node and at least one worker node, and wherein sending the job-type resource to the target service cluster to cause the target service cluster to complete the certificate update according to the job-type resource comprises: determining a main node as a target main node from the at least one main node;
acquiring a resource of a first jobtype corresponding to the target master node, and sending the resource of the corresponding jobtype to the target master node, so that the target master node completes certificate updating according to the resource of the first jobtype;
determining the other main nodes except the target main node under the condition that the certificate corresponding to the target main node is updated; acquiring resources of a second jobtype corresponding to the other main nodes, and sending the resources of the second jobtype to the other main nodes so that the other main nodes complete certificate updating according to the resources of the second jobtype;
and under the condition that the certificates corresponding to the other main nodes are updated, acquiring resources corresponding to a third job type from the at least one working node, and giving the resources of the third job type to the at least one working node, so that the at least one working node completes the certificate updating according to the resources of the third job type.
8. A certificate updating method, the method comprising:
receiving an access request sent by a management cluster;
responding to the access request, and receiving a job type resource sent by the management cluster;
acquiring a certificate update package by using a jobtype resource;
running the certificate update package to complete the certificate update.
9. The method of claim 8, wherein the certificate update package includes a script file, the running the certificate update package to complete a certificate update comprising:
performing the following operations by running a script file in the certificate update package to complete a certificate update:
removing the certificate information of the service cluster and backing up the node information of the service cluster;
configuring the kubelet to obtain the kubelet for updating the certificate;
running the kubel of the updated certificate to complete the certificate update for the node.
10. A certificate update apparatus, comprising:
the access cache module is used for acquiring the validity period of the certificate of each service cluster in the sub-resource pool;
the certificate management module is used for determining the service cluster with the validity period not meeting the condition as a target service cluster;
the access cache module is further configured to send an access request to the target service cluster;
and the certificate management module is also used for triggering the target service cluster to complete certificate updating through the jobtype resource after the target service cluster receives the access request.
11. A certificate update apparatus, comprising:
the first receiving module is used for receiving an access request sent by a management cluster;
a second receiving module, configured to receive, in response to the access request, a job-type resource sent by the management cluster;
the acquisition module is used for acquiring the certificate update package by using the jobtype resource;
and the operation module is used for operating the certificate update package to complete the certificate update.
12. A computer cluster comprising a memory and a processor, the memory storing a computer program operable on the processor, wherein the processor performs the steps of the method of any one of claims 1 to 9 when executing the program.
13. A storage medium having stored thereon executable instructions for causing a processor to perform the steps of the method of any one of claims 1 to 9 when executed.
CN202011399522.5A 2020-12-01 2020-12-01 Certificate updating method, device, cluster and storage medium Active CN114598484B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011399522.5A CN114598484B (en) 2020-12-01 2020-12-01 Certificate updating method, device, cluster and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011399522.5A CN114598484B (en) 2020-12-01 2020-12-01 Certificate updating method, device, cluster and storage medium

Publications (2)

Publication Number Publication Date
CN114598484A true CN114598484A (en) 2022-06-07
CN114598484B CN114598484B (en) 2024-03-19

Family

ID=81802475

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011399522.5A Active CN114598484B (en) 2020-12-01 2020-12-01 Certificate updating method, device, cluster and storage medium

Country Status (1)

Country Link
CN (1) CN114598484B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116882636A (en) * 2023-09-05 2023-10-13 苏州浪潮智能科技有限公司 Certificate life cycle management method, device, equipment and storage medium
CN117348975A (en) * 2023-12-05 2024-01-05 中电云计算技术有限公司 Cluster deployment methods, devices, equipment and storage media

Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030037234A1 (en) * 2001-08-17 2003-02-20 Christina Fu Method and apparatus for centralizing a certificate revocation list in a certificate authority cluster
CN104735087A (en) * 2015-04-16 2015-06-24 国家电网公司 Public key algorithm and SSL (security socket layer) protocol based method of optimizing security of multi-cluster Hadoop system
CN105516207A (en) * 2016-01-28 2016-04-20 浪潮电子信息产业股份有限公司 A Method of Certificate Management in Remote Authentication
WO2017012008A1 (en) * 2015-07-21 2017-01-26 深圳市银信网银科技有限公司 Method, server, terminal, and system for changing period of validity of electronic certificate
CN107203890A (en) * 2016-03-17 2017-09-26 阿里巴巴集团控股有限公司 Credential data distribution method, apparatus and system
CN107229877A (en) * 2017-06-05 2017-10-03 北京凤凰理理它信息技术有限公司 Certificate management, acquisition methods, device, computer program and electronic equipment
CN107925659A (en) * 2015-08-15 2018-04-17 微软技术许可有限责任公司 Domain on no domain server adds virtual name
CN108881257A (en) * 2018-06-29 2018-11-23 北京奇虎科技有限公司 Distributed search cluster encrypted transmission method and encrypted transmission distributed search cluster
CN109150616A (en) * 2018-09-03 2019-01-04 成都嗨翻屋科技有限公司 A kind of Intelligent gateway and its working method that can increase https entrance automatically
WO2019011179A1 (en) * 2017-07-10 2019-01-17 腾讯科技(深圳)有限公司 Certificate management method, system, network device and computer readable storage medium
CN109327528A (en) * 2018-10-31 2019-02-12 阿里巴巴集团控股有限公司 Node management method and device based on block chain
CN110311887A (en) * 2019-05-07 2019-10-08 重庆天蓬网络有限公司 System based on the more Kubernetes clusters of enterprise's multi-user management
CN110784347A (en) * 2019-10-18 2020-02-11 北京浪潮数据技术有限公司 Node management method, system, equipment and storage medium for container cluster
CN111082926A (en) * 2019-11-06 2020-04-28 深圳市东进技术股份有限公司 Key synchronization method and system
CN111092727A (en) * 2020-03-18 2020-05-01 支付宝(杭州)信息技术有限公司 Method and device for sharing cluster key
US20200272614A1 (en) * 2017-06-19 2020-08-27 Huawei Technologies Co., Ltd. Index Update Method and System, and Related Apparatus
CN111865601A (en) * 2020-06-04 2020-10-30 江苏理工学院 Blockchain-based vehicle networking trust management method and system
CN111988150A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Block chain certificate updating method and device, computer equipment and storage medium

Patent Citations (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030037234A1 (en) * 2001-08-17 2003-02-20 Christina Fu Method and apparatus for centralizing a certificate revocation list in a certificate authority cluster
CN104735087A (en) * 2015-04-16 2015-06-24 国家电网公司 Public key algorithm and SSL (security socket layer) protocol based method of optimizing security of multi-cluster Hadoop system
WO2017012008A1 (en) * 2015-07-21 2017-01-26 深圳市银信网银科技有限公司 Method, server, terminal, and system for changing period of validity of electronic certificate
CN107925659A (en) * 2015-08-15 2018-04-17 微软技术许可有限责任公司 Domain on no domain server adds virtual name
CN105516207A (en) * 2016-01-28 2016-04-20 浪潮电子信息产业股份有限公司 A Method of Certificate Management in Remote Authentication
CN107203890A (en) * 2016-03-17 2017-09-26 阿里巴巴集团控股有限公司 Credential data distribution method, apparatus and system
CN107229877A (en) * 2017-06-05 2017-10-03 北京凤凰理理它信息技术有限公司 Certificate management, acquisition methods, device, computer program and electronic equipment
US20200272614A1 (en) * 2017-06-19 2020-08-27 Huawei Technologies Co., Ltd. Index Update Method and System, and Related Apparatus
WO2019011179A1 (en) * 2017-07-10 2019-01-17 腾讯科技(深圳)有限公司 Certificate management method, system, network device and computer readable storage medium
CN108881257A (en) * 2018-06-29 2018-11-23 北京奇虎科技有限公司 Distributed search cluster encrypted transmission method and encrypted transmission distributed search cluster
CN109150616A (en) * 2018-09-03 2019-01-04 成都嗨翻屋科技有限公司 A kind of Intelligent gateway and its working method that can increase https entrance automatically
CN109327528A (en) * 2018-10-31 2019-02-12 阿里巴巴集团控股有限公司 Node management method and device based on block chain
CN110311887A (en) * 2019-05-07 2019-10-08 重庆天蓬网络有限公司 System based on the more Kubernetes clusters of enterprise's multi-user management
CN110784347A (en) * 2019-10-18 2020-02-11 北京浪潮数据技术有限公司 Node management method, system, equipment and storage medium for container cluster
CN111082926A (en) * 2019-11-06 2020-04-28 深圳市东进技术股份有限公司 Key synchronization method and system
CN111092727A (en) * 2020-03-18 2020-05-01 支付宝(杭州)信息技术有限公司 Method and device for sharing cluster key
CN111865601A (en) * 2020-06-04 2020-10-30 江苏理工学院 Blockchain-based vehicle networking trust management method and system
CN111988150A (en) * 2020-09-03 2020-11-24 深圳壹账通智能科技有限公司 Block chain certificate updating method and device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈卓;王有春;平佳伟;: "基于公钥基础设施的Hadoop安全机制设计", 计算机测量与控制, no. 04 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116882636A (en) * 2023-09-05 2023-10-13 苏州浪潮智能科技有限公司 Certificate life cycle management method, device, equipment and storage medium
CN116882636B (en) * 2023-09-05 2024-01-16 苏州浪潮智能科技有限公司 Certificate life cycle management method, device, equipment and storage medium
CN117348975A (en) * 2023-12-05 2024-01-05 中电云计算技术有限公司 Cluster deployment methods, devices, equipment and storage media
CN117348975B (en) * 2023-12-05 2024-03-15 中电云计算技术有限公司 Cluster deployment method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114598484B (en) 2024-03-19

Similar Documents

Publication Publication Date Title
CN110737442B (en) Edge application management method and system
US11057471B2 (en) Edge application management method and system
US11907167B2 (en) Multi-cluster database management services
US10642694B2 (en) Monitoring containers in a distributed computing system
CA2778110C (en) Provisioning and managing replicated data instances
US20170344443A1 (en) Dynamically changing members of a consensus group in a distributed self-healing coordination service
WO2012113336A1 (en) System for managing resources in virtualized environment and implementation method therefor
JP2013541764A (en) System and method for connecting an application server to a clustered database
JP2003099410A (en) Method and system for managing multiple devices
CN114138754A (en) Software deployment method and device based on Kubernetes platform
CN113839814B (en) Decentralized Kubernetes cluster federal implementation method and system
CN114598484B (en) Certificate updating method, device, cluster and storage medium
US11907743B2 (en) System and method for relocating customer virtual machine instances in a multi-tenant cloud service
EP4318243A1 (en) Data backup method and system, and related device
CN114143175B (en) Main and standby cluster realization method and system
CN115189931A (en) Distributed key management method, device, equipment and storage medium
WO2025123848A1 (en) Data import method and apparatus, electronic device, storage medium, and program product
WO2025123783A1 (en) Cloud disk management and control method, cloud disk management and control system, and electronic device and storage medium
Stackowiak Azure iot hub
CN115714713B (en) Method and device for switching multiple group service instances of electric power monitoring system
CN116346834A (en) Session synchronization method, device, computing equipment and computer storage medium
CN116126390A (en) Method, system, device and storage medium for replacing operating system
CN107302600A (en) The implementation method and device of a kind of distributed FTP service
US20240028611A1 (en) Granular Replica Healing for Distributed Databases
US9729575B1 (en) Methods, systems, and computer readable mediums for performing centralized management of converged infrastructure system credential information

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