v1

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 190

Documentation

Overview

+kubebuilder:validation:Optional +groupName=work.open-cluster-management.io

Index

Constants

View Source
const (
	// WorkProgressing represents that the work is in the progress to be
	// applied on the managed cluster.
	WorkProgressing string = "Progressing"
	// WorkApplied represents that the workload defined in work is
	// succesfully applied on the managed cluster.
	WorkApplied string = "Applied"
	// 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 (
	// ManifestProgressing represents that the resource is being applied on the managed cluster
	ManifestProgressing string = "Progressing"
	// ManifestApplied represents that the resource object is applied
	// on the managed cluster.
	ManifestApplied string = "Applied"
	// ManifestAvailable represents that the resource object exists
	// on the managed cluster.
	ManifestAvailable string = "Available"
	// ManifestDegraded represents that the current state of resource object does not
	// match the desired state for a certain period.
	ManifestDegraded string = "Degraded"
)
View Source
const (
	// ManifestWorkFinalizer is the name of the finalizer added to manifestworks. It is used to ensure
	// related appliedmanifestwork of a manifestwork are deleted before the manifestwork itself is deleted
	ManifestWorkFinalizer = "cluster.open-cluster-management.io/manifest-work-cleanup"
	// AppliedManifestWorkFinalizer is the name of the finalizer added to appliedmanifestwork. It is to
	// ensure all resource relates to appliedmanifestwork is deleted before appliedmanifestwork itself
	// is deleted.
	AppliedManifestWorkFinalizer = "cluster.open-cluster-management.io/applied-manifest-work-cleanup"
)
View Source
const DefaultFieldManager = "work-agent"

DefaultFieldManager is the default field manager of the manifestwork when the field manager is not set.

View Source
const (
	// ManifestConfigSpecHashAnnotationKey is the annotation key to identify the configurations
	// used by the manifestwork.
	ManifestConfigSpecHashAnnotationKey = "open-cluster-management.io/config-spec-hash"
)

Variables

View Source
var (
	GroupName    = "work.open-cluster-management.io"
	GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}

	// Install is a function which adds this version to a scheme
	Install = schemeBuilder.AddToScheme

	// SchemeGroupVersion generated code relies on this name
	// Deprecated
	SchemeGroupVersion = GroupVersion
	// AddToScheme exists solely to keep the old generators creating valid code
	// DEPRECATED
	AddToScheme = schemeBuilder.AddToScheme
)

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource generated code relies on this being here, but it logically belongs to the group DEPRECATED

Types

type AppliedManifestResourceMeta

type AppliedManifestResourceMeta struct {
	ResourceIdentifier `json:",inline"`

	// Version is the version of the Kubernetes resource.
	// +kubebuilder:validation:Required
	// +required
	Version string `json:"version"`

	// UID is set on successful deletion of the Kubernetes resource by controller. The
	// resource might be still visible on the managed cluster after this field is set.
	// It is not directly settable by a client.
	// +optional
	UID string `json:"uid,omitempty"`
}

AppliedManifestResourceMeta represents the group, version, resource, name and namespace of a resource. Since these resources have been created, they must have valid group, version, resource, namespace, and name.

func (*AppliedManifestResourceMeta) DeepCopy

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

func (*AppliedManifestResourceMeta) DeepCopyInto

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

func (AppliedManifestResourceMeta) SwaggerDoc

func (AppliedManifestResourceMeta) SwaggerDoc() map[string]string

type AppliedManifestWork

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

	// Spec represents the desired configuration of AppliedManifestWork.
	Spec AppliedManifestWorkSpec `json:"spec,omitempty"`

	// Status represents the current status of AppliedManifestWork.
	// +optional
	Status AppliedManifestWorkStatus `json:"status,omitempty"`
}

