distribution

package
v0.0.0-...-8eb000f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateOrUpdateConfigMap

func CreateOrUpdateConfigMap(ctx context.Context, cm *corev1.ConfigMap, client v1.ConfigMapInterface) (res *corev1.ConfigMap, err error)

CreateOrUpdateConfigMap is lifted with few modifications from kubeadm's apiclient

func GenStatusReporterMapKey

func GenStatusReporterMapKey(conID string, distributionType xds.EventType) string

func ReconcileStatuses

func ReconcileStatuses(current *v1alpha1.IstioStatus, desired Progress) (bool, *v1alpha1.IstioStatus)

Types

type Controller

type Controller struct {
	CurrentState    map[status.Resource]map[string]Progress
	ObservationTime map[string]time.Time
	UpdateInterval  time.Duration

	StaleInterval time.Duration
	// contains filtered or unexported fields
}

func NewController

func NewController(restConfig *rest.Config, namespace string, cs model.ConfigStore, m *status.Manager) *Controller

func (*Controller) Start

func (c *Controller) Start(stop <-chan struct{})

type DistroReportHandler

type DistroReportHandler struct {
	// contains filtered or unexported fields
}

func (*DistroReportHandler) HandleNew

func (drh *DistroReportHandler) HandleNew(obj any)

func (*DistroReportHandler) OnAdd

func (drh *DistroReportHandler) OnAdd(obj any, _ bool)

func (*DistroReportHandler) OnDelete

func (drh *DistroReportHandler) OnDelete(obj any)

func (*DistroReportHandler) OnUpdate

func (drh *DistroReportHandler) OnUpdate(oldObj, newObj any)

type Progress

type Progress struct {
	AckedInstances int
	TotalInstances int
}

func (*Progress) PlusEquals

func (p *Progress) PlusEquals(p2 Progress)

type Report

type Report struct {
	Reporter            string         `json:"reporter"`
	DataPlaneCount      int            `json:"dataPlaneCount"`
	InProgressResources map[string]int `json:"inProgressResources"`
}

func ReportFromYaml

func ReportFromYaml(content []byte) (Report, error)

type Reporter

type Reporter struct {
	UpdateInterval time.Duration
	PodName        string
	// contains filtered or unexported fields
}

func (*Reporter) AddInProgressResource

func (r *Reporter) AddInProgressResource(res config.Config)

AddInProgressResource must be called every time a resource change is detected by pilot. This allows us to lookup only the resources we expect to be in flight, not the ones that have already distributed

func (*Reporter) DeleteInProgressResource

func (r *Reporter) DeleteInProgressResource(res config.Config)

func (*Reporter) Init

func (r *Reporter) Init(ledger ledger.Ledger, stop <-chan struct{})

Init starts all the read only features of the reporter, used for nonce generation and responding to istioctl wait.

func (*Reporter) QueryLastNonce

func (r *Reporter) QueryLastNonce(conID string, distributionType xds.EventType) (noncePrefix string)

func (*Reporter) RegisterDisconnect

func (r *Reporter) RegisterDisconnect(conID string, types sets.Set[xds.EventType])

RegisterDisconnect : when a dataplane disconnects, we should no longer count it, nor expect it to ack config.

func (*Reporter) RegisterEvent

func (r *Reporter) RegisterEvent(conID string, distributionType xds.EventType, nonce string)

Register that a dataplane has acknowledged a new version of the config. Theoretically, we could use the ads connections themselves to harvest this data, but the mutex there is pretty hot, and it seems best to trade memory for time.

func (*Reporter) SetController

func (r *Reporter) SetController(controller *Controller)

func (*Reporter) Start

func (r *Reporter) Start(clientSet kubernetes.Interface, namespace string, podname string, stop <-chan struct{})

Start starts the reporter, which watches dataplane ack's and resource changes so that it can update status leader with distribution information.

type ResourceStatus

type ResourceStatus any

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL