v1alpha1

package
v0.0.0-...-e29486c Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const GroupName = "policy.kubeedge.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 Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type CommandArgsOverrider

type CommandArgsOverrider struct {
	// The name of container
	// +required
	ContainerName string `json:"containerName"`

	// Operator represents the operator which will apply on the command/args.
	// +kubebuilder:validation:Enum=add;remove
	// +required
	Operator OverriderOperator `json:"operator"`

	// Value to be applied to command/args.
	// Items in Value which will be appended after command/args when Operator is 'add'.
	// Items in Value which match in command/args will be deleted when Operator is 'remove'.
	// If Value is empty, then the command/args will remain the same.
	// +optional
	Value []string `json:"value,omitempty"`
}

CommandArgsOverrider represents the rules dedicated to handling command/args overrides.

func (*CommandArgsOverrider) DeepCopy

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

func (*CommandArgsOverrider) DeepCopyInto

func (in *CommandArgsOverrider) DeepCopyInto(out *CommandArgsOverrider)

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

type ImageComponent

type ImageComponent string

ImageComponent indicates the components for image.

const (
	// Registry is the registry component of an image with format '[registry/]repository[:tag]'.
	Registry ImageComponent = "Registry"

	// Repository is the repository component of an image with format '[registry/]repository[:tag]'.
	Repository ImageComponent = "Repository"

	// Tag is the tag component of an image with format '[registry/]repository[:tag]'.
	Tag ImageComponent = "Tag"
)

type ImageOverrider

type ImageOverrider struct {
	// Predicate filters images before applying the rule.
	//
	// Defaults to nil, in that case, the system will automatically detect image fields if the resource type is
	// Pod, ReplicaSet, Deployment or StatefulSet by following rule:
	//   - Pod: spec/containers/<N>/image
	//   - ReplicaSet: spec/template/spec/containers/<N>/image
	//   - Deployment: spec/template/spec/containers/<N>/image
	//   - StatefulSet: spec/template/spec/containers/<N>/image
	// In addition, all images will be processed if the resource object has more than one containers.
	//
	// If not nil, only images matches the filters will be processed.
	// +optional
	Predicate *ImagePredicate `json:"predicate,omitempty"`

	// Component is part of image name.
	// Basically we presume an image can be made of '[registry/]repository[:tag]'.
	// The registry could be:
	// - k8s.gcr.io
	// - fictional.registry.example:10443
	// The repository could be:
	// - kube-apiserver
	// - fictional/nginx
	// The tag cloud be:
	// - latest
	// - v1.19.1
	// - @sha256:dbcc1c35ac38df41fd2f5e4130b32ffdb93ebae8b3dbe638c23575912276fc9c
	//
	// +kubebuilder:validation:Enum=Registry;Repository;Tag
	// +required
	Component ImageComponent `json:"component"`

	// Operator represents the operator which will apply on the image.
	// +kubebuilder:validation:Enum=add;remove;replace
	// +required
	Operator OverriderOperator `json:"operator"`

	// Value to be applied to image.
	// Must not be empty when operator is 'add' or 'replace'.
	// Defaults to empty and ignored when operator is 'remove'.
	// +optional
	Value string `json:"value,omitempty"`
}

ImageOverrider represents the rules dedicated to handling image overrides.

func (*ImageOverrider) DeepCopy

func (in *ImageOverrider) DeepCopy() *ImageOverrider

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

func (*ImageOverrider) DeepCopyInto

func (in *ImageOverrider) DeepCopyInto(out *ImageOverrider)

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

type ImagePredicate

type ImagePredicate struct {
	// Path indicates the path of target field
	// +required
	Path string `json:"path"`
}

ImagePredicate describes images filter.

func (*ImagePredicate) DeepCopy

func (in *ImagePredicate) DeepCopy() *ImagePredicate

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

func (*ImagePredicate) DeepCopyInto

func (in *ImagePredicate) DeepCopyInto(out *ImagePredicate)

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

type NodeGroupPreferences

type NodeGroupPreferences struct {
	// StaticWeightList defines the static nodegroup weight.
	// +required
	StaticWeightList []StaticNodeGroupWeight `json:"staticWeightList"`
}

NodeGroupPreferences describes weight for each nodegroups or for each group of nodegroup.

