factory

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigMapVolumeMounts

func ConfigMapVolumeMounts(xstore *polardbxv1.XStore) []corev1.VolumeMount

func ConfigMapVolumes

func ConfigMapVolumes(xstore *polardbxv1.XStore) []corev1.Volume

func NewConfigConfigMap

func NewConfigConfigMap(rc *reconcile.Context, xstore *polardbxv1.XStore, engine string) (*corev1.ConfigMap, error)

func NewHeadlessService

func NewHeadlessService(xstore *polardbxv1.XStore, podName string) *corev1.Service

func NewPod

func NewPod(rc *reconcile.Context, xstore *polardbxv1.XStore, nodeSet *polardbxv1xstore.NodeSet,
	index int, opts PodFactoryOptions) (*corev1.Pod, error)

func NewSecret

func NewSecret(xstore *polardbxv1.XStore) *corev1.Secret

func NewTaskConfigMap

func NewTaskConfigMap(xstore *polardbxv1.XStore) *corev1.ConfigMap

func SystemEnvs

func SystemEnvs() []corev1.EnvVar

func SystemVolumeMounts

func SystemVolumeMounts() []corev1.VolumeMount

func SystemVolumes

func SystemVolumes() []corev1.Volume

Types

type DefaultExtraPodFactory

type DefaultExtraPodFactory struct {
}

func (*DefaultExtraPodFactory) Command

func (f *DefaultExtraPodFactory) Command(ctx *PodFactoryContext, container string) []string

func (*DefaultExtraPodFactory) ExtraAnnotations

func (f *DefaultExtraPodFactory) ExtraAnnotations(ctx *PodFactoryContext) map[string]string

func (*DefaultExtraPodFactory) ExtraLabels

func (f *DefaultExtraPodFactory) ExtraLabels(ctx *PodFactoryContext) map[string]string

func (*DefaultExtraPodFactory) NewAffinity

func (*DefaultExtraPodFactory) NewEnvs

func (*DefaultExtraPodFactory) NewPorts

func (f *DefaultExtraPodFactory) NewPorts(ctx *PodFactoryContext, allocated map[string]int) (map[string][]corev1.ContainerPort, error)

func (*DefaultExtraPodFactory) NewProbes

func (f *DefaultExtraPodFactory) NewProbes(ctx *PodFactoryContext, container string) *ProbeSpec

func (*DefaultExtraPodFactory) NewResources

func (*DefaultExtraPodFactory) NewVolumeMounts

func (f *DefaultExtraPodFactory) NewVolumeMounts(ctx *PodFactoryContext) (map[string][]corev1.VolumeMount, error)

func (*DefaultExtraPodFactory) NewVolumes

func (*DefaultExtraPodFactory) WorkDir

func (f *DefaultExtraPodFactory) WorkDir(ctx *PodFactoryContext, container string) string

type ExtraPodFactory

type ExtraPodFactory interface {
	NewPorts(ctx *PodFactoryContext, allocated map[string]int) (map[string][]corev1.ContainerPort, error)
	NewVolumes(ctx *PodFactoryContext, volumes []polardbxv1xstore.HostPathVolume) ([]corev1.Volume, error)
	NewVolumeMounts(ctx *PodFactoryContext) (map[string][]corev1.VolumeMount, error)
	NewEnvs(ctx *PodFactoryContext) (map[string][]corev1.EnvVar, error)
	ExtraLabels(ctx *PodFactoryContext) map[string]string
	ExtraAnnotations(ctx *PodFactoryContext) map[string]string
	WorkDir(ctx *PodFactoryContext, container string) string
	Command(ctx *PodFactoryContext, container string) []string
	NewProbes(ctx *PodFactoryContext, container string) *ProbeSpec
	NewResources(ctx *PodFactoryContext, container string) corev1.ResourceRequirements
	NewAffinity(ctx *PodFactoryContext) *corev1.Affinity
}

type PodFactoryContext

type PodFactoryContext struct {
	// contains filtered or unexported fields
}

type PodFactoryOptions

type PodFactoryOptions struct {
	ExtraPodFactory
	TemplateMergePolicy
}

type ProbeSpec

type ProbeSpec struct {
	StartupProbe   *corev1.Probe
	LivenessProbe  *corev1.Probe
	ReadinessProbe *corev1.Probe
}

func (*ProbeSpec) Setup

func (p *ProbeSpec) Setup(c *corev1.Container)

type TemplateMergePolicy

type TemplateMergePolicy int
const (
	TemplateMergePolicyOverwrite TemplateMergePolicy = iota
	TemplateMergePolicyPatch
)

Jump to

Keyboard shortcuts

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