deployment

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: 15 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGVR

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

Types

type AdditionalOptions

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

AdditionalOptions additional options for deployment object.

type Builder

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

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

func List

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

List returns deployment inventory in the given namespace.

func ListInAllNamespaces

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

ListInAllNamespaces returns deployment inventory in the all the namespaces.

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 deployment into Builder struct.

func (*Builder) Create

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

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

func (*Builder) CreateAndWaitUntilReady

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

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

func (*Builder) Delete

func (builder *Builder) Delete() error

Delete removes a deployment.

func (*Builder) DeleteAndWait

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

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

func (*Builder) Exists

func (builder *Builder) Exists() bool

Exists checks whether the given deployment exists.

func (*Builder) IsReady

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

IsReady periodically checks if deployment is in ready status.

func (*Builder) Update

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

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

func (*Builder) WaitUntilCondition

func (builder *Builder) WaitUntilCondition(condition appsv1.DeploymentConditionType, timeout time.Duration) error

WaitUntilCondition waits for the duration of the defined timeout or until the deployment gets to a specific condition.

func (*Builder) WaitUntilDeleted

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

WaitUntilDeleted waits for the duration of the defined timeout or until the deployment is deleted.

func (*Builder) WithAdditionalContainerSpecs

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

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

func (*Builder) WithAffinity

func (builder *Builder) WithAffinity(affinity *corev1.Affinity) *Builder

WithAffinity applies Affinity to the deployment definition.

func (*Builder) WithHostNetwork

func (builder *Builder) WithHostNetwork(enableHostnetwork bool) *Builder

WithHostNetwork applies a hostnetwork state to the deployment definition.

func (*Builder) WithHugePages

func (builder *Builder) WithHugePages() *Builder

WithHugePages sets hugePages on all containers inside the deployment.

func (*Builder) WithLabel

func (builder *Builder) WithLabel(labelKey, labelValue string) *Builder

WithLabel applies label to deployment's definition.

func (*Builder) WithNodeSelector

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

WithNodeSelector applies a nodeSelector to the deployment definition.

func (*Builder) WithOptions

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

WithOptions creates deployment with generic mutation options.

func (*Builder) WithReplicas

func (builder *Builder) WithReplicas(replicas int32) *Builder

WithReplicas sets the desired number of replicas in the deployment definition.

func (*Builder) WithSchedulerName

func (builder *Builder) WithSchedulerName(schedulerName string) *Builder

WithSchedulerName configures a scheduler to process pod's scheduling.

func (*Builder) WithSecondaryNetwork

func (builder *Builder) WithSecondaryNetwork(networks []*multus.NetworkSelectionElement) *Builder

WithSecondaryNetwork applies Multus secondary network configuration on deployment definition.

func (*Builder) WithSecurityContext

func (builder *Builder) WithSecurityContext(securityContext *corev1.PodSecurityContext) *Builder

WithSecurityContext sets SecurityContext on deployment definition.

func (*Builder) WithServiceAccountName

func (builder *Builder) WithServiceAccountName(serviceAccountName string) *Builder

WithServiceAccountName sets the ServiceAccountName on deployment definition.

func (*Builder) WithToleration

func (builder *Builder) WithToleration(toleration corev1.Toleration) *Builder

WithToleration applies a toleration to the deployment's definition.

func (*Builder) WithVolume

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

WithVolume attaches given volume to the deployment.

Jump to

Keyboard shortcuts

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