deployment

package
v1.0.5-2 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetName

func GetName(instanceName string, suffix ...string) string

Types

type Deployment

type Deployment struct {
	*v1.Deployment
}

func New

func New(deployment *v1.Deployment) *Deployment

func (*Deployment) AddContainer

func (d *Deployment) AddContainer(add container.Container)

func (*Deployment) AddInitContainer

func (d *Deployment) AddInitContainer(add container.Container)

func (*Deployment) AppendConfigMapVolumeIfMissing

func (d *Deployment) AppendConfigMapVolumeIfMissing(name, localObjReferenceName string)

func (*Deployment) AppendEmptyDirVolumeIfMissing

func (d *Deployment) AppendEmptyDirVolumeIfMissing(name string, storageMedium corev1.StorageMedium)

func (*Deployment) AppendHostPathVolumeIfMissing

func (d *Deployment) AppendHostPathVolumeIfMissing(name, hostPath string, hostPathType corev1.HostPathType)

func (*Deployment) AppendPVCVolumeIfMissing

func (d *Deployment) AppendPVCVolumeIfMissing(name, claimName string)

func (*Deployment) AppendPullSecret

func (d *Deployment) AppendPullSecret(imagePullSecret corev1.LocalObjectReference)

func (*Deployment) AppendSecretVolumeIfMissing

func (d *Deployment) AppendSecretVolumeIfMissing(name, secretName string)

func (*Deployment) AppendVolumeIfMissing

func (d *Deployment) AppendVolumeIfMissing(volume corev1.Volume)

func (*Deployment) ContainerExists

func (d *Deployment) ContainerExists(name string) bool

func (*Deployment) ContainerNames

func (d *Deployment) ContainerNames() []string

func (*Deployment) GetContainer

func (d *Deployment) GetContainer(name string) (cont container.Container, err error)

func (*Deployment) GetContainers

func (d *Deployment) GetContainers() map[string]container.Container

func (*Deployment) MustGetContainer

func (d *Deployment) MustGetContainer(name string) container.Container

func (*Deployment) RemoveContainer

func (d *Deployment) RemoveContainer(name string)

func (*Deployment) SetAffinity

func (d *Deployment) SetAffinity(affinity *corev1.Affinity)

func (*Deployment) SetImagePullSecrets

func (d *Deployment) SetImagePullSecrets(pullSecrets []string)

func (*Deployment) SetReplicas

func (d *Deployment) SetReplicas(replicas *int32)

func (*Deployment) SetServiceAccountName

func (d *Deployment) SetServiceAccountName(name string)

func (*Deployment) SetStrategy

func (d *Deployment) SetStrategy(strategyType appsv1.DeploymentStrategyType)

func (*Deployment) UpdateContainer

func (d *Deployment) UpdateContainer(update container.Container)

func (*Deployment) UpdateInitContainer

func (d *Deployment) UpdateInitContainer(update container.Container)

func (*Deployment) UpdateSecurityContextForAllContainers

func (d *Deployment) UpdateSecurityContextForAllContainers(sc container.SecurityContext)

UpdateSecurityContextForAllContainers updates the security context for all containers defined in the deployment

type Manager

type Manager struct {
	Client            k8sclient.Client
	Scheme            *runtime.Scheme
	DeploymentFile    string
	IgnoreDifferences []string
	Name              string

	LabelsFunc   func(v1.Object) map[string]string
	OverrideFunc func(v1.Object, *appsv1.Deployment, resources.Action) error
}

func (*Manager) BasedOnCR

func (m *Manager) BasedOnCR(instance v1.Object, deployment *appsv1.Deployment) (*appsv1.Deployment, error)

func (*Manager) CheckForSecretChange

func (m *Manager) CheckForSecretChange(instance v1.Object, secretName string, restartFunc func(string, *appsv1.Deployment) bool) error

func (*Manager) CheckState

func (m *Manager) CheckState(instance v1.Object) error

func (*Manager) Delete

func (m *Manager) Delete(instance v1.Object) error

func (*Manager) DeploymentIsUpToDate

func (m *Manager) DeploymentIsUpToDate(instance v1.Object) bool

func (*Manager) DeploymentStatus

func (m *Manager) DeploymentStatus(instance v1.Object) (appsv1.DeploymentStatus, error)

func (*Manager) Exists

func (m *Manager) Exists(instance v1.Object) bool

func (*Manager) Get

func (m *Manager) Get(instance v1.Object) (client.Object, error)

func (*Manager) GetDeploymentBasedOnCRFromFile

func (m *Manager) GetDeploymentBasedOnCRFromFile(instance v1.Object) (*appsv1.Deployment, error)

func (*Manager) GetName

func (m *Manager) GetName(instance v1.Object) string

func (*Manager) GetScheme

func (m *Manager) GetScheme() *runtime.Scheme

func (*Manager) Reconcile

func (m *Manager) Reconcile(instance v1.Object, update bool) error

func (*Manager) RestoreState

func (m *Manager) RestoreState(instance v1.Object) error

func (*Manager) SetCustomName

func (m *Manager) SetCustomName(name string)

Jump to

Keyboard shortcuts

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