instancetemplate

package
v1.1.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// used to specify the configmap which stores the compressed instance template
	TemplateRefAnnotationKey = "kubeblocks.io/template-ref"
	TemplateRefDataKey       = "instances"

	TemplateNameLabelKey = "workloads.kubeblocks.io/template-name"
)

Variables

View Source
var ErrOrdinalsNotEnough = errors.New("available ordinals are not enough")

ErrOrdinalsNotEnough is considered temporary, e.g. some old ordinals are being deleted

Functions

func ValidateInstanceTemplates

func ValidateInstanceTemplates(its *workloads.InstanceSet, tree *kubebuilderx.ObjectTree) error

Types

type InstanceSetExt

type InstanceSetExt struct {
	InstanceSet       *workloads.InstanceSet
	InstanceTemplates map[string]*workloads.InstanceTemplate // key is template name
}

InstanceSetExt has a complete list of instance templates. i.e. it has a pseudo template (which equals to `.spec.template`) to the end of the list, to fill up the replica count.

func BuildInstanceSetExt

func BuildInstanceSetExt(its *workloads.InstanceSet, tree *kubebuilderx.ObjectTree) (*InstanceSetExt, error)

type InstanceTemplateExt

type InstanceTemplateExt struct {
	Name     string
	Replicas int32
	corev1.PodTemplateSpec
	VolumeClaimTemplates []corev1.PersistentVolumeClaim
}

InstanceTemplateExt merges the default podSpec with overrides in the template

func BuildInstanceTemplateExt

func BuildInstanceTemplateExt(itsExt *InstanceSetExt) []*InstanceTemplateExt

type PodNameBuilder

type PodNameBuilder interface {
	BuildInstanceName2TemplateMap() (map[string]*InstanceTemplateExt, error)
	GenerateAllInstanceNames() ([]string, error)
	// Validate will check nameBuilder-specific validation rules.
	// Rules that apply to all nameBuilders will be checked in ValidateInstanceTemplates.
	Validate() error
}

func NewPodNameBuilder

func NewPodNameBuilder(itsExt *InstanceSetExt, opts *PodNameBuilderOpts) (PodNameBuilder, error)

type PodNameBuilderOpts

type PodNameBuilderOpts struct {
	EventLogger record.EventRecorder
}

Jump to

Keyboard shortcuts

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