statefulset

package
v0.0.0-...-3c80002 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGVR

GetGVR returns pod's GroupVersionResource which could be used for Clean function.

Types

type AdditionalOptions

type AdditionalOptions func(builder *Builder) (*Builder, error)

AdditionalOptions additional options for StatefulSet object.

type Builder

type Builder struct {
	// StatefulSet definition. Used to create the statefulset object.
	Definition *appsv1.StatefulSet
	// Created statefulset object
	Object *appsv1.StatefulSet
	// contains filtered or unexported fields
}

Builder provides struct for statefulset object containing connection to the cluster and the statefulset definitions.

func List

func List(apiClient *clients.Settings, nsname string, options ...metav1.ListOptions) ([]*Builder, error)

List returns statefulset inventory in the given namespace.

func ListInAllNamespaces

func ListInAllNamespaces(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*Builder, error)

ListInAllNamespaces returns statefulset inventory in all namespaces.

func NewBuilder

func NewBuilder(
	apiClient *clients.Settings,
	name string,
	nsname string,
	labels map[string]string,
	containerSpec *corev1.Container) *Builder

NewBuilder creates a new instance of Builder.

func Pull

func Pull(apiClient *clients.Settings, name, nsname string) (*Builder, error)

Pull loads an existing statefulset into Builder struct.

func (*Builder) Create

func (builder *Builder) Create() (*Builder, error)

Create generates a statefulset in cluster and stores the created object in struct.

func (*Builder) Delete

func (builder *Builder) Delete() error

Delete a statefulset from the cluster.

func (*Builder) Exists

func (builder *Builder) Exists() bool

Exists checks whether the given statefulset exists.

func (*Builder) IsReady

func (builder *Builder) IsReady(timeout time.Duration) bool

IsReady periodically checks if statefulset is in ready status.

func (*Builder) WithAdditionalContainerSpecs

func (builder *Builder) WithAdditionalContainerSpecs(specs []corev1.Container) *Builder

WithAdditionalContainerSpecs appends a list of container specs to the statefulset definition.

func (*Builder) WithOptions

func (builder *Builder) WithOptions(options ...AdditionalOptions) *Builder

WithOptions creates StatefulSet with generic mutation options.

Jump to

Keyboard shortcuts

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