v1

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Overview

+k8s:openapi-gen=true +k8s:deepcopy-gen=package +k8s:defaulter-gen=TypeMeta +groupName=apps.k8s.appscode.com

Index

Constants

View Source
const (
	ResourceKindPetSet = "PetSet"
	ResourcePetSet     = "petset"
	ResourcePetSets    = "petsets"
)
View Source
const (
	ResourceKindPlacementPolicy = "PlacementPolicy"
	ResourcePlacementPolicy     = "placementpolicy"
	ResourcePlacementPolicies   = "placementpolicies"
)
View Source
const GroupName = "apps.k8s.appscode.com"

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects
	SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: SchemeGroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns a Group qualified GroupKind

func RegisterDefaults

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func SetObjectDefaults_PetSet

func SetObjectDefaults_PetSet(in *PetSet)

func SetObjectDefaults_PetSetList

func SetObjectDefaults_PetSetList(in *PetSetList)

Types

type Affinity added in v0.0.2

type Affinity struct {
	// Describes node affinity scheduling rules for the pod.
	// +optional
	NodeAffinity []NodeAffinityRule `json:"nodeAffinity,omitempty"`
}

Affinity is a group of affinity scheduling rules.

func (*Affinity) DeepCopy added in v0.0.2

func (in *Affinity) DeepCopy() *Affinity

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

func (*Affinity) DeepCopyInto added in v0.0.2

func (in *Affinity) DeepCopyInto(out *Affinity)

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

type NodeAffinityRule

type NodeAffinityRule struct {
	TopologyKey string           `json:"topologyKey"`
	Domains     []TopologyDomain `json:"domains"`
	// +kubebuilder:default=DoNotSchedule
	WhenUnsatisfiable v1.UnsatisfiableConstraintAction `json:"whenUnsatisfiable"`
	// Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.
	// +kubebuilder:default=50
	Weight int32 `json:"weight"`
}

func (*NodeAffinityRule) DeepCopy

func (in *NodeAffinityRule) DeepCopy() *NodeAffinityRule

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

func (*NodeAffinityRule) DeepCopyInto

func (in *NodeAffinityRule) DeepCopyInto(out *NodeAffinityRule)

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

type NodeSpreadConstraint

type NodeSpreadConstraint struct {
	// +kubebuilder:default=1
	MaxSkew int32 `json:"maxSkew"`
	// +kubebuilder:default=DoNotSchedule
	WhenUnsatisfiable v1.UnsatisfiableConstraintAction `json:"whenUnsatisfiable"`
}

func (*NodeSpreadConstraint) DeepCopy

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

func (*NodeSpreadConstraint) DeepCopyInto

func (in *NodeSpreadConstraint) DeepCopyInto(out *NodeSpreadConstraint)

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

type PetSet

type PetSet struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the desired identities of pods in this set.
	// +optional
	Spec PetSetSpec `json:"spec,omitempty"`

	// Status is the current status of Pods in this PetSet. This data
	// may be out of date by some window of time.
	// +optional
	Status apps.StatefulSetStatus `json:"status,omitempty"`
}

PetSet represents a set of pods with consistent identities. Identities are defined as:

  • Network: A single stable DNS and hostname.
  • Storage: As many VolumeClaims as requested.

The PetSet guarantees that a given network identity will always map to the same storage identity.

func (PetSet) CustomResourceDefinition added in v0.0.3

func (_ PetSet) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*PetSet) DeepCopy

func (in *PetSet) DeepCopy() *PetSet

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

func (*PetSet) DeepCopyInto

func (in *PetSet) DeepCopyInto(out *PetSet)

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

func (*PetSet) DeepCopyObject

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

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

func (*PetSet) Default

func (obj *PetSet) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*PetSet) SetupWebhookWithManager

func (r *PetSet) SetupWebhookWithManager(mgr ctrl.Manager) error

SetupWebhookWithManager will setup the manager to manage the webhooks

func (*PetSet) ValidateCreate

func (r *PetSet) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*PetSet) ValidateDelete

func (r *PetSet) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*PetSet) ValidateUpdate

func (r *PetSet) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type PetSetList

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

	// Items is the list of stateful sets.
	Items []PetSet `json:"items"`
}

PetSetList is a collection of PetSets.

func (*PetSetList) DeepCopy

func (in *PetSetList) DeepCopy() *PetSetList

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

