Documentation
¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the tenancy v1alpha1 API group
Index ¶
- Variables
- func AreConditionSlicesSame(c1, c2 []ControlPlaneCondition) bool
- func AreConditionsEqual(c1, c2 ControlPlaneCondition) bool
- func EnsureCondition(cp *ControlPlane, newCondition ControlPlaneCondition)
- func HasConditionAvailable(conditions []ControlPlaneCondition) bool
- func Install(scheme *runtime.Scheme)
- func Resource(resource string) schema.GroupResource
- type BackendDBType
- type BootstrapSecretReference
- type ConditionReason
- type ConditionType
- type ControlPlane
- type ControlPlaneCondition
- func ConditionAvailable() ControlPlaneCondition
- func ConditionCreating() ControlPlaneCondition
- func ConditionDeleting() ControlPlaneCondition
- func ConditionReconcileError(err error) ControlPlaneCondition
- func ConditionReconcileSuccess() ControlPlaneCondition
- func ConditionUnavailable() ControlPlaneCondition
- func ConditionWaitingForPostCreateHooks() ControlPlaneCondition
- type ControlPlaneList
- type ControlPlaneSpec
- type ControlPlaneStatus
- type ControlPlaneType
- type Manifest
- type PostCreateHook
- type PostCreateHookList
- type PostCreateHookSpec
- type PostCreateHookStatus
- type PostCreateHookUse
- type SecretReference
- type Var
Constants ¶
This section is empty.
Variables ¶
var ( // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: "tenancy.kflex.kubestellar.org", Version: "v1alpha1"}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func AreConditionSlicesSame ¶ added in v0.1.1
func AreConditionSlicesSame(c1, c2 []ControlPlaneCondition) bool
areConditionSlicesSame compares two slices of ControlPlaneCondition structs and returns true if they are the same (ignoring order and LastTransitionTime and LastUpdateTime), false otherwise.
func AreConditionsEqual ¶ added in v0.1.1
func AreConditionsEqual(c1, c2 ControlPlaneCondition) bool
areConditionsEqual compares two ControlPlaneCondition structs and returns true if they are equal (excluding LastTransitionTime and LastUpdateTime), false otherwise.
func EnsureCondition ¶ added in v0.1.1
func EnsureCondition(cp *ControlPlane, newCondition ControlPlaneCondition)
func HasConditionAvailable ¶ added in v0.3.0
func HasConditionAvailable(conditions []ControlPlaneCondition) bool
func Resource ¶ added in v0.9.3
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type BackendDBType ¶
type BackendDBType string
+kubebuilder:validation:Enum=shared;dedicated
const ( BackendDBTypeDedicated BackendDBType = "dedicated" )
type BootstrapSecretReference ¶ added in v0.8.0
type BootstrapSecretReference struct {
// `namespace` is the namespace of the secret.
// Required
Namespace string `json:"namespace"`
// `name` is the name of the secret.
// Required
Name string `json:"name"`
// Required
InClusterKey string `json:"inClusterKey"`
}
BootstrapSecretReference is a reference to a secret that holds the Kubeconfig for an external cluster to adopt. See SecretReference comments for why this is not using an ObjectReference.
func (*BootstrapSecretReference) DeepCopy ¶ added in v0.8.0
func (in *BootstrapSecretReference) DeepCopy() *BootstrapSecretReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BootstrapSecretReference.
func (*BootstrapSecretReference) DeepCopyInto ¶ added in v0.8.0
func (in *BootstrapSecretReference) DeepCopyInto(out *BootstrapSecretReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ConditionReason ¶ added in v0.1.1
type ConditionReason string
const ( ReasonAvailable ConditionReason = "Available" ReasonCreating ConditionReason = "Creating" ReasonDeleting ConditionReason = "Deleting" ReasonWaitingForPostCreateHooks ConditionReason = "WaitingForPostCreateHooks" )
const ( ReasonReconcileSuccess ConditionReason = "ReconcileSuccess" ReasonReconcileError ConditionReason = "ReconcileError" ReasonReconcilePaused ConditionReason = "ReconcilePaused" )
type ConditionType ¶ added in v0.1.1
type ConditionType string
const ( TypeReady ConditionType = "Ready" TypeSynced ConditionType = "Synced" )
type ControlPlane ¶
type ControlPlane struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ControlPlaneSpec `json:"spec,omitempty"`
Status ControlPlaneStatus `json:"status,omitempty"`
}
ControlPlane is the Schema for the controlplanes API +genclient +genclient:nonNamespaced +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +kubebuilder:printcolumn:name="TYPE",type="string",JSONPath=".spec.type" +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:resource:scope=Cluster,shortName={cp,cps}
func (*ControlPlane) DeepCopy ¶
func (in *ControlPlane) DeepCopy() *ControlPlane
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlane.
func (*ControlPlane) DeepCopyInto ¶
func (in *ControlPlane) DeepCopyInto(out *ControlPlane)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ControlPlane) DeepCopyObject ¶
func (in *ControlPlane) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ControlPlaneCondition ¶ added in v0.1.1
type ControlPlaneCondition struct {
Type ConditionType `json:"type"`
Status corev1.ConditionStatus `json:"status"`
LastUpdateTime metav1.Time `json:"lastUpdateTime"`
LastTransitionTime metav1.Time `json:"lastTransitionTime"`
Reason ConditionReason `json:"reason"`
Message string `json:"message"`
}
ControlPlaneCondition describes the state of a control plane at a certain point.
func ConditionAvailable ¶ added in v0.1.1
func ConditionAvailable() ControlPlaneCondition
Available returns a condition that indicates the resource is currently observed to be available for use.
func ConditionCreating ¶ added in v0.1.1
func ConditionCreating() ControlPlaneCondition
Creating returns a condition that indicates the cp is currently being created.
func ConditionDeleting ¶ added in v0.1.1
func ConditionDeleting() ControlPlaneCondition
Deleting returns a condition that indicates the cp is currently being deleted.
func ConditionReconcileError ¶ added in v0.1.1
func ConditionReconcileError(err error) ControlPlaneCondition
ReconcileError returns a condition indicating that KubeFlex encountered an error while reconciling the resource.
func ConditionReconcileSuccess ¶ added in v0.1.1
func ConditionReconcileSuccess() ControlPlaneCondition
ReconcileSuccess returns a condition indicating that KubeFlex reconciled the resource
func ConditionUnavailable ¶ added in v0.1.1
func ConditionUnavailable() ControlPlaneCondition
Unavailable returns a condition that indicates the resource is not currently available for use.
func ConditionWaitingForPostCreateHooks ¶ added in v0.9.0
func ConditionWaitingForPostCreateHooks() ControlPlaneCondition
WaitingForPostCreateHooks returns a condition that indicates the resource is waiting for PostCreateHook completion before becoming ready.
func (*ControlPlaneCondition) DeepCopy ¶ added in v0.1.1
func (in *ControlPlaneCondition) DeepCopy() *ControlPlaneCondition
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneCondition.
func (*ControlPlaneCondition) DeepCopyInto ¶ added in v0.1.1
func (in *ControlPlaneCondition) DeepCopyInto(out *ControlPlaneCondition)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ControlPlaneList ¶
type ControlPlaneList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ControlPlane `json:"items"`
}
ControlPlaneList contains a list of ControlPlane
func (*ControlPlaneList) DeepCopy ¶
func (in *ControlPlaneList) DeepCopy() *ControlPlaneList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneList.
func (*ControlPlaneList) DeepCopyInto ¶
func (in *ControlPlaneList) DeepCopyInto(out *ControlPlaneList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*ControlPlaneList) DeepCopyObject ¶
func (in *ControlPlaneList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type ControlPlaneSpec ¶
type ControlPlaneSpec struct {
// type refers to the control plane type
// +required
Type ControlPlaneType `json:"type,omitempty"`
// backend refers to the database type used by the control plane
// For external control planes this field is optional; controller
// logic can ignore it for `external` type instances. Removed
// the `+required` marker so the CRD validation doesn't force a
// value for adopt flows that don't set a backend.
Backend BackendDBType `json:"backend,omitempty"`
// bootstrapSecretRef contains a reference to the kubeconfig used to bootstrap adoption of
// an external cluster
// +optional
BootstrapSecretRef *BootstrapSecretReference `json:"bootstrapSecretRef,omitempty"`
// tokenExpirationSeconds is the expiration time for generated auth token
// +optional
// +kubebuilder:default:=31536000
TokenExpirationSeconds *int64 `json:"tokenExpirationSeconds,omitempty"`
// Deprecated: Use PostCreateHooks instead
PostCreateHook *string `json:"postCreateHook,omitempty"`
// Deprecated: Use PostCreateHooks instead
PostCreateHookVars map[string]string `json:"postCreateHookVars,omitempty"`
// PostCreateHooks specifies multiple post-creation hooks to execute
PostCreateHooks []PostCreateHookUse `json:"postCreateHooks,omitempty"`
// GlobalVars defines shared variables for all post-creation hooks
// +optional
GlobalVars map[string]string `json:"globalVars,omitempty"`
// WaitForPostCreateHooks determines if the control plane should wait for all
// post create hook resources to be ready before marking the control plane as ready
// +optional
// +kubebuilder:default:=false
WaitForPostCreateHooks *bool `json:"waitForPostCreateHooks,omitempty"`
}
ControlPlaneSpec defines the desired state of ControlPlane
func (*ControlPlaneSpec) DeepCopy ¶
func (in *ControlPlaneSpec) DeepCopy() *ControlPlaneSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneSpec.
func (*ControlPlaneSpec) DeepCopyInto ¶
func (in *ControlPlaneSpec) DeepCopyInto(out *ControlPlaneSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ControlPlaneStatus ¶
type ControlPlaneStatus struct {
Conditions []ControlPlaneCondition `json:"conditions"`
ObservedGeneration int64 `json:"observedGeneration"`
// SecretRef contains a referece to the secret containing the Kubeconfig for the control plane
SecretRef *SecretReference `json:"secretRef,omitempty"`
// +optional
PostCreateHooks map[string]bool `json:"postCreateHooks,omitempty"`
// +optional
PostCreateHookCompleted bool `json:"postCreateHookCompleted,omitempty"`
}
ControlPlaneStatus defines the observed state of ControlPlane
func (*ControlPlaneStatus) DeepCopy ¶
func (in *ControlPlaneStatus) DeepCopy() *ControlPlaneStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ControlPlaneStatus.
func (*ControlPlaneStatus) DeepCopyInto ¶
func (in *ControlPlaneStatus) DeepCopyInto(out *ControlPlaneStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ControlPlaneType ¶ added in v0.2.0
type ControlPlaneType string
+kubebuilder:validation:Enum=k8s;ocm;vcluster;host;external;k3s
const ( ControlPlaneTypeK8S ControlPlaneType = "k8s" ControlPlaneTypeOCM ControlPlaneType = "ocm" ControlPlaneTypeVCluster ControlPlaneType = "vcluster" ControlPlaneTypeHost ControlPlaneType = "host" ControlPlaneTypeExternal ControlPlaneType = "external" ControlPlaneTypeK3s ControlPlaneType = "k3s" )
type Manifest ¶ added in v0.3.0
type Manifest struct {
// +kubebuilder:validation:EmbeddedResource
// +kubebuilder:pruning:PreserveUnknownFields
runtime.RawExtension `json:",inline"`
}
Manifest represents a resource to be deployed
func (*Manifest) DeepCopy ¶ added in v0.3.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Manifest.
func (*Manifest) DeepCopyInto ¶ added in v0.3.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostCreateHook ¶ added in v0.3.0
type PostCreateHook struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec PostCreateHookSpec `json:"spec,omitempty"`
Status PostCreateHookStatus `json:"status,omitempty"`
}
PostCreateHook is the Schema for the postcreatehooks API +genclient +genclient:nonNamespaced +kubebuilder:object:root=true +kubebuilder:subresource:status +kubebuilder:printcolumn:name="SYNCED",type="string",JSONPath=".status.conditions[?(@.type=='Synced')].status" +kubebuilder:printcolumn:name="READY",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status" +kubebuilder:printcolumn:name="TYPE",type="string",JSONPath=".spec.type" +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp" +kubebuilder:resource:scope=Cluster,shortName={pch,pchs}
func (*PostCreateHook) DeepCopy ¶ added in v0.3.0
func (in *PostCreateHook) DeepCopy() *PostCreateHook
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostCreateHook.
func (*PostCreateHook) DeepCopyInto ¶ added in v0.3.0
func (in *PostCreateHook) DeepCopyInto(out *PostCreateHook)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PostCreateHook) DeepCopyObject ¶ added in v0.3.0
func (in *PostCreateHook) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PostCreateHookList ¶ added in v0.3.0
type PostCreateHookList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []PostCreateHook `json:"items"`
}
PostCreateHookList contains a list of PostCreateHook
func (*PostCreateHookList) DeepCopy ¶ added in v0.3.0
func (in *PostCreateHookList) DeepCopy() *PostCreateHookList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostCreateHookList.
func (*PostCreateHookList) DeepCopyInto ¶ added in v0.3.0
func (in *PostCreateHookList) DeepCopyInto(out *PostCreateHookList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*PostCreateHookList) DeepCopyObject ¶ added in v0.3.0
func (in *PostCreateHookList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type PostCreateHookSpec ¶ added in v0.3.0
type PostCreateHookSpec struct {
Templates []Manifest `json:"templates,omitempty"`
DefaultVars []Var `json:"defaultVars,omitempty"`
}
PostCreateHookSpec defines the desired state of PostCreateHook
func (*PostCreateHookSpec) DeepCopy ¶ added in v0.3.0
func (in *PostCreateHookSpec) DeepCopy() *PostCreateHookSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostCreateHookSpec.
func (*PostCreateHookSpec) DeepCopyInto ¶ added in v0.3.0
func (in *PostCreateHookSpec) DeepCopyInto(out *PostCreateHookSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostCreateHookStatus ¶ added in v0.3.0
type PostCreateHookStatus struct {
Conditions []ControlPlaneCondition `json:"conditions"`
ObservedGeneration int64 `json:"observedGeneration"`
// SecretRef contains a referece to the secret containing the Kubeconfig for the control plane
SecretRef *SecretReference `json:"secretRef,omitempty"`
}
PostCreateHookStatus defines the observed state of PostCreateHook
func (*PostCreateHookStatus) DeepCopy ¶ added in v0.3.0
func (in *PostCreateHookStatus) DeepCopy() *PostCreateHookStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostCreateHookStatus.
func (*PostCreateHookStatus) DeepCopyInto ¶ added in v0.3.0
func (in *PostCreateHookStatus) DeepCopyInto(out *PostCreateHookStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PostCreateHookUse ¶ added in v0.9.0
type PostCreateHookUse struct {
// Name of the PostCreateHook resource to execute
HookName *string `json:"hookName"`
// Variables to pass to the hook template
// +optional
Vars map[string]string `json:"vars,omitempty"`
}
func (*PostCreateHookUse) DeepCopy ¶ added in v0.9.0
func (in *PostCreateHookUse) DeepCopy() *PostCreateHookUse
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostCreateHookUse.
func (*PostCreateHookUse) DeepCopyInto ¶ added in v0.9.0
func (in *PostCreateHookUse) DeepCopyInto(out *PostCreateHookUse)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SecretReference ¶ added in v0.2.6
type SecretReference struct {
// `namespace` is the namespace of the secret.
// Required
Namespace string `json:"namespace"`
// `name` is the name of the secret.
// Required
Name string `json:"name"`
// This field is present for control planes of type `k8s`, `vcluster`, `ocm`, `host`.`
// it is not present for control planes of type `external`.
// Controllers for control planes of type `external` should always use the `InClusterKey`.
// +optional
Key string `json:"key"`
// Required
InClusterKey string `json:"inClusterKey"`
}
SecretReference is a reference to a secret that holds the kubeconfigs for a control plane hosted in the kubeflex hosting cluster, or for a kubeconfig for the hosting cluster itself (in the case of a control plane of type 'host') or for a control plane representing an external cluster. The 'Key' field references the kubeconfig that can be used for acccess to a control plane API server from outside the KubeFlex hosting cluster, while the 'InClusterKey' references the kubeconfig that can be used for acccess to a control plane API server from inside the cluster. We do not use ObjectReference as its use is discouraged in favor of a locally defined type. See ObjectReference in https://github.com/kubernetes/api/blob/master/core/v1/types.go
func (*SecretReference) DeepCopy ¶ added in v0.2.6
func (in *SecretReference) DeepCopy() *SecretReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretReference.
func (*SecretReference) DeepCopyInto ¶ added in v0.2.6
func (in *SecretReference) DeepCopyInto(out *SecretReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Var ¶ added in v0.8.6
Var defines a name/value pair for template variables
func (*Var) DeepCopy ¶ added in v0.9.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Var.
func (*Var) DeepCopyInto ¶ added in v0.9.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.