replicaset

package
v0.0.0-...-d0642ff Latest Latest
Warning

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

Go to latest
Published: Dec 19, 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 the GroupVersionResource for replicaset.

Types

type AdditionalOptions

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

AdditionalOptions additional options for replicaset object.

type Builder

type Builder struct {
	// Replicaset definition. Used to create a replicaset object.
	Definition *appsv1.ReplicaSet
	// Created replicaset object.
	Object *appsv1.ReplicaSet
	// contains filtered or unexported fields
}

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

func NewBuilder

func NewBuilder(
	apiClient *clients.Settings,
	name, 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 replicaset into the Builder struct.

func (*Builder) Create

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

Create builds replicaset in the cluster and stores the created object in struct.

func (*Builder) CreateAndWaitUntilReady

func (builder *Builder) CreateAndWaitUntilReady(timeout time.Duration) (*Builder, error)

CreateAndWaitUntilReady creates a replicaset in the cluster and waits until the replicaset is available.

func (*Builder) Delete

func (builder *Builder) Delete() error

Delete removes the replicaset.

func (*Builder) DeleteAndWait

func (builder *Builder) DeleteAndWait(timeout time.Duration) error

DeleteAndWait deletes a replicaset and waits until it is removed from the cluster.

func (*Builder) Exists

func (builder *Builder) Exists() bool

Exists checks whether the given replicaset exists.

func (*Builder) IsReady

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

IsReady waits for the replicaset to reach expected number of pods in Ready state.

func (*Builder) Update

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

Update renovates the existing replicaset object with replicaset definition in builder.

func (*Builder) WithAdditionalContainerSpecs

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

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

func (*Builder) WithLabel

func (builder *Builder) WithLabel(labels map[string]string) *Builder

WithLabel applies label to replicaset's definition.

func (*Builder) WithNodeSelector

func (builder *Builder) WithNodeSelector(nodeSelector map[string]string) *Builder

WithNodeSelector applies nodeSelector to the replicaset definition.

func (*Builder) WithVolume

func (builder *Builder) WithVolume(rsVolume corev1.Volume) *Builder

WithVolume defines Volume of replicaset under ContainerTemplateSpec.

Jump to

Keyboard shortcuts

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