Documentation
¶
Index ¶
- func DataplaneCallbacksToXdsCallbacks(callbacks DataplaneCallbacks) util_xds.Callbacks
- func NewNackBackoff(backoff time.Duration) util_xds.Callbacks
- type DataplaneCallbacks
- type DataplaneInsightSink
- type DataplaneInsightSinkFactoryFunc
- type DataplaneInsightStore
- type DataplaneLifecycle
- func (d *DataplaneLifecycle) OnProxyConnected(streamID core_xds.StreamID, dpKey model.ResourceKey, ctx context.Context, ...) error
- func (d *DataplaneLifecycle) OnProxyDisconnected(_ context.Context, streamID core_xds.StreamID, dpKey model.ResourceKey)
- func (d *DataplaneLifecycle) OnProxyReconnected(streamID core_xds.StreamID, dpKey model.ResourceKey, ctx context.Context, ...) error
- type DataplaneMetadataTracker
- func (d *DataplaneMetadataTracker) Metadata(dpKey core_model.ResourceKey) *core_xds.DataplaneMetadata
- func (d *DataplaneMetadataTracker) OnProxyConnected(_ core_xds.StreamID, dpKey core_model.ResourceKey, _ context.Context, ...) error
- func (d *DataplaneMetadataTracker) OnProxyDisconnected(_ context.Context, _ core_xds.StreamID, dpKey core_model.ResourceKey)
- func (d *DataplaneMetadataTracker) OnProxyReconnected(_ core_xds.StreamID, dpKey core_model.ResourceKey, _ context.Context, ...) error
- type DataplaneStatusTracker
- type NewDataplaneWatchdogFunc
- type NoopDataplaneCallbacks
- func (n *NoopDataplaneCallbacks) OnProxyConnected(core_xds.StreamID, core_model.ResourceKey, context.Context, ...) error
- func (n *NoopDataplaneCallbacks) OnProxyDisconnected(context.Context, core_xds.StreamID, core_model.ResourceKey)
- func (n *NoopDataplaneCallbacks) OnProxyReconnected(core_xds.StreamID, core_model.ResourceKey, context.Context, ...) error
- type SubscriptionStatusAccessor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DataplaneCallbacksToXdsCallbacks ¶ added in v1.8.1
func DataplaneCallbacksToXdsCallbacks(callbacks DataplaneCallbacks) util_xds.Callbacks
Types ¶
type DataplaneCallbacks ¶ added in v1.8.1
type DataplaneCallbacks interface { // OnProxyConnected is executed when proxy is connected after it was disconnected before. OnProxyConnected(streamID core_xds.StreamID, dpKey core_model.ResourceKey, ctx context.Context, metadata core_xds.DataplaneMetadata) error // OnProxyReconnected is executed when proxy is already connected, but there is another stream. // This can happen when there is a delay with closing the old connection from the proxy to the control plane. OnProxyReconnected(streamID core_xds.StreamID, dpKey core_model.ResourceKey, ctx context.Context, metadata core_xds.DataplaneMetadata) error // OnProxyDisconnected is executed only when the last stream of the proxy disconnects. OnProxyDisconnected(ctx context.Context, streamID core_xds.StreamID, dpKey core_model.ResourceKey) }
DataplaneCallbacks are XDS callbacks that keep the context of Kuma Dataplane. In the ideal world we could assume that one Dataplane has one xDS stream. Due to race network latencies etc. there might be a situation when one Dataplane has many xDS streams for the short period of time. Those callbacks helps us to deal with such situation.
Keep in mind that it does not solve many xDS streams across many instances of the Control Plane. If there are many instances of the Control Plane and Dataplane reconnects, there might be an old stream in one instance of CP and a new stream in a new instance of CP.
func NewDataplaneSyncTracker ¶
func NewDataplaneSyncTracker(factoryFunc NewDataplaneWatchdogFunc) DataplaneCallbacks
type DataplaneInsightSink ¶
type DataplaneInsightSink interface {
Start(stop <-chan struct{})
}
func NewDataplaneInsightSink ¶
func NewDataplaneInsightSink( dataplaneType core_model.ResourceType, accessor SubscriptionStatusAccessor, secrets secrets.Secrets, newTicker func() *time.Ticker, generationTicker func() *time.Ticker, flushBackoff time.Duration, store DataplaneInsightStore) DataplaneInsightSink
type DataplaneInsightSinkFactoryFunc ¶
type DataplaneInsightSinkFactoryFunc = func(core_model.ResourceType, SubscriptionStatusAccessor) DataplaneInsightSink
type DataplaneInsightStore ¶
type DataplaneInsightStore interface { // Upsert creates or updates the subscription, storing it with // the key dataplaneID. dataplaneType gives the resource type of // the dataplane proxy that has subscribed. Upsert(dataplaneType core_model.ResourceType, dataplaneID core_model.ResourceKey, subscription *mesh_proto.DiscoverySubscription, secretsInfo *secrets.Info) error }
func NewDataplaneInsightStore ¶
func NewDataplaneInsightStore(resManager manager.ResourceManager) DataplaneInsightStore
type DataplaneLifecycle ¶
type DataplaneLifecycle struct { sync.RWMutex // protects createdDpByCallbacks // contains filtered or unexported fields }
DataplaneLifecycle is responsible for creating a deleting dataplanes that are passed through metadata There are two possible workflows 1) apply Dataplane resource before kuma-dp run and run kuma-dp 2) run kuma-dp and pass Dataplane resource as an argument to kuma-dp This component support second use case. When user passes Dataplane to kuma-dp it is attached to bootstrap request. Then, bootstrap server generates bootstrap configuration with Dataplane embedded in Envoy metadata. Here, we read Dataplane resource from metadata and a create resource on first DiscoveryRequest and remove on StreamClosed.
This flow is optional, you may still want to go with 1. an example of this is Kubernetes deployment.
func NewDataplaneLifecycle ¶
func NewDataplaneLifecycle( appCtx context.Context, resManager manager.ResourceManager, authenticator xds_auth.Authenticator, deregistrationDelay time.Duration, cpInstanceID string, ) *DataplaneLifecycle
func (*DataplaneLifecycle) OnProxyConnected ¶ added in v1.8.1
func (d *DataplaneLifecycle) OnProxyConnected(streamID core_xds.StreamID, dpKey model.ResourceKey, ctx context.Context, md core_xds.DataplaneMetadata) error
func (*DataplaneLifecycle) OnProxyDisconnected ¶ added in v1.8.1
func (d *DataplaneLifecycle) OnProxyDisconnected(_ context.Context, streamID core_xds.StreamID, dpKey model.ResourceKey)
func (*DataplaneLifecycle) OnProxyReconnected ¶ added in v1.8.1
func (d *DataplaneLifecycle) OnProxyReconnected(streamID core_xds.StreamID, dpKey model.ResourceKey, ctx context.Context, md core_xds.DataplaneMetadata) error
type DataplaneMetadataTracker ¶
func NewDataplaneMetadataTracker ¶
func NewDataplaneMetadataTracker() *DataplaneMetadataTracker
func (*DataplaneMetadataTracker) Metadata ¶
func (d *DataplaneMetadataTracker) Metadata(dpKey core_model.ResourceKey) *core_xds.DataplaneMetadata
func (*DataplaneMetadataTracker) OnProxyConnected ¶ added in v1.8.1
func (d *DataplaneMetadataTracker) OnProxyConnected(_ core_xds.StreamID, dpKey core_model.ResourceKey, _ context.Context, metadata core_xds.DataplaneMetadata) error
func (*DataplaneMetadataTracker) OnProxyDisconnected ¶ added in v1.8.1
func (d *DataplaneMetadataTracker) OnProxyDisconnected(_ context.Context, _ core_xds.StreamID, dpKey core_model.ResourceKey)
func (*DataplaneMetadataTracker) OnProxyReconnected ¶ added in v1.8.1
func (d *DataplaneMetadataTracker) OnProxyReconnected(_ core_xds.StreamID, dpKey core_model.ResourceKey, _ context.Context, metadata core_xds.DataplaneMetadata) error
type DataplaneStatusTracker ¶
type DataplaneStatusTracker interface { util_xds.Callbacks GetStatusAccessor(streamID int64) (SubscriptionStatusAccessor, bool) }
func NewDataplaneStatusTracker ¶
func NewDataplaneStatusTracker( runtimeInfo core_runtime.RuntimeInfo, createStatusSink DataplaneInsightSinkFactoryFunc, ) DataplaneStatusTracker
type NewDataplaneWatchdogFunc ¶
type NewDataplaneWatchdogFunc func(key core_model.ResourceKey) util_watchdog.Watchdog
type NoopDataplaneCallbacks ¶ added in v1.8.1
type NoopDataplaneCallbacks struct { }
NoopDataplaneCallbacks are empty callbacks that helps to implement DataplaneCallbacks without need to implement every function.
func (*NoopDataplaneCallbacks) OnProxyConnected ¶ added in v1.8.1
func (n *NoopDataplaneCallbacks) OnProxyConnected(core_xds.StreamID, core_model.ResourceKey, context.Context, core_xds.DataplaneMetadata) error
func (*NoopDataplaneCallbacks) OnProxyDisconnected ¶ added in v1.8.1
func (n *NoopDataplaneCallbacks) OnProxyDisconnected(context.Context, core_xds.StreamID, core_model.ResourceKey)
func (*NoopDataplaneCallbacks) OnProxyReconnected ¶ added in v1.8.1
func (n *NoopDataplaneCallbacks) OnProxyReconnected(core_xds.StreamID, core_model.ResourceKey, context.Context, core_xds.DataplaneMetadata) error
type SubscriptionStatusAccessor ¶
type SubscriptionStatusAccessor interface {
GetStatus() (core_model.ResourceKey, *mesh_proto.DiscoverySubscription)
}