v1alpha1

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2022 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Overview

Package v1alpha1 is the v1alpha1 version of the API. +k8s:deepcopy-gen=package,register +k8s:openapi-gen=true +groupName=work.karmada.io

Index

Constants

View Source
const (
	// EventReasonSyncWorkFailed indicates that Sync work failed.
	EventReasonSyncWorkFailed = "SyncFailed"

	// EventReasonSyncWorkSucceed indicates that Sync work succeed.
	EventReasonSyncWorkSucceed = "SyncSucceed"
)

Define events for work objects.

View Source
const (
	// ResourceBindingNamespaceLabel is added to objects to specify associated ResourceBinding's namespace.
	ResourceBindingNamespaceLabel = "resourcebinding.karmada.io/namespace"

	// ResourceBindingNameLabel is added to objects to specify associated ResourceBinding's name.
	ResourceBindingNameLabel = "resourcebinding.karmada.io/name"

	// ClusterResourceBindingLabel is added to objects to specify associated ClusterResourceBinding.
	ClusterResourceBindingLabel = "clusterresourcebinding.karmada.io/name"

	// WorkNamespaceLabel is added to objects to specify associated Work's namespace.
	WorkNamespaceLabel = "work.karmada.io/namespace"

	// WorkNameLabel is added to objects to specify associated Work's name.
	WorkNameLabel = "work.karmada.io/name"
)
View Source
const (
	// ResourceKindWork is kind name of Work.
	ResourceKindWork = "Work"
	// ResourceSingularWork is singular name of Work.
	ResourceSingularWork = "work"
	// ResourcePluralWork is plural name of Work.
	ResourcePluralWork = "works"
	// ResourceNamespaceScopedWork indicates if Work is NamespaceScoped.
	ResourceNamespaceScopedWork = true
)
View Source
const (
	// WorkApplied represents that the resource defined in Work is
	// successfully applied on the managed cluster.
	WorkApplied string = "Applied"
	// WorkProgressing represents that the resource defined in Work is
	// in the progress to be applied on the managed cluster.
	WorkProgressing string = "Progressing"
	// WorkAvailable represents that all resources of the Work exists on
	// the managed cluster.
	WorkAvailable string = "Available"
	// WorkDegraded represents that the current state of Work does not match
	// the desired state for a certain period.
	WorkDegraded string = "Degraded"
)
View Source
const GroupName = "work.karmada.io"

GroupName specifies the group name used to register the objects.

Variables

View Source
var (
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	// Depreciated: use Install instead
	AddToScheme = localSchemeBuilder.AddToScheme
	Install     = localSchemeBuilder.AddToScheme
)
View Source
var GroupVersion = v1.GroupVersion{Group: GroupName, Version: "v1alpha1"}

GroupVersion specifies the group and the version used to register the objects.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects Deprecated: use GroupVersion instead.

Functions

func ConvertBindingSpecFromHub added in v0.9.0

func ConvertBindingSpecFromHub(src *workv1alpha2.ResourceBindingSpec, dst *ResourceBindingSpec)

ConvertBindingSpecFromHub converts ResourceBindingSpec from the Hub version. This function intends to be shared by ResourceBinding and ClusterResourceBinding.

func ConvertBindingSpecToHub added in v0.9.0

func ConvertBindingSpecToHub(src *ResourceBindingSpec, dst *workv1alpha2.ResourceBindingSpec)

ConvertBindingSpecToHub converts ResourceBindingSpec to the Hub version. This function intends to be shared by ResourceBinding and ClusterResourceBinding.

func ConvertBindingStatusFromHub added in v0.9.0

func ConvertBindingStatusFromHub(src *workv1alpha2.ResourceBindingStatus, dst *ResourceBindingStatus)

ConvertBindingStatusFromHub converts ResourceBindingStatus from the Hub version. This function intends to be shared by ResourceBinding and ClusterResourceBinding.

func ConvertBindingStatusToHub added in v0.9.0

func ConvertBindingStatusToHub(src *ResourceBindingStatus, dst *workv1alpha2.ResourceBindingStatus)

ConvertBindingStatusToHub converts ResourceBindingStatus to the Hub version. This function intends to be shared by ResourceBinding and ClusterResourceBinding.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type AggregatedStatusItem