AppliedManifestWork represents an applied manifestwork on managed cluster that is placed on a managed cluster. An AppliedManifestWork links to a manifestwork on a hub recording resources deployed in the managed cluster. When the agent is removed from managed cluster, cluster-admin on managed cluster can delete appliedmanifestwork to remove resources deployed by the agent. The name of the appliedmanifestwork must be in the format of {hash of hub's first kube-apiserver url}-{manifestwork name}

func (*AppliedManifestWork) DeepCopy

func (in *AppliedManifestWork) DeepCopy() *AppliedManifestWork

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

func (*AppliedManifestWork) DeepCopyInto

func (in *AppliedManifestWork) DeepCopyInto(out *AppliedManifestWork)

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

func (*AppliedManifestWork) DeepCopyObject

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

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

func (AppliedManifestWork) SwaggerDoc

func (AppliedManifestWork) SwaggerDoc() map[string]string

type AppliedManifestWorkList

type AppliedManifestWorkList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of appliedmanifestworks.
	Items []AppliedManifestWork `json:"items"`
}

AppliedManifestWorkList is a collection of appliedmanifestworks.

func (*AppliedManifestWorkList) DeepCopy

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

func (*AppliedManifestWorkList) DeepCopyInto

func (in *AppliedManifestWorkList) DeepCopyInto(out *AppliedManifestWorkList)

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

func (*AppliedManifestWorkList) DeepCopyObject

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

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

func (AppliedManifestWorkList) SwaggerDoc

func (AppliedManifestWorkList) SwaggerDoc() map[string]string

type AppliedManifestWorkSpec

type AppliedManifestWorkSpec struct {
	// HubHash represents the hash of the first hub kube apiserver to identify which hub
	// this AppliedManifestWork links to.
	// +required
	HubHash string `json:"hubHash"`

	// AgentID represents the ID of the work agent who is to handle this AppliedManifestWork.
	AgentID string `json:"agentID"`

	// ManifestWorkName represents the name of the related manifestwork on the hub.
	// +required
	ManifestWorkName string `json:"manifestWorkName"`
}

AppliedManifestWorkSpec represents the desired configuration of AppliedManifestWork

func (*AppliedManifestWorkSpec) DeepCopy

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

func (*AppliedManifestWorkSpec) DeepCopyInto

func (in *AppliedManifestWorkSpec) DeepCopyInto(out *AppliedManifestWorkSpec)

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

func (AppliedManifestWorkSpec) SwaggerDoc

func (AppliedManifestWorkSpec) SwaggerDoc() map[string]string

type AppliedManifestWorkStatus

type AppliedManifestWorkStatus struct {
	// AppliedResources represents a list of resources defined within the manifestwork that are applied.
	// Only resources with valid GroupVersionResource, namespace, and name are suitable.
	// An item in this slice is deleted when there is no mapped manifest in manifestwork.Spec or by finalizer.
	// The resource relating to the item will also be removed from managed cluster.
	// The deleted resource may still be present until the finalizers for that resource are finished.
	// However, the resource will not be undeleted, so it can be removed from this list and eventual consistency is preserved.
	// +optional
	AppliedResources []AppliedManifestResourceMeta `json:"appliedResources,omitempty"`

	// EvictionStartTime represents the current appliedmanifestwork will be evicted after a grace period.
	// An appliedmanifestwork will be evicted from the managed cluster in the following two scenarios:
	//   - the manifestwork of the current appliedmanifestwork is missing on the hub, or
	//   - the appliedmanifestwork hub hash does not match the current hub hash of the work agent.
	// +optional
	EvictionStartTime *metav1.Time `json:"evictionStartTime,omitempty"`
}

AppliedManifestWorkStatus represents the current status of AppliedManifestWork

func (*AppliedManifestWorkStatus) DeepCopy

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

func (*AppliedManifestWorkStatus) DeepCopyInto

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

func (AppliedManifestWorkStatus) SwaggerDoc

func (AppliedManifestWorkStatus) SwaggerDoc() map[string]string

type DeleteOption added in v0.5.0

type DeleteOption struct {
	// propagationPolicy can be Foreground, Orphan or SelectivelyOrphan
	// SelectivelyOrphan should be rarely used.  It is provided for cases where particular resources is transfering
	// ownership from one ManifestWork to another or another management unit.
	// Setting this value will allow a flow like
	// 1. create manifestwork/2 to manage foo
	// 2. update manifestwork/1 to selectively orphan foo
	// 3. remove foo from manifestwork/1 without impacting continuity because manifestwork/2 adopts it.
	// +kubebuilder:default=Foreground
	PropagationPolicy DeletePropagationPolicyType `json:"propagationPolicy"`

	// selectivelyOrphan represents a list of resources following orphan deletion stratecy
	SelectivelyOrphan *SelectivelyOrphan `json:"selectivelyOrphans,omitempty"`
}

