Documentation ¶
Overview ¶
Package controllers implements k8s controller functionality for addons.
Index ¶
- Constants
- func GetExternalCRDs() (map[schema.GroupVersion]*sets.String, []client.Object)
- func IsClusterClassBased(clusterObj *clusterapiv1beta1.Cluster) bool
- type AddonKappResourceReconciler
- type AddonReconciler
- func (r *AddonReconciler) AddonSecretToClusters(o client.Object) []ctrl.Request
- func (r *AddonReconciler) BOMConfigMapToClusters(o client.Object) []ctrl.Request
- func (r *AddonReconciler) GetAddonKappResourceReconciler(ctx context.Context, log logr.Logger, clusterClient client.Client, ...) (AddonKappResourceReconciler, error)
- func (r *AddonReconciler) KubeadmControlPlaneToClusters(o client.Object) []ctrl.Request
- func (r *AddonReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)
- func (r *AddonReconciler) ReconcileAddonDataValuesSecretNormal(ctx context.Context, log logr.Logger, clusterClient client.Client, ...) error
- func (r *AddonReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
- func (r *AddonReconciler) TKRToClusters(o client.Object) []ctrl.Request
- type AppReconciler
- type ClusterBootstrapReconciler
- func (r *ClusterBootstrapReconciler) ClusterBootstrapToClusters(o client.Object) []ctrl.Request
- func (r *ClusterBootstrapReconciler) GetDataValueSecretNameFromBootstrapPackage(cbPkg *runtanzuv1alpha3.ClusterBootstrapPackage, ...) (string, error)
- func (r *ClusterBootstrapReconciler) ProviderToClusters(o client.Object) []ctrl.Request
- func (r *ClusterBootstrapReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *ClusterBootstrapReconciler) SecretsToClusters(o client.Object) []ctrl.Request
- func (r *ClusterBootstrapReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
- func (r *ClusterBootstrapReconciler) TKRToClusters(o client.Object) []ctrl.Request
- type ClusterBootstrapWatchInputs
- type ClusterMetadataReconciler
- type ClusterRole
- type MachineReconciler
- func (r *MachineReconciler) MachinesFromClusterBoostrap(o client.Object) []ctrl.Request
- func (r *MachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)
- func (r *MachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
- type PackageInstallStatusReconciler
- type PackageReconciler
Constants ¶
const PreTerminateAddonsAnnotationPrefix = clusterapiv1beta1.PreTerminateDeleteHookAnnotationPrefix + "/tkg.tanzu.vmware.com"
const PreTerminateAddonsAnnotationValue = "tkg.tanzu.vmware.com/addons"
Variables ¶
This section is empty.
Functions ¶
func GetExternalCRDs ¶
GetExternalCRDs returns all external custom resources that addon controller depends on
func IsClusterClassBased ¶
func IsClusterClassBased(clusterObj *clusterapiv1beta1.Cluster) bool
Types ¶
type AddonKappResourceReconciler ¶
type AddonKappResourceReconciler interface { ReconcileAddonKappResourceNormal( remoteApp bool, remoteCluster *clusterapiv1beta1.Cluster, addonSecret *corev1.Secret, addonConfig *tkrv1.Addon, imageRepository string, bom *tkrv1.Bom) error ReconcileAddonKappResourceDelete( addonSecret *corev1.Secret) error }
AddonKappResourceReconciler is the interface for Kapp related reconcilers
type AddonReconciler ¶
type AddonReconciler struct { Client client.Client Log logr.Logger Scheme *runtime.Scheme Config addonconfig.AddonControllerConfig // contains filtered or unexported fields }
AddonReconciler contains the reconciler information for addon controllers.
func (*AddonReconciler) AddonSecretToClusters ¶
func (r *AddonReconciler) AddonSecretToClusters(o client.Object) []ctrl.Request
AddonSecretToClusters returns the clusters on which the addon needs to be installed
func (*AddonReconciler) BOMConfigMapToClusters ¶
func (r *AddonReconciler) BOMConfigMapToClusters(o client.Object) []ctrl.Request
BOMConfigMapToClusters returns the clusters using the BOM
func (*AddonReconciler) GetAddonKappResourceReconciler ¶
func (r *AddonReconciler) GetAddonKappResourceReconciler( ctx context.Context, log logr.Logger, clusterClient client.Client, reconcilerType string) (AddonKappResourceReconciler, error)
GetAddonKappResourceReconciler gets the correct kapp resource reconciler
func (*AddonReconciler) KubeadmControlPlaneToClusters ¶
func (r *AddonReconciler) KubeadmControlPlaneToClusters(o client.Object) []ctrl.Request
KubeadmControlPlaneToClusters returns the cluster where kcp is present
func (*AddonReconciler) Reconcile ¶
func (r *AddonReconciler) Reconcile(ctx context.Context, req ctrl.Request) (_ ctrl.Result, reterr error)
Reconcile performs the reconciliation action for the controller.
func (*AddonReconciler) ReconcileAddonDataValuesSecretNormal ¶
func (r *AddonReconciler) ReconcileAddonDataValuesSecretNormal( ctx context.Context, log logr.Logger, clusterClient client.Client, addonSecret *corev1.Secret, addonConfig *tkrv1.Addon, imageRepository string, bom *tkrv1.Bom) error
ReconcileAddonDataValuesSecretNormal reconciles addons data values secrets
func (*AddonReconciler) SetupWithManager ¶
func (r *AddonReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
SetupWithManager performs the setup actions for an add on controller, using the passed in mgr.
func (*AddonReconciler) TKRToClusters ¶
func (r *AddonReconciler) TKRToClusters(o client.Object) []ctrl.Request
TKRToClusters returns the clusters using TKR
type AppReconciler ¶
type AppReconciler struct { Config addonconfig.AddonControllerConfig // contains filtered or unexported fields }
AppReconciler reconcile kapp App related CRs
func (*AppReconciler) ReconcileAddonKappResourceDelete ¶
func (r *AppReconciler) ReconcileAddonKappResourceDelete( addonSecret *corev1.Secret) error
ReconcileAddonKappResourceDelete reconciles and deletes App CR
func (*AppReconciler) ReconcileAddonKappResourceNormal ¶
func (r *AppReconciler) ReconcileAddonKappResourceNormal( remoteApp bool, remoteCluster *clusterapiv1beta1.Cluster, addonSecret *corev1.Secret, addonConfig *tkrv1.Addon, imageRepository string, bom *tkrv1.Bom) error
ReconcileAddonKappResourceNormal reconciles and creates App CR
type ClusterBootstrapReconciler ¶
type ClusterBootstrapReconciler struct { client.Client Log logr.Logger Scheme *runtime.Scheme Config *addonconfig.ClusterBootstrapControllerConfig // contains filtered or unexported fields }
ClusterBootstrapReconciler reconciles a ClusterBootstrap object
func NewClusterBootstrapReconciler ¶
func NewClusterBootstrapReconciler(c client.Client, log logr.Logger, scheme *runtime.Scheme, config *addonconfig.ClusterBootstrapControllerConfig) *ClusterBootstrapReconciler
NewClusterBootstrapReconciler returns a reconciler for ClusterBootstrap
func (*ClusterBootstrapReconciler) ClusterBootstrapToClusters ¶
func (r *ClusterBootstrapReconciler) ClusterBootstrapToClusters(o client.Object) []ctrl.Request
func (*ClusterBootstrapReconciler) GetDataValueSecretNameFromBootstrapPackage ¶
func (r *ClusterBootstrapReconciler) GetDataValueSecretNameFromBootstrapPackage(cbPkg *runtanzuv1alpha3.ClusterBootstrapPackage, cluster *clusterapiv1beta1.Cluster) (string, error)
GetDataValueSecretNameFromBootstrapPackage attempts to get the data value secret name associated with a ClusterBootstrapPackage. Users have three ways to provide the data values for a ClusterBootstrapPackage: [Inline, SecretRef, ProviderRef], or leave ClusterBootstrapPackage.ValuesFrom field as nil. If data values are provided by ProviderRef, the corresponding controller needs to generate the secret object.
Returns: - string: The secret name which references to the Secret CR on mgmt cluster under a particular cluster namespace. - error: whether there is error when getting the secret name.
func (*ClusterBootstrapReconciler) ProviderToClusters ¶
func (r *ClusterBootstrapReconciler) ProviderToClusters(o client.Object) []ctrl.Request
func (*ClusterBootstrapReconciler) Reconcile ¶
func (r *ClusterBootstrapReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile performs the reconciliation action for the controller.
func (*ClusterBootstrapReconciler) SecretsToClusters ¶
func (r *ClusterBootstrapReconciler) SecretsToClusters(o client.Object) []ctrl.Request
SecretsToClusters is the Map Function for watching Secrets that filters the events on objects of type secret and returns requests for reconcile if required
func (*ClusterBootstrapReconciler) SetupWithManager ¶
func (r *ClusterBootstrapReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
SetupWithManager performs the setup actions for an ClusterBootstrap controller, using the passed in mgr.
func (*ClusterBootstrapReconciler) TKRToClusters ¶
func (r *ClusterBootstrapReconciler) TKRToClusters(o client.Object) []ctrl.Request
TKRToClusters returns a list of Requests with Cluster ObjectKey for
type ClusterBootstrapWatchInputs ¶
type ClusterBootstrapWatchInputs struct {
// contains filtered or unexported fields
}
ClusterBootstrapWatchInputs contains the inputs for Watches set in ClusterBootstrap
type ClusterMetadataReconciler ¶
type ClusterMetadataReconciler struct { client.Client Log logr.Logger Scheme *runtime.Scheme // contains filtered or unexported fields }
ClusterMetadataReconciler reconciles a ClusterBootstrap object
func NewClusterMetadataReconciler ¶
func NewClusterMetadataReconciler(c client.Client, log logr.Logger, scheme *runtime.Scheme) *ClusterMetadataReconciler
NewClusterMetadataReconciler returns a reconciler for ClusterMetadata
func (*ClusterMetadataReconciler) Reconcile ¶
func (r *ClusterMetadataReconciler) Reconcile(ctx context.Context, req reconcile.Request) (reconcile.Result, error)
Reconcile performs the reconciliation action for the controller.
func (*ClusterMetadataReconciler) SetupWithManager ¶
func (r *ClusterMetadataReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
SetupWithManager performs the setup actions for a cluster metadata controller, using the passed in mgr.
type ClusterRole ¶
type ClusterRole int
type MachineReconciler ¶
type MachineReconciler struct { Client client.Client Log logr.Logger Scheme *runtime.Scheme // contains filtered or unexported fields }
func (*MachineReconciler) MachinesFromClusterBoostrap ¶
func (r *MachineReconciler) MachinesFromClusterBoostrap(o client.Object) []ctrl.Request
func (*MachineReconciler) SetupWithManager ¶
func (r *MachineReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
SetupWithManager adds this reconciler to a new controller then to the provided manager. Main object to watch/manage is the clusterapiv1beta1.Machine, but it also watches clusterbootstraps, and splits the clusterboostrap request into a request for each of the machines that are part of the cluster that owns the clusterboostrap.
type PackageInstallStatusReconciler ¶
type PackageInstallStatusReconciler struct { Client client.Client Log logr.Logger Scheme *runtime.Scheme Config *addonconfig.PackageInstallStatusControllerConfig // contains filtered or unexported fields }
PackageInstallStatusReconciler contains the reconciler information for PackageInstallStatus controller
func NewPackageInstallStatusReconciler ¶
func NewPackageInstallStatusReconciler( c client.Client, log logr.Logger, scheme *runtime.Scheme, config *addonconfig.PackageInstallStatusControllerConfig, tracker *remote.ClusterCacheTracker) *PackageInstallStatusReconciler
NewPackageInstallStatusReconciler returns a reconciler for PackageInstallStatus
func (*PackageInstallStatusReconciler) Reconcile ¶
func (r *PackageInstallStatusReconciler) Reconcile(_ context.Context, req reconcile.Request) (reconcile.Result, error)
Reconcile performs the reconciliation action for the controller; which is reflecting the reconciliation status of each core/additional package into corresponding ClusterBootstrap resource of the cluster
func (*PackageInstallStatusReconciler) SetupWithManager ¶
func (r *PackageInstallStatusReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error
SetupWithManager sets up the controller with the Manager.
type PackageReconciler ¶
type PackageReconciler struct { Config addonconfig.AddonControllerConfig // contains filtered or unexported fields }
PackageReconciler reconcile kapp Package related CRs
func (*PackageReconciler) ReconcileAddonKappResourceDelete ¶
func (r *PackageReconciler) ReconcileAddonKappResourceDelete( addonSecret *corev1.Secret) error
ReconcileAddonKappResourceDelete reconciles and deletes packageinstall CR
func (*PackageReconciler) ReconcileAddonKappResourceNormal ¶
func (r *PackageReconciler) ReconcileAddonKappResourceNormal( remoteApp bool, remoteCluster *clusterapiv1beta1.Cluster, addonSecret *corev1.Secret, addonConfig *tkrv1.Addon, imageRepository string, bom *tkrv1.Bom) error
ReconcileAddonKappResourceNormal reconciles and creates packageinstall CR
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package controllers implements k8s controller functionality for antrea.
|
Package controllers implements k8s controller functionality for antrea. |
Package controllers implements k8s controller functionality for calico.
|
Package controllers implements k8s controller functionality for calico. |
Package controllers implements k8s controller functionality for oracle-cpi.
|
Package controllers implements k8s controller functionality for oracle-cpi. |
Package controllers ...
|
Package controllers ... |
Package controllers implements k8s controller functionality for kapp-controller config CRD.
|
Package controllers implements k8s controller functionality for kapp-controller config CRD. |
Package controllers implements k8s controller functionality for kube-vip-cloud-provider config.
|
Package controllers implements k8s controller functionality for kube-vip-cloud-provider config. |
Package utils contains utility functions shared by controllers
|
Package utils contains utility functions shared by controllers |