Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const (
CatalogPriorityClassKey string = "operatorframework.io/priorityclass"
// PodHashLabelKey is the key of a label for podspec hash information
PodHashLabelKey = "olm.pod-spec-hash"
//ClusterAutoscalingAnnotation is the annotation that enables the cluster autoscaler to evict catalog pods
ClusterAutoscalingAnnotationKey string = "cluster-autoscaler.kubernetes.io/safe-to-evict"
)

// RegistryEnsurer describes methods for ensuring a registry exists.
Expand Down Expand Up @@ -216,6 +218,15 @@ func Pod(source *v1alpha1.CatalogSource, name string, image string, saName strin
}
labels[PodHashLabelKey] = hashPodSpec(pod.Spec)
pod.SetLabels(labels)

// add eviction annotation to enable the cluster autoscaler to evict the pod in order to drain the node
// since catalog pods are not backed by a controller, they cannot be evicted by default
if annotations == nil {
annotations = make(map[string]string)
}
annotations[ClusterAutoscalingAnnotationKey] = "true"
pod.SetAnnotations(annotations)

return pod
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.