v1alpha1

package
v0.48.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the lib v1alpha1 API group +kubebuilder:object:generate=true +groupName=lib.projectsveltos.io

Index

Constants

View Source
const (
	// EventTriggerFinalizer allows Reconcilers to clean up resources associated with
	// EventTrigger before removing it from the apiserver.
	EventTriggerFinalizer = "eventtrigger.finalizer.projectsveltos.io"

	EventTriggerKind = "EventTrigger"

	FeatureEventTrigger = "EventTrigger"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "lib.projectsveltos.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func Convert_v1alpha1_EventTriggerList_To_v1beta1_EventTriggerList added in v0.33.0

func Convert_v1alpha1_EventTriggerList_To_v1beta1_EventTriggerList(in *EventTriggerList, out *v1beta1.EventTriggerList, s conversion.Scope) error

Convert_v1alpha1_EventTriggerList_To_v1beta1_EventTriggerList is an autogenerated conversion function.

func Convert_v1alpha1_EventTriggerSpec_To_v1beta1_EventTriggerSpec added in v0.33.0

func Convert_v1alpha1_EventTriggerSpec_To_v1beta1_EventTriggerSpec(srcSpec *EventTriggerSpec,
	dstSpec *v1beta1.EventTriggerSpec, scope apimachineryconversion.Scope) error

func Convert_v1alpha1_EventTriggerStatus_To_v1beta1_EventTriggerStatus added in v0.33.0

func Convert_v1alpha1_EventTriggerStatus_To_v1beta1_EventTriggerStatus(in *EventTriggerStatus, out *v1beta1.EventTriggerStatus, s conversion.Scope) error

Convert_v1alpha1_EventTriggerStatus_To_v1beta1_EventTriggerStatus is an autogenerated conversion function.

func Convert_v1alpha1_EventTrigger_To_v1beta1_EventTrigger added in v0.33.0

func Convert_v1alpha1_EventTrigger_To_v1beta1_EventTrigger(in *EventTrigger, out *v1beta1.EventTrigger, s conversion.Scope) error

Convert_v1alpha1_EventTrigger_To_v1beta1_EventTrigger is an autogenerated conversion function.

func Convert_v1alpha1_HelmChart_To_v1beta1_HelmChart added in v0.38.0

func Convert_v1alpha1_HelmChart_To_v1beta1_HelmChart(src *configv1alpha1.HelmChart, dst *configv1beta1.HelmChart, s conversion.Scope,
) error

func Convert_v1beta1_EventTriggerList_To_v1alpha1_EventTriggerList added in v0.33.0

func Convert_v1beta1_EventTriggerList_To_v1alpha1_EventTriggerList(in *v1beta1.EventTriggerList, out *EventTriggerList, s conversion.Scope) error

Convert_v1beta1_EventTriggerList_To_v1alpha1_EventTriggerList is an autogenerated conversion function.

func Convert_v1beta1_EventTriggerSpec_To_v1alpha1_EventTriggerSpec added in v0.33.0

func Convert_v1beta1_EventTriggerSpec_To_v1alpha1_EventTriggerSpec(srcSpec *v1beta1.EventTriggerSpec, dstSpec *EventTriggerSpec,
	scope apimachineryconversion.Scope,
) error

func Convert_v1beta1_EventTriggerStatus_To_v1alpha1_EventTriggerStatus added in v0.33.0

func Convert_v1beta1_EventTriggerStatus_To_v1alpha1_EventTriggerStatus(in *v1beta1.EventTriggerStatus, out *EventTriggerStatus, s conversion.Scope) error

Convert_v1beta1_EventTriggerStatus_To_v1alpha1_EventTriggerStatus is an autogenerated conversion function.

func Convert_v1beta1_EventTrigger_To_v1alpha1_EventTrigger added in v0.33.0

func Convert_v1beta1_EventTrigger_To_v1alpha1_EventTrigger(in *v1beta1.EventTrigger, out *EventTrigger, s conversion.Scope) error

Convert_v1beta1_EventTrigger_To_v1alpha1_EventTrigger is an autogenerated conversion function.

func Convert_v1beta1_HelmChart_To_v1alpha1_HelmChart added in v0.38.0

func Convert_v1beta1_HelmChart_To_v1alpha1_HelmChart(src *configv1beta1.HelmChart, dst *configv1alpha1.HelmChart, s conversion.Scope,
) error

func RegisterConversions added in v0.33.0

func RegisterConversions(s *runtime.Scheme) error

RegisterConversions adds conversion functions to the given scheme. Public to allow building arbitrary schemes.

Types

type EventTrigger added in v0.21.0

type EventTrigger struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   EventTriggerSpec   `json:"spec,omitempty"`
	Status EventTriggerStatus `json:"status,omitempty"`
}

EventTrigger is the Schema for the eventtriggers API

func (*EventTrigger) ConvertFrom added in v0.33.0

func (dst *EventTrigger) ConvertFrom(srcRaw conversion.Hub) error

ConvertFrom converts from the Hub version (v1beta1) to this v1alpha1.

func (*EventTrigger) ConvertTo added in v0.33.0