func (*DeleteOption) DeepCopy added in v0.5.0

func (in *DeleteOption) DeepCopy() *DeleteOption

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

func (*DeleteOption) DeepCopyInto added in v0.5.0

func (in *DeleteOption) DeepCopyInto(out *DeleteOption)

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

func (DeleteOption) SwaggerDoc added in v0.5.0

func (DeleteOption) SwaggerDoc() map[string]string

type DeletePropagationPolicyType added in v0.5.0

type DeletePropagationPolicyType string

+kubebuilder:validation:Enum=Foreground;Orphan;SelectivelyOrphan

const (
	// DeletePropagationPolicyTypeForeground represents that all the resources in the manifestwork is should
	// be fourground deleted.
	DeletePropagationPolicyTypeForeground DeletePropagationPolicyType = "Foreground"
	// DeletePropagationPolicyTypeOrphan represents that all the resources in the manifestwork is orphaned
	// when the manifestwork is deleted.
	DeletePropagationPolicyTypeOrphan DeletePropagationPolicyType = "Orphan"
	// DeletePropagationPolicyTypeSelectivelyOrphan represents that only selected resources in the manifestwork
	// is orphaned when the manifestwork is deleted.
	DeletePropagationPolicyTypeSelectivelyOrphan DeletePropagationPolicyType = "SelectivelyOrphan"
)

type FeedBackType added in v0.6.0

type FeedBackType string

+kubebuilder:validation:Enum=WellKnownStatus;JSONPaths

const (
	// WellKnownStatusType represents that values of some common status fields will be returned, which
	// is reflected with a hardcoded rule only for types in k8s.io/api and open-cluster-management/api.
	WellKnownStatusType FeedBackType = "WellKnownStatus"

	// JSONPathsType represents that values of status fields with certain json paths specified will be
	// returned
	JSONPathsType FeedBackType = "JSONPaths"
)

type FeedbackRule added in v0.6.0

type FeedbackRule struct {
	// Type defines the option of how status can be returned.
	// It can be jsonPaths or wellKnownStatus.
	// If the type is JSONPaths, user should specify the jsonPaths field
	// If the type is WellKnownStatus, certain common fields of status defined by a rule only
	// for types in in k8s.io/api and open-cluster-management/api will be reported,
	// If these status fields do not exist, no values will be reported.
	// +kubebuilder:validation:Required
	// +required
	Type FeedBackType `json:"type"`

	// JsonPaths defines the json path under status field to be synced.
	// +optional
	JsonPaths []JsonPath `json:"jsonPaths,omitempty"`
}

func (*FeedbackRule) DeepCopy added in v0.6.0

func (in *FeedbackRule) DeepCopy() *FeedbackRule

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

func (*FeedbackRule) DeepCopyInto added in v0.6.0

func (in *FeedbackRule) DeepCopyInto(out *FeedbackRule)

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

func (FeedbackRule) SwaggerDoc added in v0.6.0

func (FeedbackRule) SwaggerDoc() map[string]string

type FeedbackValue added in v0.6.0

type FeedbackValue struct {
	// Name represents the alias name for this field. It is the same as what is specified
	// in StatuFeedbackRule in the spec.
	// +kubebuilder:validation:Required
	// +required
	Name string `json:"name"`

	// Value is the value of the status field.
	// The value of the status field can only be integer, string or boolean.
	// +kubebuilder:validation:Required
	// +required
	Value FieldValue `json:"fieldValue"`
}

func (*FeedbackValue) DeepCopy added in v0.6.0

func (in *FeedbackValue) DeepCopy() *FeedbackValue

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

func (*FeedbackValue) DeepCopyInto added in v0.6.0

func (in *FeedbackValue) DeepCopyInto(out *FeedbackValue)

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

func (FeedbackValue) SwaggerDoc added in v0.6.0

func (FeedbackValue) SwaggerDoc() map[string]string

type FieldValue added in v0.6.0

