podplacement

package
v0.0.0-...-cba4745 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArchitecturePredicatesConflict                = "ArchAwarePredicatesConflict"
	ImageArchitectureInspectionError              = "ArchAwareInspectionError"
	ArchitectureAwareNodeAffinitySet              = "ArchAwarePredicateSet"
	ArchitectureAwareGatedPodIgnored              = "ArchAwareGatedPodIgnored"
	ArchitectureAwareSchedulingGateAdded          = "ArchAwareSchedGateAdded"
	ArchitectureAwareSchedulingGateRemovalFailure = "ArchAwareSchedGateRemovalFailed"
	ArchitectureAwareSchedulingGateRemovalSuccess = "ArchAwareSchedGateRemovalSuccess"
	NoSupportedArchitecturesFound                 = "NoSupportedArchitecturesFound"

	SchedulingGateAddedMsg              = "Successfully gated with the " + utils.SchedulingGateName + " scheduling gate"
	SchedulingGateRemovalSuccessMsg     = "Successfully removed the " + utils.SchedulingGateName + " scheduling gate"
	SchedulingGateRemovalFailureMsg     = "Failed to remove the scheduling gate \"" + utils.SchedulingGateName + "\""
	ArchitecturePredicatesConflictMsg   = "All the scheduling predicates already include architecture-specific constraints"
	ArchitecturePredicateSetupMsg       = "Set the nodeAffinity for the architecture to "
	ImageArchitectureInspectionErrorMsg = "Failed to retrieve the supported architectures: "
	NoSupportedArchitecturesFoundMsg    = "Pod cannot be scheduled due to incompatible image architectures; container images have no supported architectures in common"
	ArchitectureAwareGatedPodIgnoredMsg = "The gated pod has been modified and is no longer eligible for architecture-aware scheduling"
	ImageInspectionErrorMaxRetriesMsg   = "Failed to retrieve the supported architectures after multiple retries"
)
View Source
const MaxRetryCount = 5

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigSyncerRunnable

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

func NewConfigSyncerRunnable

func NewConfigSyncerRunnable() *ConfigSyncerRunnable

func (*ConfigSyncerRunnable) Start

func (s *ConfigSyncerRunnable) Start(ctx context.Context) error

type GlobalPullSecretSyncer

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

func NewGlobalPullSecretSyncer

func NewGlobalPullSecretSyncer(clientSet *kubernetes.Clientset, namespace, name string) *GlobalPullSecretSyncer

func (*GlobalPullSecretSyncer) Start

func (s *GlobalPullSecretSyncer) Start(ctx context.Context) (err error)

type ICSPSyncer

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

func NewICSPSyncer

func NewICSPSyncer(mgr manager.Manager) *ICSPSyncer

func (*ICSPSyncer) Start

func (s *ICSPSyncer) Start(ctx context.Context) (err error)

type IDMSSyncer

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

func NewIDMSSyncer

func NewIDMSSyncer(mgr manager.Manager) *IDMSSyncer

func (*IDMSSyncer) Start

func (s *IDMSSyncer) Start(ctx context.Context) (err error)

type ITMSSyncer

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

func NewITMSSyncer

func NewITMSSyncer(mgr manager.Manager) *ITMSSyncer

func (*ITMSSyncer) Start

func (s *ITMSSyncer) Start(ctx context.Context) (err error)

type ImageRegistryConfigSyncer

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

func NewImageRegistryConfigSyncer

func NewImageRegistryConfigSyncer(mgr manager.Manager) *ImageRegistryConfigSyncer

func (*ImageRegistryConfigSyncer) Start

func (s *ImageRegistryConfigSyncer) Start(ctx context.Context) (err error)

type Pod

type Pod struct {
	corev1.Pod
	// contains filtered or unexported fields
}

func (*Pod) GetPodImagePullSecrets

func (pod *Pod) GetPodImagePullSecrets() []string

func (*Pod) HasSchedulingGate

func (pod *Pod) HasSchedulingGate() bool

func (*Pod) RemoveSchedulingGate

func (pod *Pod) RemoveSchedulingGate()

func (*Pod) SetNodeAffinityArchRequirement

func (pod *Pod) SetNodeAffinityArchRequirement(pullSecretDataList [][]byte) (bool, error)

SetNodeAffinityArchRequirement wraps the logic to set the nodeAffinity for the pod. It verifies first that no nodeSelector field is set for the kubernetes.io/arch label. Then, it computes the intersection of the architectures supported by the images used by the pod via pod.getArchitecturePredicate. Finally, it initializes the nodeAffinity for the pod and set it to the computed requirement via the pod.setArchNodeAffinity method.

type PodReconciler

type PodReconciler struct {
	client.Client
	Scheme    *runtime.Scheme
	ClientSet *kubernetes.Clientset
	Recorder  record.EventRecorder
}

PodReconciler reconciles a Pod object

func (*PodReconciler) Reconcile

func (r *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. the Pod object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile Reconcile has to watch the pod object if it has the scheduling gate with name SchedulingGateName, inspect the images in the pod spec, update the nodeAffinity accordingly and remove the scheduling gate.

func (*PodReconciler) SetupWithManager

func (r *PodReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type PodSchedulingGateMutatingWebHook

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

PodSchedulingGateMutatingWebHook annotates Pods

func NewPodSchedulingGateMutatingWebHook

func NewPodSchedulingGateMutatingWebHook(client client.Client, clientSet *kubernetes.Clientset,
	scheme *runtime.Scheme, recorder record.EventRecorder, workerPool *ants.MultiPool) *PodSchedulingGateMutatingWebHook

func (*PodSchedulingGateMutatingWebHook) Handle

type RegistryCertificatesSyncer

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

RegistryCertificatesSyncer watches a configmap (openshift-image-registry/image-registry-certificates) and updates the registry certificates accordingly by using the SystemConfigSyncer. The configuration written by the SystemConfigSyncer due to the RegistryCertificatesSyncer is stored in-memory in the SystemConfigSyncer.registryCertTuples (type []system_config.registryCertTuple) and written to disk in the $conf_dir/docker/certs.d directory. In particular, an example of the configuration written by the SystemConfigSyncer due to the RegistryCertificatesSyncer in $conf_dir/docker/certs.d is: $conf_dir/docker/certs.d/registry.redhat.io/ca.crt $conf_dir/docker/certs.d/registry.redhat.io:5000/ca.crt

func NewRegistryCertificatesSyncer

func NewRegistryCertificatesSyncer(clientSet *kubernetes.Clientset, namespace, name string) *RegistryCertificatesSyncer

func (*RegistryCertificatesSyncer) Start

func (s *RegistryCertificatesSyncer) Start(ctx context.Context) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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