multicluster

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Overview

memberclusterannounce_controller is for leader cluster only.

Package multicluster is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ReasonNeverConnected   = "NeverConnected"
	ReasonConnected        = "Connected"
	ReasonDisconnected     = "Disconnected"
	ReasonElectedLeader    = "ElectedLeader"
	ReasonNotElectedLeader = "NotElectedLeader"

	TimerInterval     = 5 * 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 ClusterClaimReconciler

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

ClusterClaimReconciler reconciles a ClusterClaim object

func (*ClusterClaimReconciler) Reconcile

func (r *ClusterClaimReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the ClusterClaim object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*ClusterClaimReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type LeaderClusterSetReconciler

type LeaderClusterSetReconciler struct {
	client.Client
	Scheme *runtime.Scheme

	StatusManager MemberClusterStatusManager
	// contains filtered or unexported fields
}

LeaderClusterSetReconciler reconciles a ClusterSet object in the leader cluster deployment. There will be one MC Controller running in each Namespace of the leader for multiple ClusterSet support. So each MC Controller will only be handling a single ClusterSet in the given Namespace.

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) AddMember

func (r *MemberClusterAnnounceReconciler) AddMember(MemberId common.ClusterID)

func (*MemberClusterAnnounceReconciler) GetMemberClusterStatuses

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

func (*MemberClusterAnnounceReconciler) Reconcile

Reconcile implements cluster status management on the leader cluster

func (*MemberClusterAnnounceReconciler) RemoveMember

func (r *MemberClusterAnnounceReconciler) RemoveMember(MemberId common.ClusterID)

func (*MemberClusterAnnounceReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type MemberClusterSetReconciler

type MemberClusterSetReconciler struct {
	client.Client
	Scheme    *runtime.Scheme
	Namespace string

	RemoteCommonAreaManager commonarea.RemoteCommonAreaManager
	// contains filtered or unexported fields
}

MemberClusterSetReconciler reconciles a ClusterSet object in the member cluster deployment.

func (*MemberClusterSetReconciler) Reconcile

Reconcile ClusterSet changes

func (*MemberClusterSetReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type MemberClusterStatusManager

type MemberClusterStatusManager interface {
	AddMember(MemberId common.ClusterID)
	RemoveMember(MemberId common.ClusterID)

	GetMemberClusterStatuses() []multiclusterv1alpha1.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) AddMember

func (m *MockMemberClusterStatusManager) AddMember(MemberId common.ClusterID)

AddMember mocks base method.

func (*MockMemberClusterStatusManager) EXPECT

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

func (*MockMemberClusterStatusManager) GetMemberClusterStatuses

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

GetMemberClusterStatuses mocks base method.

func (*MockMemberClusterStatusManager) RemoveMember

func (m *MockMemberClusterStatusManager) RemoveMember(MemberId common.ClusterID)

RemoveMember mocks base method.

type MockMemberClusterStatusManagerMockRecorder

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

MockMemberClusterStatusManagerMockRecorder is the mock recorder for MockMemberClusterStatusManager.

func (*MockMemberClusterStatusManagerMockRecorder) AddMember

func (mr *MockMemberClusterStatusManagerMockRecorder) AddMember(MemberId interface{}) *gomock.Call

AddMember indicates an expected call of AddMember.

func (*MockMemberClusterStatusManagerMockRecorder) GetMemberClusterStatuses

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

GetMemberClusterStatuses indicates an expected call of GetMemberClusterStatuses.

func (*MockMemberClusterStatusManagerMockRecorder) RemoveMember

func (mr *MockMemberClusterStatusManagerMockRecorder) RemoveMember(MemberId interface{}) *gomock.Call

RemoveMember indicates an expected call of RemoveMember.

type ResourceExportFilterReconciler

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

ResourceExportFilterReconciler reconciles a ResourceExportFilter object

func (*ResourceExportFilterReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the ResourceExportFilter object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*ResourceExportFilterReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

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. TODO(user): Modify the Reconcile function to compare the state specified by the ResourceExport object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*ResourceExportReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ResourceImportFilterReconciler

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

ResourceImportFilterReconciler reconciles a ResourceImportFilter object

func (*ResourceImportFilterReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the ResourceImportFilter object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.8.3/pkg/reconcile

func (*ResourceImportFilterReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ServiceExportReconciler

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

ServiceExportReconciler reconciles a ServiceExport object in the member cluster.

func NewServiceExportReconciler

func NewServiceExportReconciler(
	Client client.Client,
	Scheme *runtime.Scheme,
	remoteCommonAreaManager *commonarea.RemoteCommonAreaManager) *ServiceExportReconciler

func (*ServiceExportReconciler) Reconcile

func (r *ServiceExportReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. For ServiceExport Reconcile, it watches events of ServiceExport resources, and also Endpoints/Services resource. It will create/update/remove ResourceExport in a leader cluster for corresponding ServiceExport from a member cluster.

func (*ServiceExportReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type StaleController

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

StaleController will clean up ServiceImport and MC Service if no corresponding ResourceImport in the leader cluster and remove any ResourceExport in the leader cluster if no correspoding ServiceExport in the member cluster. It will only run in the member cluster.

func NewStaleController

func NewStaleController(
	Client client.Client,
	Scheme *runtime.Scheme,
	remoteCommonAreaManager *commonarea.RemoteCommonAreaManager) *StaleController

func (*StaleController) Enqueue

func (c *StaleController) Enqueue()

Enqueue will be called after StaleController is initialized.

func (*StaleController) Run

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

Run starts the StaleController and blocks until stopCh is closed. it will run only once to clean up stale resources if no error happens.

func (*StaleController) RunOnce

func (c *StaleController) RunOnce() error

Directories

Path Synopsis
package commonarea is a generated GoMock package.
package commonarea is a generated GoMock package.

Jump to

Keyboard shortcuts

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