public abstract class CRDController<CR extends io.fabric8.kubernetes.client.CustomResource<S,T>,CRS extends io.fabric8.kubernetes.client.CustomResourceList<CR>,S,T> extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected KubeClientTams |
client |
protected io.fabric8.kubernetes.client.dsl.MixedOperation<CR,CRS,io.fabric8.kubernetes.client.dsl.Resource<CR>> |
crClient |
protected ICrdRealize |
crdRealize |
protected io.fabric8.kubernetes.client.informers.cache.Lister<CR> |
crLister |
protected io.fabric8.kubernetes.client.informers.SharedIndexInformer<CR> |
crSharedIndexInformer |
protected io.fabric8.kubernetes.client.informers.SharedInformerFactory |
informerFactory |
protected String |
namespace |
protected BlockingQueue<org.apache.commons.lang3.tuple.Pair<String,net.wicp.tams.common.constant.OptType>> |
workqueue |
| 构造器和说明 |
|---|
CRDController(ICrdRealize crdRealize,
KubeClientTams client,
String namespace) |
| 限定符和类型 | 方法和说明 |
|---|---|
abstract net.wicp.tams.common.Result |
checkWithPreRun()
在启动前做检查
|
abstract T |
getCrStatus(CR cr) |
abstract void |
init()
初始化
|
abstract net.wicp.tams.common.Result |
needReconcile(S oldSpec,
T oldStatus,
S newSpec,
T newStatus)
重要,判断是否需要处理修改事件。
|
abstract net.wicp.tams.common.Result |
reconcile(CR cr,
org.apache.commons.lang3.tuple.Pair<String,net.wicp.tams.common.constant.OptType> key)
需要实现的主要接口,处理
|
void |
run() |
protected final KubeClientTams client
protected final io.fabric8.kubernetes.client.dsl.MixedOperation<CR extends io.fabric8.kubernetes.client.CustomResource<S,T>,CRS extends io.fabric8.kubernetes.client.CustomResourceList<CR>,io.fabric8.kubernetes.client.dsl.Resource<CR extends io.fabric8.kubernetes.client.CustomResource<S,T>>> crClient
protected final io.fabric8.kubernetes.client.informers.SharedInformerFactory informerFactory
protected final io.fabric8.kubernetes.client.informers.SharedIndexInformer<CR extends io.fabric8.kubernetes.client.CustomResource<S,T>> crSharedIndexInformer
protected final io.fabric8.kubernetes.client.informers.cache.Lister<CR extends io.fabric8.kubernetes.client.CustomResource<S,T>> crLister
protected final String namespace
protected final ICrdRealize crdRealize
protected final BlockingQueue<org.apache.commons.lang3.tuple.Pair<String,net.wicp.tams.common.constant.OptType>> workqueue
public CRDController(ICrdRealize crdRealize, KubeClientTams client, String namespace)
public abstract void init()
public abstract net.wicp.tams.common.Result reconcile(CR cr, org.apache.commons.lang3.tuple.Pair<String,net.wicp.tams.common.constant.OptType> key)
cr - 如果为删除,则为空key - keeypublic abstract net.wicp.tams.common.Result checkWithPreRun()
public abstract net.wicp.tams.common.Result needReconcile(S oldSpec, T oldStatus, S newSpec, T newStatus)
oldSpec - oldStatus - newSpec - newStatus - public final void run()
Copyright © 2023. All rights reserved.