controllers

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: Apache-2.0 Imports: 63 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AzureClusterToAzureMachinesMapper added in v0.4.6

func AzureClusterToAzureMachinesMapper(ctx context.Context, c client.Client, ro runtime.Object, scheme *runtime.Scheme, log logr.Logger) (handler.MapFunc, error)

AzureClusterToAzureMachinesMapper creates a mapping handler to transform AzureClusters into AzureMachines. The transform requires AzureCluster to map to the owning Cluster, then from the Cluster, collect the Machines belonging to the cluster, then finally projecting the infrastructure reference to the AzureMachine.

func GetAzureMachinePoolByName added in v0.5.0

func GetAzureMachinePoolByName(ctx context.Context, c client.Client, namespace, name string) (*infrav1exp.AzureMachinePool, error)

GetAzureMachinePoolByName finds and return an AzureMachinePool object using the specified params.

func GetCloudProviderSecret added in v0.4.7

func GetCloudProviderSecret(d azure.ClusterScoper, namespace, name string, owner metav1.OwnerReference, identityType infrav1.VMIdentity, userIdentityID string) (*corev1.Secret, error)

GetCloudProviderSecret returns the required azure json secret for the provided parameters.

func GetClusterIdentityFromRef added in v0.4.11

func GetClusterIdentityFromRef(ctx context.Context, c client.Client, azureClusterNamespace string, ref *corev1.ObjectReference) (*infrav1.AzureClusterIdentity, error)

GetClusterIdentityFromRef returns the AzureClusterIdentity referenced by the AzureCluster.

func GetMachinePoolByName added in v0.4.7

func GetMachinePoolByName(ctx context.Context, c client.Client, namespace, name string) (*capiv1exp.MachinePool, error)

GetMachinePoolByName finds and return a MachinePool object using the specified params.

func GetObjectsToRequestsByNamespaceAndClusterName added in v0.4.6

func GetObjectsToRequestsByNamespaceAndClusterName(ctx context.Context, c client.Client, clusterKey client.ObjectKey, list *unstructured.UnstructuredList) []ctrl.Request

GetObjectsToRequestsByNamespaceAndClusterName returns the slice of ctrl.Requests consisting the list items contained in the unstructured list.

func GetOwnerAzureMachinePool added in v0.5.0

func GetOwnerAzureMachinePool(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*infrav1exp.AzureMachinePool, error)

GetOwnerAzureMachinePool returns the AzureMachinePool object owning the current resource.

func GetOwnerClusterName added in v0.4.6

func GetOwnerClusterName(obj metav1.ObjectMeta) (string, bool)

GetOwnerClusterName returns the name of the owning Cluster by finding a clusterv1.Cluster in the ownership references.

func GetOwnerMachinePool added in v0.4.7

func GetOwnerMachinePool(ctx context.Context, c client.Client, obj metav1.ObjectMeta) (*capiv1exp.MachinePool, error)

GetOwnerMachinePool returns the MachinePool object owning the current resource.

func ShouldDeleteIndividualResources added in v0.4.9

func ShouldDeleteIndividualResources(ctx context.Context, clusterScope *scope.ClusterScope) bool

ShouldDeleteIndividualResources returns false if the resource group is managed and the whole cluster is being deleted meaning that we can rely on a single resource group delete operation as opposed to deleting every individual VM resource.

Types

type AzureClusterReconciler

type AzureClusterReconciler struct {
	client.Client
	Log              logr.Logger
	Recorder         record.EventRecorder
	ReconcileTimeout time.Duration
	WatchFilterValue string
	// contains filtered or unexported fields
}

AzureClusterReconciler reconciles an AzureCluster object.

func NewAzureClusterReconciler added in v0.4.11

func NewAzureClusterReconciler(client client.Client, log logr.Logger, recorder record.EventRecorder, reconcileTimeout time.Duration, watchFilterValue string) *AzureClusterReconciler

NewAzureClusterReconciler returns a new AzureClusterReconciler instance.

func (*AzureClusterReconciler) Reconcile

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

Reconcile idempotently gets, creates, and updates a cluster.

func (*AzureClusterReconciler) SetupWithManager

