Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientPodFetcher ¶
type ClientPodFetcher struct {
// contains filtered or unexported fields
}
ClientPodFetcher wraps a Kubernetes client to implement PodFetcher. This is the only implementation outside of tests.
func (*ClientPodFetcher) GetPod ¶
func (c *ClientPodFetcher) GetPod(ctx context.Context, name types.NamespacedName) (*corev1.Pod, error)
type Controller ¶
type Controller struct { client.Client // ConsulServerConnMgr is the watcher for the Consul server addresses used to create Consul API v2 clients. ConsulServerConnMgr consul.ServerConnectionManager // K8sNamespaceConfig manages allow/deny Kubernetes namespaces. common.K8sNamespaceConfig // ConsulTenancyConfig manages settings related to Consul namespaces and partitions. common.ConsulTenancyConfig // WriteCache keeps track of records already written to Consul in order to enable debouncing of writes. // This is useful in particular for this controller which will see potentially many more reconciles due to // endpoint changes (e.g. pod health) than changes to service data written to Consul. // It is intentionally simple and best-effort, and does not guarantee against all redundant writes. // It is not persistent across restarts of the controller process. WriteCache WriteCache Log logr.Logger Scheme *runtime.Scheme context.Context }
func (*Controller) Logger ¶
func (r *Controller) Logger(name types.NamespacedName) logr.Logger
func (*Controller) Reconcile ¶
Reconcile reads the state of an Endpoints object for a Kubernetes Service and reconciles Consul services which correspond to the Kubernetes Service. These events are driven by changes to the Pods backing the Kube service.
func (*Controller) SetupWithManager ¶
func (r *Controller) SetupWithManager(mgr ctrl.Manager) error
type PodFetcher ¶
PodFetcher fetches pods by NamespacedName. This interface primarily exists for testing.
type WriteCache ¶
type WriteCache interface {
// contains filtered or unexported methods
}
WriteCache is a simple, unbounded, thread-safe in-memory cache for tracking writes of Consul resources. It can be used to deduplicate identical writes client-side to "debounce" writes during repeat reconciles that do not impact data already written to Consul.
func NewWriteCache ¶
func NewWriteCache(log logr.Logger) WriteCache