type FieldValue struct {
	// Type represents the type of the value, it can be integer, string or boolean.
	// +kubebuilder:validation:Required
	// +required
	Type ValueType `json:"type"`

	// Integer is the integer value when type is integer.
	// +optional
	Integer *int64 `json:"integer,omitempty"`

	// String is the string value when type is string.
	// +optional
	String *string `json:"string,omitempty"`

	// Boolean is bool value when type is boolean.
	// +optional
	Boolean *bool `json:"boolean,omitempty"`

	// JsonRaw is a json string when type is a list or object
	// +kubebuilder:validation:MaxLength=1024
	JsonRaw *string `json:"jsonRaw,omitempty"`
}

FieldValue is the value of the status field. The value of the status field can only be integer, string or boolean.

func (*FieldValue) DeepCopy added in v0.6.0

func (in *FieldValue) DeepCopy() *FieldValue

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

func (*FieldValue) DeepCopyInto added in v0.6.0

func (in *FieldValue) DeepCopyInto(out *FieldValue)

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

func (FieldValue) SwaggerDoc added in v0.6.0

func (FieldValue) SwaggerDoc() map[string]string

type JsonPath added in v0.6.0

type JsonPath struct {
	// Name represents the alias name for this field
	// +kubebuilder:validation:Required
	// +required
	Name string `json:"name"`

	// Version is the version of the Kubernetes resource.
	// If it is not specified, the resource with the semantically latest version is
	// used to resolve the path.
	// +optional
	Version string `json:"version,omitempty"`

	// Path represents the json path of the field under status.
	// The path must point to a field with single value in the type of integer, bool or string.
	// If the path points to a non-existing field, no value will be returned.
	// If the path points to a structure, map or slice, no value will be returned and the status conddition
	// of StatusFeedBackSynced will be set as false.
	// Ref to https://kubernetes.io/docs/reference/kubectl/jsonpath/ on how to write a jsonPath.
	// +kubebuilder:validation:Required
	// +required
	Path string `json:"path"`
}

func (*JsonPath) DeepCopy added in v0.6.0

func (in *JsonPath) DeepCopy() *JsonPath

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

func (*JsonPath) DeepCopyInto added in v0.6.0

func (in *JsonPath) DeepCopyInto(out *JsonPath)

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

func (JsonPath) SwaggerDoc added in v0.6.0

func (JsonPath) SwaggerDoc() map[string]string

type Manifest

