Documentation
¶
Index ¶
Constants ¶
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 supported architectures to " ArchitecturePreferredPredicateSetupMsg = "Set the architecture preferences in the nodeAffinity" ArchitecturePreferredPredicateSkippedMsg = "The node affinity already includes architecture preferences" 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" )
const MaxRetryCount = 5
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GlobalPullSecretSyncer ¶
type GlobalPullSecretSyncer struct {
// contains filtered or unexported fields
}
func NewGlobalPullSecretSyncer ¶
func NewGlobalPullSecretSyncer(clientSet *kubernetes.Clientset, namespace, name string) *GlobalPullSecretSyncer
type Pod ¶
func (*Pod) HasSchedulingGate ¶
HasSchedulingGate checks if the pod has the scheduling gate utils.SchedulingGateName.
func (*Pod) RemoveSchedulingGate ¶
func (pod *Pod) RemoveSchedulingGate()
RemoveSchedulingGate removes the scheduling gate utils.SchedulingGateName from the pod.
func (*Pod) SetNodeAffinityArchRequirement ¶
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.setRequiredArchNodeAffinity method.
func (*Pod) SetPreferredArchNodeAffinity ¶
func (pod *Pod) SetPreferredArchNodeAffinity(cppc *v1beta1.ClusterPodPlacementConfig)
SetPreferredArchNodeAffinity sets the node affinity for the pod to the preferences given in the ClusterPodPlacementConfig.
type PodReconciler ¶
type PodReconciler struct {
client.Client
Scheme *runtime.Scheme
ClientSet *kubernetes.Clientset
Recorder record.EventRecorder
}
PodReconciler reconciles a Pod object
func (*PodReconciler) Reconcile ¶
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