model

package
v0.0.0-...-f33f640 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoints

type Endpoints struct {
	Name      string
	Namespace string

	IPList []string
}

Endpoints contains the k8s endpoints info which lazyxds just need

func NewEndpoints

func NewEndpoints(endpoints *corev1.Endpoints) *Endpoints

NewEndpoints creates new Endpoints from k8s endpoints

func (*Endpoints) ID

func (ep *Endpoints) ID() string

ID use service fqdn as endpoints id

type NSLazyStatus

type NSLazyStatus int

NSLazyStatus represents the status of lazy xds

const (
	// NSLazyStatusNone ...
	NSLazyStatusNone NSLazyStatus = 0
	// NSLazyStatusEnabled ...
	NSLazyStatusEnabled NSLazyStatus = 1
	// NSLazyStatusDisabled ...
	NSLazyStatusDisabled NSLazyStatus = 2
)

type Namespace

type Namespace struct {
	Name string

	Distribution map[string]bool
	UserSidecar  map[string]struct{}

	Labels map[string]string

	LazyStatus NSLazyStatus
}

Namespace represent the namespace which contains multi-cluster info

func NewNamespace

func NewNamespace(namespace *corev1.Namespace) *Namespace

NewNamespace creates new Namespace struct from kubernetes namespace

func (*Namespace) AddSidecar

func (ns *Namespace) AddSidecar(sidecarName string)

AddSidecar record user-created sidecar crd

func (*Namespace) Delete

func (ns *Namespace) Delete(clusterName string)

Delete delete a namespace of one cluster

func (*Namespace) DeleteSidecar

func (ns *Namespace) DeleteSidecar(sidecarName string)

DeleteSidecar delete use-created sidecar crd

func (*Namespace) ID

func (ns *Namespace) ID() string

ID use name of namespace as id

func (*Namespace) LazyEnabled

func (ns *Namespace) LazyEnabled(clusterName string) bool

LazyEnabled check if the namespace enable lazyxds Currently, if there is any user created sidecar CRD, the lazyxds will be disabled

func (*Namespace) Update

func (ns *Namespace) Update(clusterName string, namespace *corev1.Namespace)

Update update one namespace of the multiCluster

type Service

type Service struct {
	Name          string
	Namespace     string
	Distribution  map[string]*clusterServiceStatus
	EgressService map[string]struct{} // http service which reported from als
	NSLazy        NSLazyStatus

	Spec   serviceStatus // desired status
	Status serviceStatus
	// contains filtered or unexported fields
}

Service represent one service cross multi-cluster

func NewService

func NewService(service *corev1.Service) *Service

NewService creates new Service

func (*Service) DeleteFromCluster

func (svc *Service) DeleteFromCluster(clusterName string)

DeleteFromCluster delete the service of one cluster

func (*Service) DomainListOfPort

func (svc *Service) DomainListOfPort(num, sourceNS string) []string

DomainListOfPort return the whole list of domains related with this port

func (*Service) FinishReconcileLazy

func (svc *Service) FinishReconcileLazy()

FinishReconcileLazy update lazy status using spec info

func (*Service) FinishReconcileService

func (svc *Service) FinishReconcileService()

FinishReconcileService update status using spec info

func (*Service) ID

func (svc *Service) ID() string

ID use FQDN as service id

func (*Service) NeedReconcileLazy

func (svc *Service) NeedReconcileLazy() bool

NeedReconcileLazy check if lazy info is equal in status and spec

func (*Service) NeedReconcileService

func (svc *Service) NeedReconcileService() bool

NeedReconcileService check if service need reconcile

func (*Service) UpdateClusterService

func (svc *Service) UpdateClusterService(clusterName string, service *corev1.Service)

UpdateClusterService update the service of one cluster

func (*Service) UpdateNSLazy

func (svc *Service) UpdateNSLazy(status NSLazyStatus)

UpdateNSLazy update the enabled status of the namespace If the ns lazy status changed, we need update service spec

Jump to

Keyboard shortcuts

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