type Manifest struct {
	// +kubebuilder:validation:EmbeddedResource
	// +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.

func (Manifest) SwaggerDoc

func (Manifest) SwaggerDoc() map[string]string

type ManifestCondition

type ManifestCondition struct {
	// ResourceMeta represents the group, version, kind, name and namespace of a resoure.
	// +required
	ResourceMeta ManifestResourceMeta `json:"resourceMeta"`

	// StatusFeedback represents the values of the feild synced back defined in statusFeedbacks
	// +optional
	StatusFeedbacks StatusFeedbackResult `json:"statusFeedback,omitempty"`

	// Conditions represents the conditions of this resource on a managed cluster.
	// +required
	Conditions []metav1.Condition `json:"conditions"`
}

ManifestCondition represents the conditions of the resources deployed on a managed cluster.

func (*ManifestCondition) DeepCopy

func (in *ManifestCondition) DeepCopy() *ManifestCondition

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

func (*ManifestCondition) DeepCopyInto

func (in *ManifestCondition) DeepCopyInto(out *ManifestCondition)

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

func (ManifestCondition) SwaggerDoc

func (ManifestCondition) SwaggerDoc() map[string]string

type ManifestConfigOption added in v0.6.0

type ManifestConfigOption struct {
	// ResourceIdentifier represents the group, resource, name and namespace of a resoure.
	// iff this refers to a resource not created by this manifest work, the related rules will not be executed.
	// +kubebuilder:validation:Required
	// +required
	ResourceIdentifier ResourceIdentifier `json:"resourceIdentifier"`

	// FeedbackRules defines what resource status field should be returned. If it is not set or empty,
	// no feedback rules will be honored.
	// +optional
	FeedbackRules []FeedbackRule `json:"feedbackRules,omitempty"`

	// UpdateStrategy defines the strategy to update this manifest. UpdateStrategy is Update
	// if it is not set.
	// +optional
	UpdateStrategy *UpdateStrategy `json:"updateStrategy,omitempty"`
}

ManifestConfigOption represents the configurations of a manifest defined in workload field.

func (*ManifestConfigOption) DeepCopy added in v0.6.0

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

func (*ManifestConfigOption) DeepCopyInto added in v0.6.0

func (in *ManifestConfigOption) DeepCopyInto(out *ManifestConfigOption)

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

func (ManifestConfigOption) SwaggerDoc added in v0.6.0

func (ManifestConfigOption) SwaggerDoc() map[string]string

type ManifestResourceMeta

type ManifestResourceMeta struct {
	// Ordinal represents the index of the manifest on spec.
	// +required
	Ordinal int32 `json:"ordinal"`

	// Group is the API Group of the Kubernetes resource.
	// +optional
	Group string `json:"group"`

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

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

	// Resource is the resource name of the Kubernetes resource.
	// +optional
	Resource string `json:"resource"`

	// Name is the name of the Kubernetes resource.
	// +optional
	Name string `json:"name"`

	// Name is the namespace of the Kubernetes resource.
	// +optional
	Namespace string `json:"namespace"`
}

ManifestResourceMeta represents the group, version, kind, as well as the group, version, resource, name and namespace of a resoure.

func (*ManifestResourceMeta) DeepCopy

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

func (*ManifestResourceMeta) DeepCopyInto

func (in *ManifestResourceMeta) DeepCopyInto(out *ManifestResourceMeta)

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

func (ManifestResourceMeta) SwaggerDoc

func (ManifestResourceMeta) SwaggerDoc() map[string]string

type ManifestResourceStatus

type ManifestResourceStatus struct {
	// Manifests represents the condition of manifests deployed on managed cluster.
	// Valid condition types are:
	// 1. Progressing represents the resource is being applied on managed cluster.
	// 2. Applied represents the resource is applied successfully on managed cluster.
	// 3. Available represents the resource exists on the managed cluster.
	// 4. Degraded represents the current state of resource does not match the desired
	// state for a certain period.
	Manifests []ManifestCondition `json:"manifests,omitempty"`
}

ManifestResourceStatus represents the status of each resource in manifest work deployed on managed cluster

func (*ManifestResourceStatus) DeepCopy

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

func (*ManifestResourceStatus) DeepCopyInto

func (in *ManifestResourceStatus) DeepCopyInto(out *ManifestResourceStatus)

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

func (ManifestResourceStatus) SwaggerDoc

func (ManifestResourceStatus) SwaggerDoc() map[string]string

type ManifestWork

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

	// Spec represents a desired configuration of work to be deployed on the managed cluster.
	Spec ManifestWorkSpec `json:"spec"`

	// Status represents the current status of work.
	// +optional
	Status ManifestWorkStatus `json:"status,omitempty"`
}

ManifestWork represents a manifests workload that hub wants to deploy on the managed cluster. A manifest workload is defined as a set of Kubernetes resources. ManifestWork must be created in the cluster namespace on the hub, so that agent on the corresponding managed cluster can access this resource and deploy on the managed cluster.

func (*ManifestWork) DeepCopy

func (in *ManifestWork) DeepCopy() *ManifestWork

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

func (*ManifestWork) DeepCopyInto

func (in *ManifestWork) DeepCopyInto(out *ManifestWork)

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

func (*ManifestWork) DeepCopyObject

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

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

func (ManifestWork) SwaggerDoc

func (ManifestWork) SwaggerDoc() map[string]string

type ManifestWorkExecutor added in v0.8.0

type ManifestWorkExecutor struct {
	// Subject is the subject identity which the work agent uses to talk to the
	// local cluster when applying the resources.
	Subject ManifestWorkExecutorSubject `json:"subject"`
}

ManifestWorkExecutor is the executor that applies the resources to the managed cluster. i.e. the work agent.

func (*ManifestWorkExecutor) DeepCopy added in v0.8.0

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

func (*ManifestWorkExecutor) DeepCopyInto added in v0.8.0

func (in *ManifestWorkExecutor) DeepCopyInto(out *ManifestWorkExecutor)

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

func (ManifestWorkExecutor) SwaggerDoc added in v0.8.0

func (ManifestWorkExecutor) SwaggerDoc() map[string]string

type ManifestWorkExecutorSubject added in v0.8.0

