staticpod

package
v0.0.0-...-ec00d85 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 30 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteFileAtomic

func WriteFileAtomic(content []byte, filePerms os.FileMode, fullFilename string) error

Types

type Builder

type Builder interface {
	WithEvents(eventRecorder events.Recorder) Builder
	WithVersioning(operandName string, versionRecorder status.VersionGetter) Builder
	WithOperandPodLabelSelector(labelSelector labels.Selector) Builder
	WithRevisionedResources(operandNamespace, staticPodName string, revisionConfigMaps, revisionSecrets []revisioncontroller.RevisionResource) Builder
	WithUnrevisionedCerts(certDir string, certConfigMaps, certSecrets []installer.UnrevisionedResource) Builder
	WithInstaller(command []string) Builder
	WithMinReadyDuration(minReadyDuration time.Duration) Builder
	WithStartupMonitor(enabledStartupMonitor func() (bool, error)) Builder

	// WithCustomInstaller allows mutating the installer pod definition just before
	// the installer pod is created for a revision.
	WithCustomInstaller(command []string, installerPodMutationFunc installer.InstallerPodMutationFunc) Builder
	WithPruning(command []string, staticPodPrefix string) Builder

	// WithPodDisruptionBudgetGuard manages guard pods and high available pod disruption budget
	//
	// optionally pdbUnhealthyPodEvictionPolicy can be set to AlwaysAllow to allows eviction of unhealthy (not ready) pods
	// even if there are no disruptions allowed on a PodDisruptionBudget.
	// This can help to drain/maintain a node and recover without a manual intervention when multiple instances of nodes or pods are misbehaving.
	// Use this with caution, as this option can disrupt perspective pods that have not yet had a chance to become healthy.
	WithPodDisruptionBudgetGuard(operatorNamespace, operatorName, readyzPort, readyzEndpoint string, pdbUnhealthyPodEvictionPolicy *v1.UnhealthyPodEvictionPolicyType, createConditionalFunc func() (bool, bool, error)) Builder
	WithRevisionControllerPrecondition(revisionControllerPrecondition revisioncontroller.PreconditionFunc) Builder
	ToControllers() (manager.ControllerManager, error)
}

Builder allows the caller to construct a set of static pod controllers in pieces

func NewBuilder

func NewBuilder(
	staticPodOperatorClient v1helpers.StaticPodOperatorClient,
	kubeClient kubernetes.Interface,
	kubeInformers v1helpers.KubeInformersForNamespaces,
	configInformers externalversions.SharedInformerFactory,
) Builder

Jump to

Keyboard shortcuts

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