Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the kustomize v1alpha1 API group +kubebuilder:object:generate=true +groupName=kustomize.toolkit.fluxcd.io
Index ¶
- Constants
- Variables
- func SetKustomizationCondition(k *Kustomization, condition string, status corev1.ConditionStatus, ...)
- func SetKustomizationReadiness(k *Kustomization, status corev1.ConditionStatus, reason, message string, ...)
- type Condition
- type CrossNamespaceObjectReference
- type Kustomization
- func DependencySort(ks []Kustomization) ([]Kustomization, error)
- func KustomizationNotReady(k Kustomization, revision, reason, message string) Kustomization
- func KustomizationNotReadySnapshot(k Kustomization, snapshot *Snapshot, revision, reason, message string) Kustomization
- func KustomizationProgressing(k Kustomization) Kustomization
- func KustomizationReady(k Kustomization, snapshot *Snapshot, revision, reason, message string) Kustomization
- type KustomizationList
- type KustomizationSpec
- type KustomizationStatus
- type ServiceAccount
- type Snapshot
- type SnapshotEntry
- type Unsortable
- type WorkloadReference
Constants ¶
const ( // ApplySucceededReason represents the fact that the kustomization apply succeeded. ApplySucceededReason string = "ApplySucceeded" // ApplyFailedReason represents the fact that the kustomization apply failed. ApplyFailedReason string = "ApplyFailed" // PruneFailedReason represents the fact that the kustomization pruning failed. PruneFailedReason string = "PruneFailed" // ArtifactFailedReason represents the fact that the artifact download failed. ArtifactFailedReason string = "ArtifactFailed" // BuildFailedReason represents the fact that the kustomize build command failed. BuildFailedReason string = "BuildFailed" // DependencyNotReady represents the fact that the one of the dependencies is not ready. DependencyNotReadyReason string = "DependencyNotReady" // HealthCheckFailedReason represents the fact that the one of the health check failed. HealthCheckFailedReason string = "HealthCheckFailed" // InitializedReason represents the fact that a given resource has been initialized. InitializedReason string = "Initialized" // ProgressingReason represents the fact that a kustomization reconciliation // is underway. ProgressingReason string = "Progressing" // SuspendedReason represents the fact that the kustomization execution is suspended. SuspendedReason string = "Suspended" // ValidationFailedReason represents the fact that the dry-run apply failed. ValidationFailedReason string = "ValidationFailed" )
const ( // ReconcileAtAnnotation is the annotation used for triggering a // reconciliation outside of the defined schedule. ReconcileAtAnnotation string = "fluxcd.io/reconcileAt" // SourceIndexKey is the key used for indexing kustomizations // based on their sources. SourceIndexKey string = ".metadata.source" )
const KustomizationFinalizer = "finalizers.fluxcd.io"
const KustomizationKind = "Kustomization"
const ( // ReadyCondition represents the fact that a given kustomization has passed // validation and was successfully applied on the cluster. ReadyCondition string = "Ready" )
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "kustomize.toolkit.fluxcd.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 SetKustomizationCondition ¶
func SetKustomizationCondition(k *Kustomization, condition string, status corev1.ConditionStatus, reason, message string)
SetKustomizationCondition sets the given condition with the given status, reason and message on the Kustomization.
func SetKustomizationReadiness ¶
func SetKustomizationReadiness(k *Kustomization, status corev1.ConditionStatus, reason, message string, revision string)
SetKustomizeReadiness sets the ReadyCondition, ObservedGeneration, and LastAttemptedRevision, on the Kustomization.
Types ¶
type Condition ¶
type Condition struct {
// Type of the condition, currently ('Ready').
// +required
Type string `json:"type"`
// Status of the condition, one of ('True', 'False', 'Unknown').
// +required
Status corev1.ConditionStatus `json:"status"`
// LastTransitionTime is the timestamp corresponding to the last status
// change of this condition.
// +required
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
// Reason is a brief machine readable explanation for the condition's last
// transition.
// +required
Reason string `json:"reason,omitempty"`
// Message is a human readable description of the details of the last
// transition, complementing reason.
// +optional
Message string `json:"message,omitempty"`
}
Condition contains condition information for a kustomization.
func (*Condition) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.
func (*Condition) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CrossNamespaceObjectReference ¶
type CrossNamespaceObjectReference struct {
// API version of the referent
// +optional
APIVersion string `json:"apiVersion,omitempty"`
// Kind of the referent
// +kubebuilder:validation:Enum=GitRepository
// +required
Kind string `json:"kind"`
// Name of the referent
// +required
Name string `json:"name"`
// Namespace of the referent
// +optional
Namespace string `json:"namespace,omitempty"`
}
CrossNamespaceObjectReference contains enough information to let you locate the typed referenced object at cluster level
func (*CrossNamespaceObjectReference) DeepCopy ¶
func (in *CrossNamespaceObjectReference) DeepCopy() *CrossNamespaceObjectReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossNamespaceObjectReference.
func (*CrossNamespaceObjectReference) DeepCopyInto ¶
func (in *CrossNamespaceObjectReference) DeepCopyInto(out *CrossNamespaceObjectReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Kustomization ¶
type Kustomization struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec KustomizationSpec `json:"spec,omitempty"`
Status KustomizationStatus `json:"status,omitempty"`
}
Kustomization is the Schema for the kustomizations API.
func DependencySort ¶
func DependencySort(ks []Kustomization) ([]Kustomization, error)
func KustomizationNotReady ¶
func KustomizationNotReady(k Kustomization, revision, reason, message string) Kustomization
KustomizationNotReady registers a failed apply attempt of the given Kustomization.
func KustomizationNotReadySnapshot ¶
func KustomizationNotReadySnapshot(k Kustomization, snapshot *Snapshot, revision, reason, message string) Kustomization
KustomizationNotReady registers a failed apply attempt of the given Kustomization, including a Snapshot.
func KustomizationProgressing ¶
func KustomizationProgressing(k Kustomization) Kustomization
KustomizationProgressing resets the conditions of the given Kustomization to a single ReadyCondition with status ConditionUnknown.
func KustomizationReady ¶
func KustomizationReady(k Kustomization, snapshot *Snapshot, revision, reason, message string) Kustomization
KustomizationReady registers a successful apply attempt of the given Kustomization.
func (*Kustomization) DeepCopy ¶
func (in *Kustomization) DeepCopy() *Kustomization
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kustomization.
func (*Kustomization) DeepCopyInto ¶
func (in *Kustomization) DeepCopyInto(out *Kustomization)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Kustomization) DeepCopyObject ¶
func (in *Kustomization) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*Kustomization) GetTimeout ¶
func (in *Kustomization) GetTimeout() time.Duration
GetTimeout returns the timeout with default
type KustomizationList ¶
type KustomizationList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Kustomization `json:"items"`
}
KustomizationList contains a list of kustomizations.
func (*KustomizationList) DeepCopy ¶
func (in *KustomizationList) DeepCopy() *KustomizationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizationList.
func (*KustomizationList) DeepCopyInto ¶
func (in *KustomizationList) DeepCopyInto(out *KustomizationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*KustomizationList) DeepCopyObject ¶
func (in *KustomizationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type KustomizationSpec ¶
type KustomizationSpec struct {
// A list of kustomizations that must be ready before this
// kustomization can be applied.
// +optional
DependsOn []string `json:"dependsOn,omitempty"`
// The interval at which to apply the kustomization.
// +required
Interval metav1.Duration `json:"interval"`
// Path to the directory containing the kustomization file.
// +kubebuilder:validation:Pattern="^\\./"
// +required
Path string `json:"path"`
// Enables garbage collection.
// +required
Prune bool `json:"prune"`
// A list of workloads (Deployments, DaemonSets and StatefulSets)
// to be included in the health assessment.
// +optional
HealthChecks []WorkloadReference `json:"healthChecks,omitempty"`
// The Kubernetes service account used for applying the kustomization.
// +optional
ServiceAccount *ServiceAccount `json:"serviceAccount,omitempty"`
// Reference of the source where the kustomization file is.
// +required
SourceRef CrossNamespaceObjectReference `json:"sourceRef"`
// This flag tells the controller to suspend subsequent kustomize executions,
// it does not apply to already started executions. Defaults to false.
// +optional
Suspend bool `json:"suspend,omitempty"`
// Timeout for validation, apply and health checking operations.
// Defaults to 'Interval' duration.
// +optional
Timeout *metav1.Duration `json:"timeout,omitempty"`
// Validate the Kubernetes objects before applying them on the cluster.
// The validation strategy can be 'client' (local dry-run) or 'server' (APIServer dry-run).
// +kubebuilder:validation:Enum=client;server
// +optional
Validation string `json:"validation,omitempty"`
}
KustomizationSpec defines the desired state of a kustomization.
func (*KustomizationSpec) DeepCopy ¶
func (in *KustomizationSpec) DeepCopy() *KustomizationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizationSpec.
func (*KustomizationSpec) DeepCopyInto ¶
func (in *KustomizationSpec) DeepCopyInto(out *KustomizationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type KustomizationStatus ¶
type KustomizationStatus struct {
// ObservedGeneration is the last reconciled generation.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
// +optional
Conditions []Condition `json:"conditions,omitempty"`
// The last successfully applied revision.
// The revision format for Git sources is <branch|tag>/<commit-sha>.
// +optional
LastAppliedRevision string `json:"lastAppliedRevision,omitempty"`
// LastAttemptedRevision is the revision of the last reconciliation attempt.
// +optional
LastAttemptedRevision string `json:"lastAttemptedRevision,omitempty"`
// The last successfully applied revision metadata.
// +optional
Snapshot *Snapshot `json:"snapshot,omitempty"`
}
KustomizationStatus defines the observed state of a kustomization.
func (*KustomizationStatus) DeepCopy ¶
func (in *KustomizationStatus) DeepCopy() *KustomizationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizationStatus.
func (*KustomizationStatus) DeepCopyInto ¶
func (in *KustomizationStatus) DeepCopyInto(out *KustomizationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ServiceAccount ¶
type ServiceAccount struct {
// Name is the name of the service account being referenced.
// +required
Name string `json:"name"`
// Namespace is the namespace of the service account being referenced.
// +required
Namespace string `json:"namespace"`
}
ServiceAccount defines a reference to a Kubernetes service account.
func (*ServiceAccount) DeepCopy ¶
func (in *ServiceAccount) DeepCopy() *ServiceAccount
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceAccount.
func (*ServiceAccount) DeepCopyInto ¶
func (in *ServiceAccount) DeepCopyInto(out *ServiceAccount)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Snapshot ¶
type Snapshot struct {
// The source revision.
// +required
Revision string `json:"revision"`
// A list of Kubernetes kinds grouped by namespace.
// +required
Entries []SnapshotEntry `json:"entries"`
}
Snapshot holds the metadata of the Kubernetes objects generated for a source revision
func (*Snapshot) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Snapshot.
func (*Snapshot) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Snapshot) NamespacedKinds ¶
func (*Snapshot) NonNamespacedKinds ¶
type SnapshotEntry ¶
type SnapshotEntry struct {
// The namespace of this entry.
// +optional
Namespace string `json:"namespace"`
// The list of Kubernetes kinds.
// +required
Kinds map[string]string `json:"kinds"`
}
Snapshot holds the metadata of namespaced Kubernetes objects
func (*SnapshotEntry) DeepCopy ¶
func (in *SnapshotEntry) DeepCopy() *SnapshotEntry
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapshotEntry.
func (*SnapshotEntry) DeepCopyInto ¶
func (in *SnapshotEntry) DeepCopyInto(out *SnapshotEntry)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Unsortable ¶
type Unsortable [][]string
+kubebuilder:object:generate=false
func (Unsortable) Error ¶
func (e Unsortable) Error() string
type WorkloadReference ¶
type WorkloadReference struct {
// Kind is the type of resource being referenced.
// +kubebuilder:validation:Enum=Deployment;DaemonSet;StatefulSet
// +required
Kind string `json:"kind"`
// Name is the name of resource being referenced.
// +required
Name string `json:"name"`
// Namespace is the namespace of resource being referenced.
// +required
Namespace string `json:"namespace"`
}
WorkloadReference defines a reference to a Deployment, DaemonSet or StatefulSet.
func (*WorkloadReference) DeepCopy ¶
func (in *WorkloadReference) DeepCopy() *WorkloadReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadReference.
func (*WorkloadReference) DeepCopyInto ¶
func (in *WorkloadReference) DeepCopyInto(out *WorkloadReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.