type ManifestWorkExecutorSubject struct {
	// Type is the type of the subject identity.
	// Supported types are: "ServiceAccount".
	// +kubebuilder:validation:Enum=ServiceAccount
	// +kubebuilder:validation:Required
	// +required
	Type ManifestWorkExecutorSubjectType `json:"type"`
	// ServiceAccount is for identifying which service account to use by the work agent.
	// Only required if the type is "ServiceAccount".
	// +optional
	ServiceAccount *ManifestWorkSubjectServiceAccount `json:"serviceAccount,omitempty"`
}

ManifestWorkExecutorSubject is the subject identity used by the work agent to apply the resources. The work agent should check whether the applying resources are out-of-scope of the permission held by the executor identity.

func (*ManifestWorkExecutorSubject) DeepCopy added in v0.8.0

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

func (*ManifestWorkExecutorSubject) DeepCopyInto added in v0.8.0

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

func (ManifestWorkExecutorSubject) SwaggerDoc added in v0.8.0

func (ManifestWorkExecutorSubject) SwaggerDoc() map[string]string

type ManifestWorkExecutorSubjectType added in v0.8.0

type ManifestWorkExecutorSubjectType string

ManifestWorkExecutorSubjectType is the type of the subject.

const (
	// ExecutorSubjectTypeServiceAccount indicates that the workload resources belong to a ServiceAccount
	// in the managed cluster.
	ExecutorSubjectTypeServiceAccount ManifestWorkExecutorSubjectType = "ServiceAccount"
)

type ManifestWorkList

type ManifestWorkList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of manifestworks.
	Items []ManifestWork `json:"items"`
}

ManifestWorkList is a collection of manifestworks.

func (*ManifestWorkList) DeepCopy

func (in *ManifestWorkList) DeepCopy() *ManifestWorkList

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

func (*ManifestWorkList) DeepCopyInto

func (in *ManifestWorkList) DeepCopyInto(out *ManifestWorkList)

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

func (*ManifestWorkList) DeepCopyObject

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

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

func (ManifestWorkList) SwaggerDoc

func (ManifestWorkList) SwaggerDoc() map[string]string

type ManifestWorkSpec

type ManifestWorkSpec struct {
	// Workload represents the manifest workload to be deployed on a managed cluster.
	Workload ManifestsTemplate `json:"workload,omitempty"`

	// DeleteOption represents deletion strategy when the manifestwork is deleted.
	// Foreground deletion strategy is applied to all the resource in this manifestwork if it is not set.
	// +optional
	DeleteOption *DeleteOption `json:"deleteOption,omitempty"`

	// ManifestConfigs represents the configurations of manifests defined in workload field.
	// +optional
	ManifestConfigs []ManifestConfigOption `json:"manifestConfigs,omitempty"`

	// Executor is the configuration that makes the work agent to perform some pre-request processing/checking.
	// e.g. the executor identity tells the work agent to check the executor has sufficient permission to write
	// the workloads to the local managed cluster.
	// Note that nil executor is still supported for backward-compatibility which indicates that the work agent
	// will not perform any additional actions before applying resources.
	// +optional
	Executor *ManifestWorkExecutor `json:"executor,omitempty"`
}

ManifestWorkSpec represents a desired configuration of manifests to be deployed on the managed cluster.

func (*ManifestWorkSpec) DeepCopy

func (in *ManifestWorkSpec) DeepCopy() *ManifestWorkSpec

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

func (*ManifestWorkSpec) DeepCopyInto

func (in *ManifestWorkSpec) DeepCopyInto(out *ManifestWorkSpec)

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

func (ManifestWorkSpec) SwaggerDoc

func (ManifestWorkSpec) SwaggerDoc() map[string]string

type ManifestWorkStatus

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

	// ResourceStatus represents the status of each resource in manifestwork deployed on a
	// managed cluster. The Klusterlet agent on managed cluster syncs the condition from the managed cluster to the hub.
	// +optional
	ResourceStatus ManifestResourceStatus `json:"resourceStatus,omitempty"`
}

ManifestWorkStatus represents the current status of managed cluster ManifestWork.

func (*ManifestWorkStatus) DeepCopy

func (in *ManifestWorkStatus) DeepCopy() *ManifestWorkStatus

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

func (*ManifestWorkStatus) DeepCopyInto

func (in *ManifestWorkStatus) DeepCopyInto(out *ManifestWorkStatus)

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

func (ManifestWorkStatus) SwaggerDoc