func (src *EventTrigger) ConvertTo(dstRaw conversion.Hub) error

ConvertTo converts v1alpha1 to the Hub version (v1beta1).

func (*EventTrigger) DeepCopy added in v0.21.0

func (in *EventTrigger) DeepCopy() *EventTrigger

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventTrigger.

func (*EventTrigger) DeepCopyInto added in v0.21.0

func (in *EventTrigger) DeepCopyInto(out *EventTrigger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*EventTrigger) DeepCopyObject added in v0.21.0

func (in *EventTrigger) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type EventTriggerList added in v0.21.0

type EventTriggerList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []EventTrigger `json:"items"`
}

EventTriggerList contains a list of EventTrigger

func (*EventTriggerList) DeepCopy added in v0.21.0

func (in *EventTriggerList) DeepCopy() *EventTriggerList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventTriggerList.

func (*EventTriggerList) DeepCopyInto added in v0.21.0

func (in *EventTriggerList) DeepCopyInto(out *EventTriggerList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*EventTriggerList) DeepCopyObject added in v0.21.0

func (in *EventTriggerList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type EventTriggerSpec added in v0.21.0

type EventTriggerSpec struct {
	// SourceClusterSelector identifies clusters to associate to.
	// This represents the set of clusters where Sveltos will watch for
	// events defined by referenced EventSource
	SourceClusterSelector libsveltosv1alpha1.Selector `json:"sourceClusterSelector"`

	// SetRefs identifies referenced ClusterSets. Name of the referenced ClusterSets.
	// +optional
	ClusterSetRefs []string `json:"clusterSetRefs,omitempty"`

	// Multiple resources in a managed cluster can be a match for referenced
	// EventSource. OneForEvent indicates whether a ClusterProfile for all
	// resource (OneForEvent = false) or one per resource (OneForEvent = true)
	// needs to be creted.
	// +optional
	OneForEvent bool `json:"oneForEvent,omitempty"`

	// EventSourceName is the name of the referenced EventSource.
	// Resources contained in the referenced ConfigMaps/Secrets and HelmCharts
	// will be customized using information from resources matching the EventSource
	// in the managed cluster.
	EventSourceName string `json:"eventSourceName"`

	// DestinationClusterSelector identifies the cluster where add-ons will be deployed.
	// By default, this is nil and add-ons will be deployed in the very same cluster the
	// event happened.
	// If DestinationClusterSelector is set though, when an event happens in any of the
	// cluster identified by SourceClusterSelector, add-ons will be deployed in each of
	// the cluster indentified by DestinationClusterSelector.
	// +omitempty
	DestinationClusterSelector *libsveltosv1alpha1.Selector `json:"destinationClusterSelector,omitempty"`

	// SyncMode specifies how features are synced in a matching workload cluster.
	// - OneTime means, first time a workload cluster matches the ClusterProfile,
	// features will be deployed in such cluster. Any subsequent feature configuration
	// change won't be applied into the matching workload clusters;
	// - Continuous mode ensures that the first time a workload cluster matches a ClusterProfile,
	// the specified features are deployed. Subsequent changes to the feature configuration are also
	// automatically applied to all matching workload clusters.
	// _ SyncModeContinuousWithDriftDetection operates similarly to Continuous mode, but also monitors
	// matching managed clusters for configuration drift. If drift is detected, a reconciliation is
	// triggered to ensure the managed cluster's configuration aligns with the ClusterProfile.
	// - DryRun means no change will be propagated to any matching cluster. A report
	// instead will be generated summarizing what would happen in any matching cluster
	// because of the changes made to ClusterProfile while in DryRun mode.
	// +kubebuilder:default:=Continuous
	// +optional
	SyncMode configv1alpha1.SyncMode `json:"syncMode,omitempty"`

	// Tier controls the order of deployment for ClusterProfile or Profile resources targeting
	// the same cluster resources.
	// Imagine two configurations (ClusterProfiles or Profiles) trying to deploy the same resource (a Kubernetes
	// resource or an helm chart). By default, the first one to reach the cluster "wins" and deploys it.
	// Tier allows you to override this. When conflicts arise, the ClusterProfile or Profile with the **lowest**
	// Tier value takes priority and deploys the resource.
	// Higher Tier values represent lower priority. The default Tier value is 100.
	// Using Tiers provides finer control over resource deployment within your cluster, particularly useful
	// when multiple configurations manage the same resources.
	// +kubebuilder:default:=100
	// +kubebuilder:validation:Minimum=1
	// +optional
	Tier int32 `json:"tier,omitempty"`

	// By default (when ContinueOnConflict is unset or set to false), Sveltos stops deployment after
	// encountering the first conflict (e.g., another ClusterProfile already deployed the resource).
	// If set to true, Sveltos will attempt to deploy remaining resources in the ClusterProfile even
	// if conflicts are detected for previous resources.
	// +kubebuilder:default:=false
	// +optional
	ContinueOnConflict bool `json:"continueOnConflict,omitempty"`

	// The maximum number of clusters that can be updated concurrently.
	// Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%).
	// Defaults to 100%.
	// Example: when this is set to 30%, when list of add-ons/applications in ClusterProfile
	// changes, only 30% of matching clusters will be updated in parallel. Only when updates
	// in those cluster succeed, other matching clusters are updated.
	// +kubebuilder:validation:XIntOrString
	// +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$"
	// +optional
	MaxUpdate *intstr.IntOrString `json:"maxUpdate,omitempty"`

	// StopMatchingBehavior indicates what behavior should be when a Cluster stop matching
	// the ClusterProfile. By default all deployed Helm charts and Kubernetes resources will
	// be withdrawn from Cluster. Setting StopMatchingBehavior to LeavePolicies will instead
	// leave ClusterProfile deployed policies in the Cluster.
	// +kubebuilder:default:=WithdrawPolicies
	// +optional
	StopMatchingBehavior configv1alpha1.StopMatchingBehavior `json:"stopMatchingBehavior,omitempty"`

	// Reloader indicates whether Deployment/StatefulSet/DaemonSet instances deployed
	// by Sveltos and part of this ClusterProfile need to be restarted via rolling upgrade
	// when a ConfigMap/Secret instance mounted as volume is modified.
	// When set to true, when any mounted ConfigMap/Secret is modified, Sveltos automatically
	// starts a rolling upgrade for Deployment/StatefulSet/DaemonSet instances mounting it.
	// +kubebuilder:default:=false
	// +optional
	Reloader bool `json:"reloader,omitempty"`

	// TemplateResourceRefs is a list of resource to collect from the management cluster.
	// Those resources' values will be used to instantiate templates contained in referenced
	// PolicyRefs and Helm charts
	// +patchMergeKey=identifier
	// +patchStrategy=merge,retainKeys
	// +optional
	TemplateResourceRefs []configv1alpha1.TemplateResourceRef `json:"templateResourceRefs,omitempty"`

	// PolicyRefs references all the ConfigMaps/Secrets containing kubernetes resources
	// that need to be deployed in the matching clusters based on EventSource.
	// +optional
	PolicyRefs []configv1alpha1.PolicyRef `json:"policyRefs,omitempty"`

	// Helm charts to be deployed in the matching clusters based on EventSource.
	HelmCharts []configv1alpha1.HelmChart `json:"helmCharts,omitempty"`

	// Kustomization refs
	KustomizationRefs []configv1alpha1.KustomizationRef `json:"kustomizationRefs,omitempty"`

	// ValidateHealths is a slice of Lua functions to run against
	// the managed cluster to validate the state of those add-ons/applications
	// is healthy
	// +optional
	ValidateHealths []configv1alpha1.ValidateHealth `json:"validateHealths,omitempty"`

	// ExtraLabels: These labels will be added by Sveltos to all Kubernetes resources deployed in
	// a managed cluster based on this ClusterProfile/Profile instance.
	// **Important:** If a resource deployed by Sveltos already has a label with a key present in
	// `ExtraLabels`, the value from `ExtraLabels` will override the existing value.
	// +optional
	ExtraLabels map[string]string `json:"extraLabels,omitempty"`

	// ExtraAnnotations: These annotations will be added by Sveltos to all Kubernetes resources
	// deployed in a managed cluster based on this ClusterProfile/Profile instance.
	// **Important:** If a resource deployed by Sveltos already has a annotation with a key present in
	// `ExtraAnnotations`, the value from `ExtraAnnotations` will override the existing value.
	// +optional
	ExtraAnnotations map[string]string `json:"extraAnnotations,omitempty"`
}

EventTriggerSpec defines the desired state of EventTrigger

func (*EventTriggerSpec) DeepCopy added in v0.21.0

func (in *EventTriggerSpec) DeepCopy() *EventTriggerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventTriggerSpec.

func (*EventTriggerSpec) DeepCopyInto added in v0.21.0

func (in *EventTriggerSpec) DeepCopyInto(out *EventTriggerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EventTriggerStatus added in v0.21.0

type EventTriggerStatus struct {
	// MatchingClusterRefs reference all the cluster-api Cluster currently matching
	// ClusterProfile SourceClusterSelector
	// +optional
	MatchingClusterRefs []corev1.ObjectReference `json:"matchingClusters,omitempty"`

	// DestinationMatchingClusterRefs reference all the cluster-api Cluster currently matching
	// ClusterProfile DestinationClusterSelector
	// +optional
	DestinationMatchingClusterRefs []corev1.ObjectReference `json:"destinationMatchingClusterRefs,omitempty"`

	// ClusterInfo represent the deployment status in each managed
	// cluster.
	// +optional
	ClusterInfo []libsveltosv1alpha1.ClusterInfo `json:"clusterInfo,omitempty"`
}

EventTriggerStatus defines the observed state of EventTrigger

func (*EventTriggerStatus) DeepCopy added in v0.21.0

func (in *EventTriggerStatus) DeepCopy() *EventTriggerStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventTriggerStatus.

func (*EventTriggerStatus) DeepCopyInto added in v0.21.0

func (in *EventTriggerStatus) DeepCopyInto(out *EventTriggerStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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