The invention discloses a method for synchronizing configuration files and Pods in Kubernetes cluster, which includes the following steps: configuring a listener to monitor whether the configuration files corresponding to Pod have changed; setting an initial trigger variable to trigger the synchronization operation between Pod and configuration files; synchronizing the monitoring results of configuration files to API Server; and selecting the labels built in Kubelet components. Instead of waiting for the synchronization operation between the previous version of the current configuration file and the Pod to be completed, the device injects the current configuration file into the Pod to complete the synchronization operation between the Pod and the current configuration file and restore the initial trigger variable. The invention reduces the frequent and invalid synchronization operation between the Pod and the configuration file, thus realizing the reasonable and real-time synchronization operation between the configuration file and the Pod in the Kubernetes cluster, while minimizing the performance loss of the Kubernetes cluster, taking into account the high availability of the Kubernetes cluster, so as to significantly improve the user experience.
【技术实现步骤摘要】
Kubernetes集群中配置文件与Pod的同步方法
本专利技术涉及云计算
,尤其涉及一种Kubernetes集群中配置文件与Pod的同步方法。
技术介绍
Kubernetes最初源于谷歌内部的Borg,提供了面向应用的容器集群部署和管理系统。Kubernetes的目标旨在消除编排物理/虚拟计算,网络和存储基础设施的负担,并使应用程序运营商和开发人员完全将重点放在以容器为中心的原语上进行自助运营。Kubernetes也提供稳定、兼容的基础(平台),用于构建定制化的workflows和更高级的自动化任务。Kubernetes具备完善的集群管理能力,包括多层次的安全防护和准入机制、多租户应用支撑能力、透明的服务注册和服务发现机制、内建负载均衡器、故障发现和自我修复能力、服务滚动升级和在线扩容、可扩展的资源自动调度机制、多粒度的资源配额管理能力。Kubernetes还提供完善的管理工具,涵盖开发、部署测试、运维监控等各个环节。在Kubernetes集群中,Pod是所有业务类型的基础,它是一个或多个容器的组合。这些容器共享存储、网络和命名空间,以及如何运行的规范。在Pod中,所有容器都被同一安排和调度,并运行在共享的上下文中。对于具体应用而言,Pod是它们的逻辑主机,Pod包含业务相关的多个应用容器(Container)。基于Kubernetes所构建的计算机集群(以下简称Kubernetes集群)中,当某个计算节点(计算节点中包含一个或者多个Pod)需要维护或者业务整合或者原有节点负载过高时,就需要将该计算节点中的Pod迁移至其他计算节点中;此外,kube ...
【技术保护点】
1.Kubernetes集群中配置文件与Pod的同步方法,其特征在于,包括以下步骤:配置用于监听Pod所对应的配置文件是否发生变化的监听器;设置触发Pod与配置文件执行同步操作的初始触发变量;监听器将配置文件的监听结果同步至API Server;Kubelet组件所内置的标签选择器不等待当前配置文件的上一个版本的配置文件与Pod之间的同步操作是否完成,而将所述当前配置文件注入至Pod中,以完成Pod与当前配置文件之间的同步操作,并恢复初始触发变量。
【技术特征摘要】
1.Kubernetes集群中配置文件与Pod的同步方法,其特征在于,包括以下步骤:配置用于监听Pod所对应的配置文件是否发生变化的监听器;设置触发Pod与配置文件执行同步操作的初始触发变量;监听器将配置文件的监听结果同步至APIServer;Kubelet组件所内置的标签选择器不等待当前配置文件的上一个版本的配置文件与Pod之间的同步操作是否完成,而将所述当前配置文件注入至Pod中,以完成Pod与当前配置文件之间的同步操作,并恢复初始触发变量。2.根据权利要求1所述的同步方法,其特征在于,所述监听器至少形成于ETCD组件中。3.根据权利要求2所述的同步方法,其特征在于,还包括:判断当前配置文件是否与上一个版本的配置文件发生变化;若是,将所述当前配置文件注入至Pod中,以通过Kubelet组件执行Pod与当前配置文件之间的同步操作;若否,将上一个版本的配置文件注入至Pod中,以通过Kubelet组件执行Pod与上一个版本的配置文件之间的同步操作。4.根据权利要求1所述的同步方法,其特征在于,所述标签选择器通过Pod所形成的标签与搜索值选定Pod。5.根据权利要求1所述的同步方法,其特征在于,当Pod与配置文...
【专利技术属性】
技术研发人员:许广彬,肖婷,谭瑞忠,郭晓,毕宏伟,
申请(专利权)人:无锡华云数据技术服务有限公司,
类型:发明
国别省市:江苏,32
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。