func (ManifestWorkStatus) SwaggerDoc() map[string]string

type ManifestWorkSubjectServiceAccount added in v0.8.0

type ManifestWorkSubjectServiceAccount struct {
	// Namespace is the namespace of the service account.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$`
	// +required
	Namespace string `json:"namespace"`
	// Name is the name of the service account.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)$`
	// +required
	Name string `json:"name"`
}

ManifestWorkSubjectServiceAccount references service account in the managed clusters.

func (*ManifestWorkSubjectServiceAccount) DeepCopy added in v0.8.0

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

func (*ManifestWorkSubjectServiceAccount) DeepCopyInto added in v0.8.0

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

func (ManifestWorkSubjectServiceAccount) SwaggerDoc added in v0.8.0

type ManifestsTemplate

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

ManifestsTemplate represents the manifest workload to be deployed on a managed cluster.

func (*ManifestsTemplate) DeepCopy

func (in *ManifestsTemplate) DeepCopy() *ManifestsTemplate

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

func (*ManifestsTemplate) DeepCopyInto

func (in *ManifestsTemplate) DeepCopyInto(out *ManifestsTemplate)

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

func (ManifestsTemplate) SwaggerDoc

func (ManifestsTemplate) SwaggerDoc() map[string]string

type OrphaningRule added in v0.5.0

type OrphaningRule ResourceIdentifier

OrphaningRule identifies a single resource included in this manifestwork to be orphaned

func (*OrphaningRule) DeepCopy added in v0.5.0

func (in *OrphaningRule) DeepCopy() *OrphaningRule

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

func (*OrphaningRule) DeepCopyInto added in v0.5.0

func (in *OrphaningRule) DeepCopyInto(out *OrphaningRule)

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

type ResourceIdentifier added in v0.6.0

type ResourceIdentifier struct {
	// Group is the API Group of the Kubernetes resource,
	// empty string indicates it is in core group.
	// +optional
	Group string `json:"group"`

	// Resource is the resource name of the Kubernetes resource.
	// +kubebuilder:validation:Required
	// +required
	Resource string `json:"resource"`

	// Name is the name of the Kubernetes resource.
	// +kubebuilder:validation:Required
	// +required
	Name string `json:"name"`

	// Name is the namespace of the Kubernetes resource, empty string indicates
	// it is a cluster scoped resource.
	// +optional
	Namespace string `json:"namespace"`
}

ResourceIdentifier identifies a single resource included in this manifestwork

func (*ResourceIdentifier) DeepCopy added in v0.6.0

func (in *ResourceIdentifier) DeepCopy() *ResourceIdentifier

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

func (*ResourceIdentifier) DeepCopyInto added in v0.6.0

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

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

func (ResourceIdentifier) SwaggerDoc added in v0.6.0

func (ResourceIdentifier) SwaggerDoc() map[string]string

type SelectivelyOrphan added in v0.5.0

type SelectivelyOrphan struct {
	// orphaningRules defines a slice of orphaningrule.
	// Each orphaningrule identifies a single resource included in this manifestwork
	// +optional
	OrphaningRules []OrphaningRule `json:"orphaningRules,omitempty"`
}

SelectivelyOrphan represents a list of resources following orphan deletion stratecy

func (*SelectivelyOrphan) DeepCopy added in v0.5.0

func (in *SelectivelyOrphan) DeepCopy() *SelectivelyOrphan

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

func (*SelectivelyOrphan) DeepCopyInto added in v0.5.0

func (in *SelectivelyOrphan) DeepCopyInto(out *SelectivelyOrphan)

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

func (SelectivelyOrphan) SwaggerDoc added in v0.5.0

func (SelectivelyOrphan) SwaggerDoc() map[string]string

type ServerSideApplyConfig added in v0.8.0

type ServerSideApplyConfig struct {
	// Force represents to force apply the manifest.
	// +optional
	Force bool `json:"force"`

	// FieldManager is the manager to apply the resource. It is work-agent by default, but can be other name with work-agent
	// as the prefix.
	// +kubebuilder:default=work-agent
	// +kubebuilder:validation:Pattern=`^work-agent`
	// +optional
	FieldManager string `json:"fieldManager,omitempty"`
}

func (*ServerSideApplyConfig) DeepCopy added in v0.8.0

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

