member

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: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetNormalizedLabel

func GetNormalizedLabel(nsLabels, podLabels map[string]string, ns string) string

Types

type GatewayReconciler

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

GatewayReconciler is for member cluster only.

func NewGatewayReconciler

func NewGatewayReconciler(
	client client.Client,
	scheme *runtime.Scheme,
	namespace string,
	podCIDRs []string,
	commonAreaGetter commonarea.RemoteCommonAreaGetter) *GatewayReconciler

NewGatewayReconciler creates a GatewayReconciler which will watch Gateway events and create a ClusterInfo kind of ResourceExport in the leader cluster.

func (*GatewayReconciler) Reconcile

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

func (*GatewayReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type LabelIdentityReconciler

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

LabelIdentityReconciler watches relevant Pod and Namespace events in the member cluster, computes the label identities added to and deleted from the cluster, and exports them to the leader cluster for further processing.

func NewLabelIdentityReconciler

func NewLabelIdentityReconciler(
	client client.Client,
	scheme *runtime.Scheme,
	commonAreaGetter commonarea.RemoteCommonAreaGetter,
	namespace string) *LabelIdentityReconciler

func (*LabelIdentityReconciler) Reconcile

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

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

func (*LabelIdentityReconciler) Run

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

Run begins syncing of ResourceExports for label identities.

func (*LabelIdentityReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type LabelIdentityResourceImportReconciler

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

LabelIdentityResourceImportReconciler reconciles a LabelIdentity kind of ResourceImport object in the member cluster.

func (*LabelIdentityResourceImportReconciler) Reconcile

func (*LabelIdentityResourceImportReconciler) SetupWithManager

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

type MemberClusterSetReconciler

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

MemberClusterSetReconciler reconciles a ClusterSet object in the member cluster deployment.

func NewMemberClusterSetReconciler

func NewMemberClusterSetReconciler(client client.Client,
	scheme *runtime.Scheme,
	namespace string,
	enableStretchedNetworkPolicy bool,
	clusterCalimCRDAvailable bool,
	commonAreaCreationCh chan struct{},
) *MemberClusterSetReconciler

func (*MemberClusterSetReconciler) GetRemoteCommonAreaAndLocalID

func (r *MemberClusterSetReconciler) GetRemoteCommonAreaAndLocalID() (commonarea.RemoteCommonArea, string, error)

func (*MemberClusterSetReconciler) Reconcile

Reconcile ClusterSet changes

func (*MemberClusterSetReconciler) SetRemoteCommonArea

SetRemoteCommonArea is for testing only

func (*MemberClusterSetReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type NodeReconciler

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

NodeReconciler is for member cluster only.

func NewNodeReconciler

func NewNodeReconciler(
	client client.Client,
	scheme *runtime.Scheme,
	namespace string,
	serviceCIDR string,
	precedence mcv1alpha1.Precedence,
	commonAreaGetter commonarea.RemoteCommonAreaGetter) *NodeReconciler

NewNodeReconciler creates a NodeReconciler to watch Node resource changes. It's responsible for creating a Gateway for the first ready Node with annotation `multicluster.antrea.io/gateway:true` if there is no existing Gateway. It guarantees there is always only one Gateway CR when there are multiple Nodes with annotation `multicluster.antrea.io/gateway:true`.

func (*NodeReconciler) Reconcile

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

func (*NodeReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ResourceImportReconciler

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

ResourceImportReconciler reconciles a ResourceImport object in the member cluster.

func (*ResourceImportReconciler) Reconcile

Reconcile will attempt to ensure that the imported Resource is installed in local cluster as per the ResourceImport object.

func (*ResourceImportReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the ClusterManager which will set up controllers for resources that need to be monitored in the remoteCommonArea.

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,
	commonAreaGetter commonarea.RemoteCommonAreaGetter,
	endpointIPType string,
	endpointSliceEnabled bool,
	namespace string) *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 Services/Endpoints resources. 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 StaleResCleanupController added in v1.14.0

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

StaleResCleanupController will clean up ServiceImport, MC Service, ACNP, ClusterInfoImport and LabelIdentity resources if no corresponding ResourceImports in the leader cluster and remove stale ResourceExports in the leader cluster if no corresponding ServiceExport or Gateway in the member cluster when it runs in the member cluster. StaleResCleanupController one-time runner will run only once in the member cluster during Multi-cluster Controller starts, and it will retry only if there is an error. StaleResCleanupController's reconciler will handle ClusterSet deletion event to clean up all automatically created resources for the ClusterSet.

func NewStaleResCleanupController added in v1.14.0

func NewStaleResCleanupController(
	Client client.Client,
	Scheme *runtime.Scheme,
	commonAreaCreationCh chan struct{},
	namespace string,
	commonAreaGetter commonarea.RemoteCommonAreaGetter,
) *StaleResCleanupController

func (*StaleResCleanupController) CleanUp added in v1.14.0

func (*StaleResCleanupController) Run added in v1.14.0

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

Run starts the StaleResCleanupController and blocks until stopCh is closed.

Jump to

Keyboard shortcuts

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