Operator Pattern 用 Go 扩展 Kubernetes 的最佳实践在做任何读(get、list)操作时,不能假设读到 的是最新版本,也不能假设一次 reconcile 中始 终会读到同一个版本 避免写后读 同一个 controller,在一次 reconcile 中,避免写 (create、update、delete)完一个对象后马上去 读(get、list)最新版本,等controller-runtime 触发下一次 reconcile 遵循惯例开发模式 即 controller 用读 stale 对象。 如下图所示,某个版本为3(gen=3)的集群(Cluster)中有一个 stale 对象,即 StatefulSet (gen=2)。 Controller-runtime 的 Reconcile 过程是一个 EDA 模型,当该 stale 对象的更新到达 cache 时,controller-runtime 会发送一个事件(Event)给到 owner controller(也就是我们的 controller-type OwnerReference of the given type. // Use Owns(object, builder.MatchEveryOwner) to reconcile all owners. // // By default, this is the equivalent of calling // Watches(object, handler.Enqu0 码力 | 21 页 | 3.06 MB | 9 月前3
 KubeCon2020/腾讯会议大规模使用Kubernetes的技术实践Message Queue Dynamic Quota Operator Cluster _1 Cluster_1 Quota for Biz A etcd DynamicQuota reconcile Prometheus +Grafana Commit workload and DynamicQuota, PriorityClass, Workload Annotations Dynamic adjustment of offline jobs quota. Ø Offline job queue manager. Ø DynamicQuota-Operator to reconcile business quota. Ø ValidatingWebhook to validate pod add request. DynamicQuota Large-scale and0 码力 | 19 页 | 10.94 MB | 1 年前3
 01. K8s扩展功能解析deleted Resource Item Resource status Resource Spec: running list/watch resource change Reconcile resource status to spec © 2017 Rancher Labs, Inc. API Aggregation • What API aggregation provides0 码力 | 12 页 | 1.08 MB | 1 年前3
 Model and Operate Datacenter by Kubernetes at eBay (提交版)control loop container VIP volume W I S B : W h a t i t s h o u l d b e Converge & Reconcile WIRI: What it really is Kubernetes Core concept of Kubernetes - Declarative magic What is an0 码力 | 25 页 | 3.60 MB | 1 年前3
 Over engineeringthe core of Kubernetes kopsnivenly.com” So how does it work ? ? ? Kops 1.4 State Store Unmarshal Tasks Map Compare Reconcile Kops 1.4 tasks := []*Task We have to track our work Where do tasks come from ? ? ? Kops0 码力 | 75 页 | 4.56 MB | 1 年前3
 Go Programming Pattern in Kubernetes PhilosophyOriented Programming Core of API “OO” 1.API objects stores in etcd 2.Control loops (Sync Loop) to reconcile API objects Example kubelet SyncLoop kubelet SyncLoop proxy proxy 1 Pod created etcd scheduler0 码力 | 29 页 | 2.12 MB | 1 年前3
共 6 条
- 1
 













