statefulset

package
v0.0.8-prerelease Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply added in v0.0.7

func Apply(funcs ...Modification) func(*appsv1.StatefulSet)

func CreateOrUpdate

func CreateOrUpdate(getUpdateCreator GetUpdateCreator, sts appsv1.StatefulSet) error

CreateOrUpdate creates the given StatefulSet if it doesn't exist, or updates it if it does.

func CreateVolumeFromConfigMap added in v0.0.4

func CreateVolumeFromConfigMap(name, sourceName string) corev1.Volume

func CreateVolumeFromEmptyDir added in v0.0.4

func CreateVolumeFromEmptyDir(name string) corev1.Volume

func CreateVolumeFromSecret added in v0.0.4

func CreateVolumeFromSecret(name, sourceName string) corev1.Volume

func CreateVolumeMount added in v0.0.4

func CreateVolumeMount(name, path string, options ...func(*corev1.VolumeMount)) corev1.VolumeMount

CreateVolumeMount returns a corev1.VolumeMount with options.

func GetAndUpdate

func GetAndUpdate(getUpdater GetUpdater, nsName types.NamespacedName, updateFunc func(*appsv1.StatefulSet)) error

GetAndUpdate applies the provided function to the most recent version of the object

func IsReady added in v0.0.4

func IsReady(sts appsv1.StatefulSet, expectedReplicas int) bool

func New added in v0.0.7

func New(mods ...Modification) appsv1.StatefulSet

func WithReadOnly added in v0.0.4

func WithReadOnly(readonly bool) func(*corev1.VolumeMount)

WithReadOnly sets the ReadOnly attribute of this VolumeMount

func WithSubPath added in v0.0.4

func WithSubPath(subPath string) func(*corev1.VolumeMount)

WithSubPath sets the SubPath for this VolumeMount

Types

type Builder added in v0.0.4

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

func NewBuilder added in v0.0.4

func NewBuilder() *Builder

func (*Builder) AddVolume added in v0.0.4

func (s *Builder) AddVolume(volume corev1.Volume) *Builder

func (*Builder) AddVolumeAndMount added in v0.0.4

func (s *Builder) AddVolumeAndMount(containerName string, volumeMountData VolumeMountData) *Builder

func (*Builder) AddVolumeClaimTemplates added in v0.0.4

func (s *Builder) AddVolumeClaimTemplates(claims []corev1.PersistentVolumeClaim) *Builder

func (*Builder) AddVolumeMount added in v0.0.4

func (s *Builder) AddVolumeMount(containerName string, mount corev1.VolumeMount) *Builder

func (*Builder) AddVolumeMounts added in v0.0.4

func (s *Builder) AddVolumeMounts(containerName string, mounts []corev1.VolumeMount) *Builder

func (*Builder) AddVolumes added in v0.0.4

func (s *Builder) AddVolumes(volumes []corev1.Volume) *Builder

func (Builder) Build added in v0.0.4

func (s Builder) Build() (appsv1.StatefulSet, error)

func (*Builder) SetLabels added in v0.0.4

func (s *Builder) SetLabels(labels map[string]string) *Builder

func (*Builder) SetMatchLabels added in v0.0.4

func (s *Builder) SetMatchLabels(matchLabels map[string]string) *Builder

func (*Builder) SetName added in v0.0.4

func (s *Builder) SetName(name string) *Builder

func (*Builder) SetNamespace added in v0.0.4

func (s *Builder) SetNamespace(namespace string) *Builder

func (*Builder) SetOwnerReference added in v0.0.4

func (s *Builder) SetOwnerReference(ownerReference []metav1.OwnerReference) *Builder

func (*Builder) SetPodTemplateSpec added in v0.0.4

func (s *Builder) SetPodTemplateSpec(podTemplateSpec corev1.PodTemplateSpec) *Builder

func (*Builder) SetReadinessProbe added in v0.0.4

func (s *Builder) SetReadinessProbe(probe *corev1.Probe, containerName string) *Builder

func (*Builder) SetReplicas added in v0.0.4

func (s *Builder) SetReplicas(replicas int) *Builder

func (*Builder) SetServiceName added in v0.0.4

func (s *Builder) SetServiceName(serviceName string) *Builder

func (*Builder) SetUpdateStrategy added in v0.0.4

func (s *Builder) SetUpdateStrategy(updateStrategyType appsv1.StatefulSetUpdateStrategyType) *Builder

type Creator

type Creator interface {
	CreateStatefulSet(sts appsv1.StatefulSet) error
}

type Deleter

type Deleter interface {
	DeleteStatefulSet(objectKey client.ObjectKey) error
}

type GetUpdateCreateDeleter

type GetUpdateCreateDeleter interface {
	Getter
	Updater
	Creator
	Deleter
}

type GetUpdateCreator

type GetUpdateCreator interface {
	Getter
	Updater
	Creator
}

type GetUpdater

type GetUpdater interface {
	Getter
	Updater
}

type Getter

type Getter interface {
	GetStatefulSet(objectKey client.ObjectKey) (appsv1.StatefulSet, error)
}

type Modification added in v0.0.7

type Modification func(*appsv1.StatefulSet)

func WithLabels added in v0.0.7

func WithLabels(labels map[string]string) Modification

func WithMatchLabels added in v0.0.7

func WithMatchLabels(matchLabels map[string]string) Modification

func WithName added in v0.0.7

func WithName(name string) Modification

func WithNamespace added in v0.0.7

func WithNamespace(namespace string) Modification

func WithOwnerReference added in v0.0.7

func WithOwnerReference(ownerRefs []metav1.OwnerReference) Modification

func WithPodSpecTemplate added in v0.0.7

func WithPodSpecTemplate(templateFunc func(*corev1.PodTemplateSpec)) Modification

func WithReplicas added in v0.0.7

func WithReplicas(replicas int) Modification

func WithServiceName added in v0.0.7

func WithServiceName(svcName string) Modification

func WithUpdateStrategyType added in v0.0.7

func WithUpdateStrategyType(strategyType appsv1.StatefulSetUpdateStrategyType) Modification

func WithVolumeClaim added in v0.0.7

func WithVolumeClaim(name string, f func(*corev1.PersistentVolumeClaim)) Modification

type Updater

type Updater interface {
	UpdateStatefulSet(sts appsv1.StatefulSet) error
}

type VolumeMountData added in v0.0.4

type VolumeMountData struct {
	Name      string
	MountPath string
	Volume    corev1.Volume
}

VolumeMountData contains values required for the MountVolume function

Jump to

Keyboard shortcuts

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