func (*NodeGroupPreferences) DeepCopy

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

func (*NodeGroupPreferences) DeepCopyInto

func (in *NodeGroupPreferences) DeepCopyInto(out *NodeGroupPreferences)

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

type OverridePolicy

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

	// Spec represents the desired behavior of OverridePolicy.
	Spec OverrideSpec `json:"spec"`
}

OverridePolicy represents the policy that overrides a group of resources to one or more nodegroups.

func (*OverridePolicy) DeepCopy

func (in *OverridePolicy) DeepCopy() *OverridePolicy

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

func (*OverridePolicy) DeepCopyInto

func (in *OverridePolicy) DeepCopyInto(out *OverridePolicy)

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

func (*OverridePolicy) DeepCopyObject

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

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

type OverridePolicyList

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

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

OverridePolicyList is a collection of OverridePolicy.

func (*OverridePolicyList) DeepCopy

func (in *OverridePolicyList) DeepCopy() *OverridePolicyList

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

func (*OverridePolicyList) DeepCopyInto

func (in *OverridePolicyList) DeepCopyInto(out *OverridePolicyList)

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

func (*OverridePolicyList) DeepCopyObject

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

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

type OverrideSpec

type OverrideSpec struct {
	// ResourceSelectors restricts resource types that this override policy applies to.
	// nil means matching all resources.
	// +optional
	ResourceSelectors []ResourceSelector `json:"resourceSelectors,omitempty"`

	// OverrideRules defines a collection of override rules on target nodegroups.
	// +optional
	OverrideRules []RuleWithNodeGroup `json:"overrideRules,omitempty"`
}

OverrideSpec defines the desired behavior of OverridePolicy.

func (*OverrideSpec) DeepCopy

func (in *OverrideSpec) DeepCopy() *OverrideSpec

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

func (*OverrideSpec) DeepCopyInto

func (in *OverrideSpec) DeepCopyInto(out *OverrideSpec)

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

type OverriderOperator

type OverriderOperator string

OverriderOperator is the set of operators that can be used in an overrider.

const (
	OverriderOpAdd     OverriderOperator = "add"
	OverriderOpRemove  OverriderOperator = "remove"
	OverriderOpReplace OverriderOperator = "replace"
)

These are valid overrider operators.

type Overriders

type Overriders struct {
	// Plaintext represents override rules defined with plaintext overriders.
	// +optional
	Plaintext []PlaintextOverrider `json:"plaintext,omitempty"`

	// ImageOverrider represents the rules dedicated to handling image overrides.
	// +optional
	ImageOverrider []ImageOverrider `json:"imageOverrider,omitempty"`

	// CommandOverrider represents the rules dedicated to handling container command
	// +optional
	CommandOverrider []CommandArgsOverrider `json:"commandOverrider,omitempty"`

	// ArgsOverrider represents the rules dedicated to handling container args
	// +optional
	ArgsOverrider []CommandArgsOverrider `json:"argsOverrider,omitempty"`
}

Overriders offers various alternatives to represent the override rules.

If more than one alternatives exist, they will be applied with following order: - ImageOverrider - Plaintext

func (*Overriders) DeepCopy

func (in *Overriders) DeepCopy() *Overriders

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

func (*Overriders) DeepCopyInto

func (in *Overriders) DeepCopyInto(out *Overriders)

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

type PlaintextOverrider

type PlaintextOverrider struct {
	// Path indicates the path of target field
	Path string `json:"path"`
	// Operator indicates the operation on target field.
	// Available operators are: add, update and remove.
	// +kubebuilder:validation:Enum=add;remove;replace
	Operator OverriderOperator `json:"operator"`
	// Value to be applied to target field.
	// Must be empty when operator is Remove.
	// +optional
	Value apiextensionsv1.JSON `json:"value,omitempty"`
}

PlaintextOverrider is a simple overrider that overrides target fields according to path, operator and value.

func (*PlaintextOverrider) DeepCopy

func (in *PlaintextOverrider) DeepCopy() *PlaintextOverrider

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

func (*PlaintextOverrider) DeepCopyInto

func (in *PlaintextOverrider) DeepCopyInto(out *PlaintextOverrider)

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

type PropagationPolicy

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

	// Spec represents the desired behavior of PropagationPolicy.
	// +required
	Spec PropagationPolicySpec `json:"spec"`
}