func (*ServerSideApplyConfig) DeepCopyInto added in v0.8.0

func (in *ServerSideApplyConfig) DeepCopyInto(out *ServerSideApplyConfig)

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

func (ServerSideApplyConfig) SwaggerDoc added in v0.8.0

func (ServerSideApplyConfig) SwaggerDoc() map[string]string

type StatusFeedbackResult added in v0.6.0

type StatusFeedbackResult struct {
	// Values represents the synced value of the interested field.
	// +listType:=map
	// +listMapKey:=name
	// +optional
	Values []FeedbackValue `json:"values,omitempty"`
}

StatusFeedbackResult represents the values of the feild synced back defined in statusFeedbacks

func (*StatusFeedbackResult) DeepCopy added in v0.6.0

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

func (*StatusFeedbackResult) DeepCopyInto added in v0.6.0

func (in *StatusFeedbackResult) DeepCopyInto(out *StatusFeedbackResult)

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

func (StatusFeedbackResult) SwaggerDoc added in v0.6.0

func (StatusFeedbackResult) SwaggerDoc() map[string]string

type UpdateStrategy added in v0.8.0

type UpdateStrategy struct {
	// type defines the strategy to update this manifest, default value is Update.
	// Update type means to update resource by an update call.
	// CreateOnly type means do not update resource based on current manifest.
	// ServerSideApply type means to update resource using server side apply with work-controller as the field manager.
	// If there is conflict, the related Applied condition of manifest will be in the status of False with the
	// reason of ApplyConflict.
	// ReadOnly type means the agent will only check the existence of the resource based on its metadata,
	// statusFeedBackRules can still be used to get feedbackResults.
	// +kubebuilder:default=Update
	// +kubebuilder:validation:Enum=Update;CreateOnly;ServerSideApply;ReadOnly
	// +kubebuilder:validation:Required
	// +required
	Type UpdateStrategyType `json:"type,omitempty"`

	// serverSideApply defines the configuration for server side apply. It is honored only when
	// type of updateStrategy is ServerSideApply
	// +optional
	ServerSideApply *ServerSideApplyConfig `json:"serverSideApply,omitempty"`
}

UpdateStrategy defines the strategy to update this manifest

func (*UpdateStrategy) DeepCopy added in v0.8.0

func (in *UpdateStrategy) DeepCopy() *UpdateStrategy

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

func (*UpdateStrategy) DeepCopyInto added in v0.8.0

func (in *UpdateStrategy) DeepCopyInto(out *UpdateStrategy)

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

func (UpdateStrategy) SwaggerDoc added in v0.8.0

func (UpdateStrategy) SwaggerDoc() map[string]string

type UpdateStrategyType added in v0.8.0

type UpdateStrategyType string
const (
	// UpdateStrategyTypeUpdate means to update resource by an update call.
	UpdateStrategyTypeUpdate UpdateStrategyType = "Update"

	// UpdateStrategyTypeCreateOnly means do not update resource based on current manifest. This should be used only when
	// ServerSideApply type is not support on the spoke, and the user on hub would like some other controller
	// on the spoke to own the control of the resource.
	UpdateStrategyTypeCreateOnly UpdateStrategyType = "CreateOnly"

	// UpdateStrategyTypeServerSideApply means to update resource using server side apply with work-controller as the field manager.
	// If there is conflict, the related Applied condition of manifest will be in the status of False with the
	// reason of ApplyConflict. This type allows another controller on the spoke to control certain field of the resource.
	UpdateStrategyTypeServerSideApply UpdateStrategyType = "ServerSideApply"

	// UpdateStrategyTypeReadOnly type means only check the existence of the resource based on the resource's metadata.
	// If the statusFeedBackRules are set, the feedbackResult will also be returned.
	// The resource will not be removed when the type is ReadOnly, and only resource metadata is required.
	UpdateStrategyTypeReadOnly UpdateStrategyType = "ReadOnly"
)

type ValueType added in v0.6.0

type ValueType string

+kubebuilder:validation:Enum=Integer;String;Boolean;JsonRaw

const (
	Integer ValueType = "Integer"
	String  ValueType = "String"
	Boolean ValueType = "Boolean"
	JsonRaw ValueType = "JsonRaw"
)

Jump to

Keyboard shortcuts

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