type AggregatedStatusItem struct {
	// ClusterName represents the member cluster name which the resource deployed on.
	// +required
	ClusterName string `json:"clusterName"`

	// Status reflects running status of current manifest.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Status *runtime.RawExtension `json:"status,omitempty"`
	// Applied represents if the resource referencing by ResourceBinding or ClusterResourceBinding
	// is successfully applied on the cluster.
	// +optional
	Applied bool `json:"applied,omitempty"`

	// AppliedMessage is a human readable message indicating details about the applied status.
	// This is usually holds the error message in case of apply failed.
	// +optional
	AppliedMessage string `json:"appliedMessage,omitempty"`
}

AggregatedStatusItem represents status of the resource running in a member cluster.

func (*AggregatedStatusItem) DeepCopy

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

func (*AggregatedStatusItem) DeepCopyInto

func (in *AggregatedStatusItem) DeepCopyInto(out *AggregatedStatusItem)

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

type ClusterResourceBinding

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

	// Spec represents the desired behavior.
	Spec ResourceBindingSpec `json:"spec"`

	// Status represents the most recently observed status of the ResourceBinding.
	// +optional
	Status ResourceBindingStatus `json:"status,omitempty"`
}

ClusterResourceBinding represents a binding of a kubernetes resource with a ClusterPropagationPolicy.

func (*ClusterResourceBinding) ConvertFrom added in v0.9.0

func (rb *ClusterResourceBinding) ConvertFrom(srcRaw conversion.Hub) error

ConvertFrom converts ClusterResourceBinding from the Hub version to this version.

func (*ClusterResourceBinding) ConvertTo added in v0.9.0

func (rb *ClusterResourceBinding) ConvertTo(dstRaw conversion.Hub) error

ConvertTo converts this ClusterResourceBinding to the Hub version.

func (*ClusterResourceBinding) DeepCopy

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

func (*ClusterResourceBinding) DeepCopyInto

func (in *ClusterResourceBinding) DeepCopyInto(out *ClusterResourceBinding)

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

func (*ClusterResourceBinding) DeepCopyObject

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

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

type ClusterResourceBindingList

type ClusterResourceBindingList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is the list of ClusterResourceBinding.
	Items []ClusterResourceBinding `json:"items"`
}

ClusterResourceBindingList contains a list of ClusterResourceBinding.

func (*ClusterResourceBindingList) DeepCopy

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

func (*ClusterResourceBindingList) DeepCopyInto

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

func (*ClusterResourceBindingList) DeepCopyObject

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

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

type Manifest

type Manifest struct {
	// +kubebuilder:pruning:PreserveUnknownFields
	runtime.RawExtension `json:",inline"`
}

Manifest represents a resource to be deployed on managed cluster.

func (*Manifest) DeepCopy

func (in *Manifest) DeepCopy() *Manifest

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

func (*Manifest) DeepCopyInto

func (in *Manifest) DeepCopyInto(out *Manifest)

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

type ManifestStatus

type ManifestStatus struct {
	// Identifier represents the identity of a resource linking to manifests in spec.
	// +required
	Identifier ResourceIdentifier `json:"identifier"`

	// Status reflects running status of current manifest.
	// +kubebuilder:pruning:PreserveUnknownFields
	// +optional
	Status *runtime.RawExtension `json:"status,omitempty"`

	// Health represents the healthy state of the current resource.
	// There maybe different rules for different resources to achieve health status.
	// +kubebuilder:validation:Enum=Healthy;Unhealthy;Unknown
	// +optional
	Health ResourceHealth `json:"health,omitempty"`
}

ManifestStatus contains running status of a specific manifest in spec.

func (*ManifestStatus) DeepCopy

func (in *ManifestStatus) DeepCopy() *ManifestStatus

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

func (*ManifestStatus) DeepCopyInto

func (in *ManifestStatus) DeepCopyInto(out *ManifestStatus)

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

type ObjectReference

type ObjectReference struct {
	// APIVersion represents the API version of the referent.
	APIVersion string `json:"apiVersion"`

	// Kind represents the Kind of the referent.
	Kind string `json:"kind"`

	// Namespace represents the namespace for the referent.
	// For non-namespace scoped resources(e.g. 'ClusterRole'),do not need specify Namespace,
	// and for namespace scoped resources, Namespace is required.
	// If Namespace is not specified, means the resource is non-namespace scoped.
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Name represents the name of the referent.
	Name string `json:"name"`

	// ResourceVersion represents the internal version of the referenced object, that can be used by clients to
	// determine when object has changed.
	// +optional
	ResourceVersion string `json:"resourceVersion,omitempty"`

	// ReplicaResourceRequirements represents the resources required by each replica.
	// +optional
	ReplicaResourceRequirements corev1.ResourceList `json:"resourcePerReplicas,omitempty"`

	// Replicas represents the replica number of the referencing resource.
	// +optional
	Replicas int32 `json:"replicas,omitempty"`
}