PropagationPolicy represents the policy that propagates a group of resources to one or more nodegroups.

func (*PropagationPolicy) DeepCopy

func (in *PropagationPolicy) DeepCopy() *PropagationPolicy

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

func (*PropagationPolicy) DeepCopyInto

func (in *PropagationPolicy) DeepCopyInto(out *PropagationPolicy)

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

func (*PropagationPolicy) DeepCopyObject

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

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

type PropagationPolicyList

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

PropagationPolicyList contains a list of PropagationPolicy

func (*PropagationPolicyList) DeepCopy

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

func (*PropagationPolicyList) DeepCopyInto

func (in *PropagationPolicyList) DeepCopyInto(out *PropagationPolicyList)

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

func (*PropagationPolicyList) DeepCopyObject

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

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

type PropagationPolicySpec

type PropagationPolicySpec struct {
	// ResourceSelectors used to select resources.
	// +required
	ResourceSelectors []ResourceSelector `json:"resourceSelectors"`

	// Placement represents the rule for select nodegroups to propagate resources.
	// +optional
	Placement NodeGroupPreferences `json:"placement,omitempty"`
}

PropagationPolicySpec represents the desired behavior of PropagationPolicy.

func (*PropagationPolicySpec) DeepCopy

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

func (*PropagationPolicySpec) DeepCopyInto

func (in *PropagationPolicySpec) DeepCopyInto(out *PropagationPolicySpec)

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

type PropagationPolicyStatus

type PropagationPolicyStatus struct {
}

PropagationPolicyStatus defines the observed state of PropagationPolicy

func (*PropagationPolicyStatus) DeepCopy

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

func (*PropagationPolicyStatus) DeepCopyInto

func (in *PropagationPolicyStatus) DeepCopyInto(out *PropagationPolicyStatus)

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

type ResourceSelector

type ResourceSelector struct {
	// APIVersion represents the API version of the target resources.
	// +required
	APIVersion string `json:"apiVersion"`

	// Kind represents the Kind of the target resources.
	// +required
	Kind string `json:"kind"`

	// Namespace of the target resource.
	// Default is empty, which means inherit from the parent object scope.
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Name of the target resource.
	// Default is empty, which means selecting all resources.
	// +optional
	Name string `json:"name,omitempty"`

	// A label query over a set of resources.
	// If name is not empty, labelSelector will be ignored.
	// +optional
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
}

ResourceSelector the resources will be selected.

func (*ResourceSelector) DeepCopy

func (in *ResourceSelector) DeepCopy() *ResourceSelector

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

func (*ResourceSelector) DeepCopyInto

func (in *ResourceSelector) DeepCopyInto(out *ResourceSelector)

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

type RuleWithNodeGroup

type RuleWithNodeGroup struct {
	// TargetNodeGroup defines restrictions on this override policy
	// that only applies to resources propagated to the matching nodegroups.
	// nil means matching all nodegroups.
	// +optional
	TargetNodeGroup []string `json:"targetNodeGroup,omitempty"`

	// Overriders represents the override rules that would apply on resources
	// +required
	Overriders Overriders `json:"overriders"`
}

RuleWithNodeGroup defines the override rules on nodegroups.

func (*RuleWithNodeGroup) DeepCopy

func (in *RuleWithNodeGroup) DeepCopy() *RuleWithNodeGroup

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

func (*RuleWithNodeGroup) DeepCopyInto

func (in *RuleWithNodeGroup) DeepCopyInto(out *RuleWithNodeGroup)

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

type StaticNodeGroupWeight

type StaticNodeGroupWeight struct {
	// NodeGroupNames specifies nodegroups with names.
	// +required
	NodeGroupNames []string `json:"nodeGroupNames"`

	// Weight expressing the preference to the nodegroup(s) specified by 'TargetNodeGroup'.
	// +kubebuilder:validation:Minimum=1
	// +required
	Weight int64 `json:"weight"`
}

StaticNodeGroupWeight defines the static NodeGroup weight.

func (*StaticNodeGroupWeight) DeepCopy

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

func (*StaticNodeGroupWeight) DeepCopyInto

func (in *StaticNodeGroupWeight) DeepCopyInto(out *StaticNodeGroupWeight)

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