controllers

package
v0.0.0-...-ed46050 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FrontendIPConfigIDTemplate is the template of the frontend IP configuration
	FrontendIPConfigIDTemplate = "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/frontendIPConfigurations/%s"
	// BackendPoolIDTemplate is the template of the backend pool
	BackendPoolIDTemplate = "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/backendAddressPools/%s"
	// LoadBalancerProbeIDTemplate is the template of the load balancer probe
	LoadBalancerProbeIDTemplate = "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/probes/%s"
)
View Source
const (
	// FinalizerName is the name for the finalizer.
	FinalizerName = "mcn.networking.aks.io"
)

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(slice []string, s string) bool

func RemoveItemFromSlice

func RemoveItemFromSlice(slice []string, s string) []string

Types

type AKSClusterReconciler

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

	WorkQueue       workqueue.RateLimitingInterface
	Lock            sync.Mutex
	ClusterManagers map[string]*ClusterManager
}

AKSClusterReconciler reconciles a AKSCluster object

func (*AKSClusterReconciler) GetClusterManager

func (r *AKSClusterReconciler) GetClusterManager(clusterName string) *ClusterManager

GetClusterManager gets the cluster manager by cluster name.

func (*AKSClusterReconciler) Reconcile

func (r *AKSClusterReconciler) 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 AKSCluster 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 (*AKSClusterReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type ClusterManager

type ClusterManager struct {
	manager.Manager
	// contains filtered or unexported fields
}

func NewClusterManager

func NewClusterManager(name string, kubeconfig *rest.Config, workqueue workqueue.RateLimitingInterface) (*ClusterManager, error)

NewClusterManager creates a new ClusterManager for a member cluster from its kubeconfig.

func (*ClusterManager) Run

func (mgr *ClusterManager) Run() error

Run starts the cluster manager reconciler.

func (*ClusterManager) Stop

func (mgr *ClusterManager) Stop()

Stop stops cluster manager.

type ClusterSetReconciler

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

ClusterSetReconciler reconciles a ClusterSet object

func (*ClusterSetReconciler) Reconcile

func (r *ClusterSetReconciler) 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 ClusterSet 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 (*ClusterSetReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type GlobalServiceReconciler

type GlobalServiceReconciler struct {
	client.Client
	Scheme  *runtime.Scheme
	Manager ctrl.Manager
	Log     logr.Logger

	AzureConfig          *azureclients.AzureConfig
	LoadBalancerClient   loadbalancerclient.Interface
	PublicIPClient       publicipclient.Interface
	AKSClusterReconciler *AKSClusterReconciler
	AzureConfigSecret    string
	AzureConfigNamespace string

	JitterPeriod time.Duration
	WorkQueue    workqueue.RateLimitingInterface
}

GlobalServiceReconciler reconciles a GlobalService object

func (*GlobalServiceReconciler) Reconcile

func (r *GlobalServiceReconciler) 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 GlobalService 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 (*GlobalServiceReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*GlobalServiceReconciler) StartReconcileLoop

func (r *GlobalServiceReconciler) StartReconcileLoop(ctx context.Context) error

StartReconcileLoop starts the reconciler loop for glb.

type RegionalIPConfig

type RegionalIPConfig struct {
	IP       string
	ConfigID string
}

RegionalIPConfig defines the metadata for regional LB config.

type ServiceEndpoints

type ServiceEndpoints struct {
	Cluster        string
	Service        types.NamespacedName
	LoadBalancerIP string
	Endpoints      string // slice couldn't be used here because it would be used as map key.
}

ServiceEndpoints defines the endpoints for the service.

type ServiceManager

type ServiceManager struct {
	client.Client
	Name      string
	Log       logr.Logger
	Scheme    *runtime.Scheme
	WorkQueue workqueue.RateLimitingInterface
}

ServiceManager reconciles service objects inside member clusters.

func (*ServiceManager) Reconcile

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

Reconcile reconciles the service from member cluster.

func (*ServiceManager) SetupWithManager

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

SetupWithManager registers ServiceManager reconciler.

Jump to

Keyboard shortcuts

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