ObjectReference contains enough information to locate the referenced object inside current cluster.

func (*ObjectReference) DeepCopy

func (in *ObjectReference) DeepCopy() *ObjectReference

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

func (*ObjectReference) DeepCopyInto

func (in *ObjectReference) DeepCopyInto(out *ObjectReference)

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

type ResourceBinding

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

	// Spec represents the desired behavior.
	Spec ResourceBindingSpec `json:"spec"`

	// Status represents the most recently observed status of the ResourceBinding.
	// +optional
	Status ResourceBindingStatus `json:"status,omitempty"`
}

ResourceBinding represents a binding of a kubernetes resource with a propagation policy.

func (*ResourceBinding) ConvertFrom added in v0.9.0

func (rb *ResourceBinding) ConvertFrom(srcRaw conversion.Hub) error

ConvertFrom converts ResourceBinding from the Hub version to this version.

func (*ResourceBinding) ConvertTo added in v0.9.0

func (rb *ResourceBinding) ConvertTo(dstRaw conversion.Hub) error

ConvertTo converts this ResourceBinding to the Hub version.

func (*ResourceBinding) DeepCopy

func (in *ResourceBinding) DeepCopy() *ResourceBinding

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

func (*ResourceBinding) DeepCopyInto

func (in *ResourceBinding) DeepCopyInto(out *ResourceBinding)

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

func (*ResourceBinding) DeepCopyObject

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

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

type ResourceBindingList

type ResourceBindingList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is the list of ResourceBinding.
	Items []ResourceBinding `json:"items"`
}

ResourceBindingList contains a list of ResourceBinding.

func (*ResourceBindingList) DeepCopy

func (in *ResourceBindingList) DeepCopy() *ResourceBindingList

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

func (*ResourceBindingList) DeepCopyInto

func (in *ResourceBindingList) DeepCopyInto(out *ResourceBindingList)

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

func (*ResourceBindingList) DeepCopyObject

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

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

type ResourceBindingSpec

type ResourceBindingSpec struct {
	// Resource represents the Kubernetes resource to be propagated.
	Resource ObjectReference `json:"resource"`
	// Clusters represents target member clusters where the resource to be deployed.
	// +optional
	Clusters []TargetCluster `json:"clusters,omitempty"`
}

ResourceBindingSpec represents the expectation of ResourceBinding.

func (*ResourceBindingSpec) DeepCopy

func (in *ResourceBindingSpec) DeepCopy() *ResourceBindingSpec

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

func (*ResourceBindingSpec) DeepCopyInto

func (in *ResourceBindingSpec) DeepCopyInto(out *ResourceBindingSpec)

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

type ResourceBindingStatus

type ResourceBindingStatus struct {
	// Conditions contain the different condition statuses.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
	// AggregatedStatus represents status list of the resource running in each member cluster.
	// +optional
	AggregatedStatus []AggregatedStatusItem `json:"aggregatedStatus,omitempty"`
}

ResourceBindingStatus represents the overall status of the strategy as well as the referenced resources.

func (*ResourceBindingStatus) DeepCopy

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

func (*ResourceBindingStatus) DeepCopyInto

func (in *ResourceBindingStatus) DeepCopyInto(out *ResourceBindingStatus)

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

type ResourceHealth added in v1.3.0

type ResourceHealth string

ResourceHealth represents that the health status of the reference resource.

const (
	// ResourceHealthy represents that the health status of the current resource
	// that applied on the managed cluster is healthy.
	ResourceHealthy ResourceHealth = "Healthy"
	// ResourceUnhealthy represents that the health status of the current resource
	// that applied on the managed cluster is unhealthy.
	ResourceUnhealthy ResourceHealth = "Unhealthy"
	// ResourceUnknown represents that the health status of the current resource
	// that applied on the managed cluster is unknown.
	ResourceUnknown ResourceHealth = "Unknown"
)

type ResourceIdentifier

