controller

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ControllerLabelPurposeName  = "cdayz.k8s.extensions/purpose"
	ControllerLabelPurposeValue = "images"

	DaemonSetLabelNodeSelectorHash = "cdayz.k8s.extensions/node-selector-hash"

	FinalizerName = "images.cdayz.k8s.extensions/finalizer"

	PodNamePrefix       = "image-pre-puller-"
	DaemonSetNamePrefix = "image-pre-puller-"
)
View Source
const ControllerAnnotationImageNames = "cdayz.k8s.extensions/image-names"

Variables

View Source
var MaxUnavailablePodsOfDaemonSetDuringRollingUpdate = intstr.FromString("100%")

Functions

func AddImageNameToAnnotation

func AddImageNameToAnnotation(obj metav1.Object, name string) (added bool, err error)

func GetImageNamesFromAnnotation

func GetImageNamesFromAnnotation(obj metav1.Object) ([]string, error)

func MakeAnnotationValue

func MakeAnnotationValue(imageNames []string) (string, error)

func RemoveImageNameFromAnnotation

func RemoveImageNameFromAnnotation(obj metav1.Object, name string) error

Types

type ContainerConfig

type ContainerConfig struct {
	Name      string
	Image     string
	Command   []string
	Args      []string
	Resources corev1.ResourceRequirements
}

type ControllerResult

type ControllerResult struct {
	Requeue      bool
	RequeueAfter time.Duration
}

type PrePullImageController

type PrePullImageController struct {
	// contains filtered or unexported fields
}

func NewPrePullImageController

func NewPrePullImageController(
	kubeClient kubernetes.Interface,
	imClient imclientset.Interface,
	informerFactory informers.SharedInformerFactory,
	workers uint32,
	reconcileConfig *PrePullImageReconcilerConfig,
) *PrePullImageController

func (*PrePullImageController) Reconcile

func (*PrePullImageController) Run

func (cc *PrePullImageController) Run(ctx context.Context)

Run start PrePullImageController.

type PrePullImageReconcilerConfig

type PrePullImageReconcilerConfig struct {
	MainContainer        ContainerConfig
	PrePullContainer     ContainerConfig
	ImagePullSecretNames []string
}

type ReconcileRequest

type ReconcileRequest struct {
	Name      string
	Namespace string

	PodName *string
}

func NewReconcileRequestFromObject

func NewReconcileRequestFromObject(obj metav1.Object) ReconcileRequest

func (*ReconcileRequest) Key

func (n *ReconcileRequest) Key() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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