Documentation ¶
Overview ¶
Package scheduler contains mutating admission controller webhook handlers for setting a pod's scheduler. The handler mutates a given pod if the pod has any volume that's managed by the given volume provisioners in PodSchedulerSetter.Provisioners and the associated scheduler is enabled. The scheduler name is set in PodSchedulerSetter.SchedulerName.
Index ¶
Constants ¶
const ( // PodSchedulerAnnotationKey is the pod annotation key that can be set to // skip pod scheduler name mutation. PodSchedulerAnnotationKey = "storageos.com/scheduler" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PodSchedulerSetter ¶
type PodSchedulerSetter struct { // Provisioners is a list of storage provisioners to check a pod volume // against. Provisioners []string // SchedulerName is the name of the scheduler to mutate pods with. SchedulerName string // SchedulerAnnotationKey is the pod annotation that can be set to skip or // apply the mutation. SchedulerAnnotationKey string client.Client // contains filtered or unexported fields }
PodSchedulerSetter is responsible for mutating and setting pod scheduler name.
func NewPodSchedulerSetter ¶
func NewPodSchedulerSetter(k8s client.Client, scheduler string) *PodSchedulerSetter
NewPodSchedulerSetter returns a new Pod Scheduler mutating admission controller.
func (*PodSchedulerSetter) MutatePod ¶
func (p *PodSchedulerSetter) MutatePod(ctx context.Context, pod *corev1.Pod, namespace string) error
MutatePod mutates a given pod with a configured scheduler name if the pod is associated with volumes managed by the configured provisioners.
Errors returned here may block creation of the Pod, depending on the Webhook configuration.