type ResourceIdentifier struct {
	// Ordinal represents an index in manifests list, so the condition can still be linked
	// to a manifest even though manifest cannot be parsed successfully.
	Ordinal int `json:"ordinal"`

	// Group is the group of the resource.
	Group string `json:"group,omitempty"`

	// Version is the version of the resource.
	Version string `json:"version"`

	// Kind is the kind of the resource.
	Kind string `json:"kind"`

	// Resource is the resource type of the resource
	Resource string `json:"resource"`

	// Namespace is the namespace of the resource, the resource is cluster scoped if the value
	// is empty
	Namespace string `json:"namespace,omitempty"`

	// Name is the name of the resource
	Name string `json:"name"`
}

ResourceIdentifier provides the identifiers needed to interact with any arbitrary object.

func (*ResourceIdentifier) DeepCopy

func (in *ResourceIdentifier) DeepCopy() *ResourceIdentifier

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

func (*ResourceIdentifier) DeepCopyInto

func (in *ResourceIdentifier) DeepCopyInto(out *ResourceIdentifier)

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

type TargetCluster

type TargetCluster struct {
	// Name of target cluster.
	Name string `json:"name"`
	// Replicas in target cluster
	// +optional
	Replicas int32 `json:"replicas,omitempty"`
}

TargetCluster represents the identifier of a member cluster.

func (*TargetCluster) DeepCopy

func (in *TargetCluster) DeepCopy() *TargetCluster

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

func (*TargetCluster) DeepCopyInto

func (in *TargetCluster) DeepCopyInto(out *TargetCluster)

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

type Work

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

	// Spec represents the desired behavior of Work.
	Spec WorkSpec `json:"spec"`

	// Status represents the status of PropagationStatus.
	// +optional
	Status WorkStatus `json:"status,omitempty"`
}

Work defines a list of resources to be deployed on the member cluster.

func (*Work) DeepCopy

func (in *Work) DeepCopy() *Work

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

func (*Work) DeepCopyInto

func (in *Work) DeepCopyInto(out *Work)

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

func (*Work) DeepCopyObject

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

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

type WorkList

type WorkList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items holds a list of Work.
	Items []Work `json:"items"`
}

WorkList is a collection of Work.

func (*WorkList) DeepCopy

func (in *WorkList) DeepCopy() *WorkList

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

func (*WorkList) DeepCopyInto

func (in *WorkList) DeepCopyInto(out *WorkList)

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

func (*WorkList) DeepCopyObject

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

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

type WorkSpec

type WorkSpec struct {
	// Workload represents the manifest workload to be deployed on managed cluster.
	Workload WorkloadTemplate `json:"workload,omitempty"`
}

WorkSpec defines the desired state of Work.

func (*WorkSpec) DeepCopy

func (in *WorkSpec) DeepCopy() *WorkSpec

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

func (*WorkSpec) DeepCopyInto

func (in *WorkSpec) DeepCopyInto(out *WorkSpec)

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

type WorkStatus

type WorkStatus struct {
	// Conditions contain the different condition statuses for this work.
	// Valid condition types are:
	// 1. Applied represents workload in Work is applied successfully on a managed cluster.
	// 2. Progressing represents workload in Work is being applied on a managed cluster.
	// 3. Available represents workload in Work exists on the managed cluster.
	// 4. Degraded represents the current state of workload does not match the desired
	// state for a certain period.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// ManifestStatuses contains running status of manifests in spec.
	// +optional
	ManifestStatuses []ManifestStatus `json:"manifestStatuses,omitempty"`
}

WorkStatus defines the observed state of Work.

func (*WorkStatus) DeepCopy

func (in *WorkStatus) DeepCopy() *WorkStatus

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

func (*WorkStatus) DeepCopyInto

func (in *WorkStatus) DeepCopyInto(out *WorkStatus)

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

type WorkloadTemplate

type WorkloadTemplate struct {
	// Manifests represents a list of Kubernetes resources to be deployed on the managed cluster.
	// +optional
	Manifests []Manifest `json:"manifests,omitempty"`
}

WorkloadTemplate represents the manifest workload to be deployed on managed cluster.

func (*WorkloadTemplate) DeepCopy

func (in *WorkloadTemplate) DeepCopy() *WorkloadTemplate

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

func (*WorkloadTemplate) DeepCopyInto

func (in *WorkloadTemplate) DeepCopyInto(out *WorkloadTemplate)

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