func (r *AzureClusterReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error

SetupWithManager initializes this controller with a manager.

type AzureIdentityReconciler added in v0.4.11

type AzureIdentityReconciler struct {
	client.Client
	Log              logr.Logger
	Recorder         record.EventRecorder
	ReconcileTimeout time.Duration
	WatchFilterValue string
}

AzureIdentityReconciler reconciles Azure identity objects.

func (*AzureIdentityReconciler) Reconcile added in v0.4.11

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

Reconcile reconciles the Azure identity.

func (*AzureIdentityReconciler) SetupWithManager added in v0.4.11

func (r *AzureIdentityReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error

SetupWithManager initializes this controller with a manager.

type AzureJSONMachinePoolReconciler added in v0.4.7

type AzureJSONMachinePoolReconciler struct {
	client.Client
	Log              logr.Logger
	Recorder         record.EventRecorder
	ReconcileTimeout time.Duration
}

AzureJSONMachinePoolReconciler reconciles Azure json secrets for AzureMachinePool objects.

func (*AzureJSONMachinePoolReconciler) Reconcile added in v0.4.7

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

Reconcile reconciles the Azure json for AzureMachinePool objects.

func (*AzureJSONMachinePoolReconciler) SetupWithManager added in v0.4.7

func (r *AzureJSONMachinePoolReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error

SetupWithManager initializes this controller with a manager.

type AzureJSONMachineReconciler added in v0.4.7

type AzureJSONMachineReconciler struct {
	client.Client
	Log              logr.Logger
	Recorder         record.EventRecorder
	ReconcileTimeout time.Duration
}

AzureJSONMachineReconciler reconciles Azure json secrets for AzureMachine objects.

func (*AzureJSONMachineReconciler) Reconcile added in v0.4.7

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

Reconcile reconciles the Azure json for a specific machine not in a machine deployment.

func (*AzureJSONMachineReconciler) SetupWithManager added in v0.4.7

func (r *AzureJSONMachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error

SetupWithManager initializes this controller with a manager.

type AzureJSONTemplateReconciler added in v0.4.7

type AzureJSONTemplateReconciler struct {
	client.Client
	Log              logr.Logger
	Recorder         record.EventRecorder
	ReconcileTimeout time.Duration
}

AzureJSONTemplateReconciler reconciles Azure json secrets for AzureMachineTemplate objects.

func (*AzureJSONTemplateReconciler) Reconcile added in v0.4.7

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

Reconcile reconciles Azure json secrets for Azure machine templates.

func (*AzureJSONTemplateReconciler) SetupWithManager added in v0.4.7

func (r *AzureJSONTemplateReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error

SetupWithManager initializes this controller with a manager.

type AzureMachineReconciler

type AzureMachineReconciler struct {
	client.Client
	Log              logr.Logger
	Recorder         record.EventRecorder
	ReconcileTimeout time.Duration
	WatchFilterValue string
	// contains filtered or unexported fields
}

AzureMachineReconciler reconciles an AzureMachine object.

func NewAzureMachineReconciler added in v0.4.11

func NewAzureMachineReconciler(client client.Client, log logr.Logger, recorder record.EventRecorder, reconcileTimeout time.Duration, watchFilterValue string) *AzureMachineReconciler

NewAzureMachineReconciler returns a new AzureMachineReconciler instance.

func (*AzureMachineReconciler) Reconcile

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

Reconcile idempotently gets, creates, and updates a machine.

func (*AzureMachineReconciler) SetupWithManager

func (r *AzureMachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error

SetupWithManager initializes this controller with a manager.

type BackOffConfig added in v0.5.0

type BackOffConfig struct {
	CloudProviderBackoff         bool    `json:"cloudProviderBackoff,omitempty"`
	CloudProviderBackoffRetries  int     `json:"cloudProviderBackoffRetries,omitempty"`
	CloudProviderBackoffExponent float64 `json:"cloudProviderBackoffExponent,omitempty"`
	CloudProviderBackoffDuration int     `json:"cloudProviderBackoffDuration,omitempty"`
	CloudProviderBackoffJitter   float64 `json:"cloudProviderBackoffJitter,omitempty"`
}

BackOffConfig indicates the back-off config options. This is a copy of the struct used in cloud-provider-azure: https://github.com/kubernetes-sigs/cloud-provider-azure/blob/d585c2031925b39c925624302f22f8856e29e352/pkg/azureclients/azure_client_config.go#L48

type CloudProviderConfig added in v0.4.7

type CloudProviderConfig struct {
	Cloud                        string `json:"cloud"`
	TenantID                     string `json:"tenantId"`
	SubscriptionID               string `json:"subscriptionId"`
	AadClientID                  string `json:"aadClientId,omitempty"`
	AadClientSecret              string `json:"aadClientSecret,omitempty"`
	ResourceGroup                string `json:"resourceGroup"`
	SecurityGroupName            string `json:"securityGroupName"`
	SecurityGroupResourceGroup   string `json:"securityGroupResourceGroup"`
	Location                     string `json:"location"`
	VMType                       string `json:"vmType"`
	VnetName                     string `json:"vnetName"`
	VnetResourceGroup            string `json:"vnetResourceGroup"`
	SubnetName                   string `json:"subnetName"`
	RouteTableName               string `json:"routeTableName"`
	LoadBalancerSku              string `json:"loadBalancerSku"`
	MaximumLoadBalancerRuleCount int    `json:"maximumLoadBalancerRuleCount"`
	UseManagedIdentityExtension  bool   `json:"useManagedIdentityExtension"`
	UseInstanceMetadata          bool   `json:"useInstanceMetadata"`
	UserAssignedIdentityID       string `json:"userAssignedIdentityId,omitempty"`
	CloudProviderRateLimitConfig
	BackOffConfig
}

CloudProviderConfig is an abbreviated version of the same struct in k/k.

type CloudProviderRateLimitConfig added in v0.5.0

type CloudProviderRateLimitConfig struct {
	RateLimitConfig

	RouteRateLimit                  *RateLimitConfig `json:"routeRateLimit,omitempty"`
	SubnetsRateLimit                *RateLimitConfig `json:"subnetsRateLimit,omitempty"`
	InterfaceRateLimit              *RateLimitConfig `json:"interfaceRateLimit,omitempty"`
	RouteTableRateLimit             *RateLimitConfig `json:"routeTableRateLimit,omitempty"`
	LoadBalancerRateLimit           *RateLimitConfig `json:"loadBalancerRateLimit,omitempty"`
	PublicIPAddressRateLimit        *RateLimitConfig `json:"publicIPAddressRateLimit,omitempty"`
	SecurityGroupRateLimit          *RateLimitConfig `json:"securityGroupRateLimit,omitempty"`
	VirtualMachineRateLimit         *RateLimitConfig `json:"virtualMachineRateLimit,omitempty"`
	StorageAccountRateLimit         *RateLimitConfig `json:"storageAccountRateLimit,omitempty"`
	DiskRateLimit                   *RateLimitConfig `json:"diskRateLimit,omitempty"`
	SnapshotRateLimit               *RateLimitConfig `json:"snapshotRateLimit,omitempty"`
	VirtualMachineScaleSetRateLimit *RateLimitConfig `json:"virtualMachineScaleSetRateLimit,omitempty"`
	VirtualMachineSizeRateLimit     *RateLimitConfig `json:"virtualMachineSizesRateLimit,omitempty"`
	AvailabilitySetRateLimit        *RateLimitConfig `json:"availabilitySetRateLimit,omitempty"`
}

CloudProviderRateLimitConfig represents the rate limiting configurations in azure cloud provider config. See: https://kubernetes-sigs.github.io/cloud-provider-azure/install/configs/#per-client-rate-limiting. This is a copy of the struct used in cloud-provider-azure: https://github.com/kubernetes-sigs/cloud-provider-azure/blob/d585c2031925b39c925624302f22f8856e29e352/pkg/provider/azure_ratelimit.go#L25

type Options added in v0.5.0

type Options struct {
	controller.Options
	Cache *coalescing.ReconcileCache
}

Options are controller options extended.

type RateLimitConfig added in v0.5.0

type RateLimitConfig struct {
	CloudProviderRateLimit            bool    `json:"cloudProviderRateLimit,omitempty"`
	CloudProviderRateLimitQPS         float32 `json:"cloudProviderRateLimitQPS,omitempty"`
	CloudProviderRateLimitBucket      int     `json:"cloudProviderRateLimitBucket,omitempty"`
	CloudProviderRateLimitQPSWrite    float32 `json:"cloudProviderRateLimitQPSWrite,omitempty"`
	CloudProviderRateLimitBucketWrite int     `json:"cloudProviderRateLimitBucketWrite,omitempty"`
}

RateLimitConfig indicates the rate limit config options. This is a copy of the struct used in cloud-provider-azure: https://github.com/kubernetes-sigs/cloud-provider-azure/blob/d585c2031925b39c925624302f22f8856e29e352/pkg/azureclients/azure_client_config.go#L48

Jump to

Keyboard shortcuts

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