leader

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Overview

memberclusterannounce_controller is for leader cluster only.

Package leader is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ReasonConnected    = "Connected"
	ReasonDisconnected = "Disconnected"

	MemberClusterAnnounceFinalizer = "memberclusterannounce.finalizer.antrea.io"

	TimerInterval     = 10 * time.Second
	ConnectionTimeout = 3 * TimerInterval
)
View Source
var (
	NoReadyCluster = "NoReadyCluster"
)

Functions

func GetResourceImportName

func GetResourceImportName(resExport *mcsv1alpha1.ResourceExport) types.NamespacedName

func RemoveDeletedResourceExports

func RemoveDeletedResourceExports(items []mcsv1alpha1.ResourceExport) []mcsv1alpha1.ResourceExport

We use finalizers as ResourceExport pre-delete hooks, which means when we list the ResourceExports, it will also return deleted items. RemoveDeletedResourceExports remove any ResourceExports with non-zero DeletionTimestamp which is actually deleted object.

func SvcPortsConverter

func SvcPortsConverter(svcPort []corev1.ServicePort) []mcs.ServicePort

Types

type LabelIdentityExportReconciler

type LabelIdentityExportReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

LabelIdentityExportReconciler watches LabelIdentity ResourceExport events in the Common Area, computes if such an event causes a new LabelIdentity to become present/stale in the entire ClusterSet, and updates ResourceImports accordingly.

func NewLabelIdentityExportReconciler

func NewLabelIdentityExportReconciler(
	client client.Client,
	scheme *runtime.Scheme,
	namespace string) *LabelIdentityExportReconciler

func (*LabelIdentityExportReconciler) Reconcile

+kubebuilder:rbac:groups=multicluster.crd.antrea.io,resources=resourceexports,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=multicluster.crd.antrea.io,resources=resourceexports/status,verbs=get;update;patch

func (*LabelIdentityExportReconciler) Run

func (r *LabelIdentityExportReconciler) Run(stopCh <-chan struct{})

Run begins syncing of ResourceImports for label identities.

func (*LabelIdentityExportReconciler) SetupWithManager

func (r *LabelIdentityExportReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type LeaderClusterSetReconciler

type LeaderClusterSetReconciler struct {
	client.Client
	// contains filtered or unexported fields
}

LeaderClusterSetReconciler reconciles a ClusterSet object in the leader cluster deployment. Each ClusterSet should have one Multi-cluster Controller running in the ClusterSet' leader Namespace, so a MC Controller will be handling only a single ClusterSet in the given Namespace.

func NewLeaderClusterSetReconciler added in v1.15.0

func NewLeaderClusterSetReconciler(client client.Client, namespace string,
	clusterCalimCRDAvailable bool,
	statusManager MemberClusterStatusManager) *LeaderClusterSetReconciler

func (*LeaderClusterSetReconciler) Reconcile

Reconcile ClusterSet changes

func (*LeaderClusterSetReconciler) SetupWithManager

func (r *LeaderClusterSetReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type MemberClusterAnnounceReconciler

type MemberClusterAnnounceReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

MemberClusterAnnounceReconciler reconciles a MemberClusterAnnounce object

func NewMemberClusterAnnounceReconciler

func NewMemberClusterAnnounceReconciler(client client.Client, scheme *runtime.Scheme) *MemberClusterAnnounceReconciler

func (*MemberClusterAnnounceReconciler) GetMemberClusterStatuses

func (r *MemberClusterAnnounceReconciler) GetMemberClusterStatuses() []mcv1alpha2.ClusterStatus

func (*MemberClusterAnnounceReconciler) Reconcile

Reconcile implements cluster status management on the leader cluster

func (*MemberClusterAnnounceReconciler) SetupWithManager

func (r *MemberClusterAnnounceReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type MemberClusterStatusManager

type MemberClusterStatusManager interface {
	GetMemberClusterStatuses() []mcv1alpha2.ClusterStatus
}

type MockMemberClusterStatusManager

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

MockMemberClusterStatusManager is a mock of MemberClusterStatusManager interface

func NewMockMemberClusterStatusManager

func NewMockMemberClusterStatusManager(ctrl *gomock.Controller) *MockMemberClusterStatusManager

NewMockMemberClusterStatusManager creates a new mock instance

func (*MockMemberClusterStatusManager) EXPECT

EXPECT returns an object that allows the caller to indicate expected use

func (*MockMemberClusterStatusManager) GetMemberClusterStatuses

func (m *MockMemberClusterStatusManager) GetMemberClusterStatuses() []v1alpha2.ClusterStatus

GetMemberClusterStatuses mocks base method

type MockMemberClusterStatusManagerMockRecorder

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

MockMemberClusterStatusManagerMockRecorder is the mock recorder for MockMemberClusterStatusManager

func (*MockMemberClusterStatusManagerMockRecorder) GetMemberClusterStatuses

func (mr *MockMemberClusterStatusManagerMockRecorder) GetMemberClusterStatuses() *gomock.Call

GetMemberClusterStatuses indicates an expected call of GetMemberClusterStatuses

type ResourceExportReconciler

type ResourceExportReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

ResourceExportReconciler reconciles a ResourceExport object in the leader cluster.

func NewResourceExportReconciler

func NewResourceExportReconciler(
	client client.Client,
	scheme *runtime.Scheme) *ResourceExportReconciler

func (*ResourceExportReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. Reconcile will process all kinds of ResourceExport. Service and Endpoint kinds of ResourceExport will be handled in this file, and all other kinds will have their own handler files, eg: newkind_handler.go

func (*ResourceExportReconciler) SetupWithManager

func (r *ResourceExportReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type StaleResCleanupController added in v1.14.0

type StaleResCleanupController struct {
	client.Client
	Scheme *runtime.Scheme
}

StaleResCleanupController will run periodically (memberClusterAnnounceStaleTime / 2 = 12 Hours) to clean up stale MemberClusterAnnounce resources in the leader cluster if the MemberClusterAnnounce timestamp annotation has not been updated for memberClusterAnnounceStaleTime (24 Hours). It will remove all ResourceExports belong to a member cluster when the corresponding MemberClusterAnnounce CR is deleted. It will also try to clean up all stale ResourceExports during start.

func NewStaleResCleanupController added in v1.14.0

func NewStaleResCleanupController(
	Client client.Client,
	Scheme *runtime.Scheme,
) *StaleResCleanupController

func (*StaleResCleanupController) Reconcile added in v1.14.0

func (*StaleResCleanupController) Run added in v1.14.0

func (c *StaleResCleanupController) Run(stopCh <-chan struct{})

func (*StaleResCleanupController) SetupWithManager added in v1.14.0

func (c *StaleResCleanupController) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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