func (*PetSetList) DeepCopyInto

func (in *PetSetList) DeepCopyInto(out *PetSetList)

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

func (*PetSetList) DeepCopyObject

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

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

type PetSetSpec

type PetSetSpec struct {
	// replicas is the desired number of replicas of the given Template.
	// These are replicas in the sense that they are instantiations of the
	// same Template, but individual replicas also have a consistent identity.
	// If unspecified, defaults to 1.
	// TODO: Consider a rename of this field.
	// +optional
	Replicas *int32 `json:"replicas,omitempty"`

	// selector is a label query over pods that should match the replica count.
	// It must match the pod template's labels.
	// More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors
	Selector *metav1.LabelSelector `json:"selector"`

	// template is the object that describes the pod that will be created if
	// insufficient replicas are detected. Each pod stamped out by the PetSet
	// will fulfill this Template, but have a unique identity from the rest
	// of the PetSet. Each pod will be named with the format
	// <petsetname>-<podindex>. For example, a pod in a PetSet named
	// "web" with index number "3" would be named "web-3".
	// The only allowed template.spec.restartPolicy value is "Always".
	Template PodTemplateSpec `json:"template"`

	// volumeClaimTemplates is a list of claims that pods are allowed to reference.
	// The PetSet controller is responsible for mapping network identities to
	// claims in a way that maintains the identity of a pod. Every claim in
	// this list must have at least one matching (by name) volumeMount in one
	// container in the template. A claim in this list takes precedence over
	// any volumes in the template, with the same name.
	// TODO: Define the behavior if a claim already exists with the same name.
	// +optional
	// +listType=atomic
	VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`

	// serviceName is the name of the service that governs this PetSet.
	// This service must exist before the PetSet, and is responsible for
	// the network identity of the set. Pods get DNS/hostnames that follow the
	// pattern: pod-specific-string.serviceName.default.svc.cluster.local
	// where "pod-specific-string" is managed by the PetSet controller.
	ServiceName string `json:"serviceName"`

	// podManagementPolicy controls how pods are created during initial scale up,
	// when replacing pods on nodes, or when scaling down. The default policy is
	// `OrderedReady`, where pods are created in increasing order (pod-0, then
	// pod-1, etc) and the controller will wait until each pod is ready before
	// continuing. When scaling down, the pods are removed in the opposite order.
	// The alternative policy is `Parallel` which will create pods in parallel
	// to match the desired scale without waiting, and on scale down will delete
	// all pods at once.
	// +optional
	PodManagementPolicy apps.PodManagementPolicyType `json:"podManagementPolicy,omitempty"`

	// updateStrategy indicates the PetSetUpdateStrategy that will be
	// employed to update Pods in the PetSet when a revision is made to
	// Template.
	UpdateStrategy apps.StatefulSetUpdateStrategy `json:"updateStrategy,omitempty"`

	// revisionHistoryLimit is the maximum number of revisions that will
	// be maintained in the PetSet's revision history. The revision history
	// consists of all revisions not represented by a currently applied
	// PetSetSpec version. The default value is 10.
	RevisionHistoryLimit *int32 `json:"revisionHistoryLimit,omitempty"`

	// Minimum number of seconds for which a newly created pod should be ready
	// without any of its container crashing for it to be considered available.
	// Defaults to 0 (pod will be considered available as soon as it is ready)
	// +optional
	MinReadySeconds int32 `json:"minReadySeconds,omitempty"`

	// persistentVolumeClaimRetentionPolicy describes the lifecycle of persistent
	// volume claims created from volumeClaimTemplates. By default, all persistent
	// volume claims are created as needed and retained until manually deleted. This
	// policy allows the lifecycle to be altered, for example by deleting persistent
	// volume claims when their stateful set is deleted, or when their pod is scaled
	// down. This requires the PetSetAutoDeletePVC feature gate to be enabled,
	// which is alpha.  +optional
	PersistentVolumeClaimRetentionPolicy *apps.StatefulSetPersistentVolumeClaimRetentionPolicy `json:"persistentVolumeClaimRetentionPolicy,omitempty"`

	// ordinals controls the numbering of replica indices in a PetSet. The
	// default ordinals behavior assigns a "0" index to the first replica and
	// increments the index by one for each additional replica requested. Using
	// the ordinals field requires the PetSetStartOrdinal feature gate to be
	// enabled, which is beta.
	// +optional
	Ordinals *apps.StatefulSetOrdinals `json:"ordinals,omitempty"`

	// +optional
	PodPlacementPolicy *v1.LocalObjectReference `json:"podPlacementPolicy,omitempty"`
}

A PetSetSpec is the specification of a PetSet.

func (*PetSetSpec) DeepCopy

func (in *PetSetSpec) DeepCopy() *PetSetSpec

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

func (*PetSetSpec) DeepCopyInto

func (in *PetSetSpec) DeepCopyInto(out *PetSetSpec)

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

type PlacementPolicy

type PlacementPolicy struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the desired identities of pods in this set.
	// +optional
	Spec PlacementPolicySpec `json:"spec,omitempty"`
}

PlacementPolicy represents a set of pods with consistent identities. Identities are defined as:

  • Network: A single stable DNS and hostname.
  • Storage: As many VolumeClaims as requested.

The PlacementPolicy guarantees that a given network identity will always map to the same storage identity.

func (PlacementPolicy) CustomResourceDefinition added in v0.0.3

func (_ PlacementPolicy) CustomResourceDefinition() *apiextensions.CustomResourceDefinition

func (*PlacementPolicy) DeepCopy

func (in *PlacementPolicy) DeepCopy() *PlacementPolicy

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

func (*PlacementPolicy) DeepCopyInto

func (in *PlacementPolicy) DeepCopyInto(out *PlacementPolicy)

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

func (*PlacementPolicy) DeepCopyObject

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

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

type PlacementPolicyList

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

	// Items is the list of stateful sets.
	Items []PlacementPolicy `json:"items"`
}

PlacementPolicyList is a collection of PlacementPolicys.

func (*PlacementPolicyList) DeepCopy

func (in *PlacementPolicyList) DeepCopy() *PlacementPolicyList

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

func (*PlacementPolicyList) DeepCopyInto

func (in *PlacementPolicyList) DeepCopyInto(out *PlacementPolicyList)

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

func (*PlacementPolicyList) DeepCopyObject

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

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

type PlacementPolicySpec

type PlacementPolicySpec struct {
	// +optional
	ZoneSpreadConstraint *ZoneSpreadConstraint `json:"zoneSpreadConstraint,omitempty"`

	// +optional
	NodeSpreadConstraint *NodeSpreadConstraint `json:"nodeSpreadConstraint,omitempty"`

	// If specified, the pod's scheduling constraints
	// +optional
	Affinity *Affinity `json:"affinity,omitempty"`
}

A PlacementPolicySpec is the specification of a PlacementPolicy.

func (*PlacementPolicySpec) DeepCopy

func (in *PlacementPolicySpec) DeepCopy() *PlacementPolicySpec

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

func (*PlacementPolicySpec) DeepCopyInto

func (in *PlacementPolicySpec) DeepCopyInto(out *PlacementPolicySpec)

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

type PodTemplateSpec

type PodTemplateSpec struct {
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Specification of the desired behavior of the pod.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
	// +optional
	Spec v1.PodSpec `json:"spec,omitempty"`
}

PodTemplateSpec describes the data a pod should have when created from a template

func (*PodTemplateSpec) DeepCopy

func (in *PodTemplateSpec) DeepCopy() *PodTemplateSpec

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

func (*PodTemplateSpec) DeepCopyInto

func (in *PodTemplateSpec) DeepCopyInto(out *PodTemplateSpec)

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

type TopologyDomain

type TopologyDomain struct {
	Values   []string `json:"values"`
	Replicas string   `json:"replicas"`
}

func (*TopologyDomain) DeepCopy

func (in *TopologyDomain) DeepCopy() *TopologyDomain

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

func (*TopologyDomain) DeepCopyInto

func (in *TopologyDomain) DeepCopyInto(out *TopologyDomain)

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

type ZoneSpreadConstraint

type ZoneSpreadConstraint struct {
	// +kubebuilder:default=1
	MaxSkew int32 `json:"maxSkew"`
	// +kubebuilder:default=DoNotSchedule
	WhenUnsatisfiable v1.UnsatisfiableConstraintAction `json:"whenUnsatisfiable"`
}

func (*ZoneSpreadConstraint) DeepCopy

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

func (*ZoneSpreadConstraint) DeepCopyInto

func (in *ZoneSpreadConstraint) DeepCopyInto(out *ZoneSpreadConstraint)

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