podapp

package
v0.0.0-...-ec09740 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationLowWaterLevel        string = "webhook-demo.com/low-water-level"
	AnnotationHighWaterLevel       string = "webhook-demo.com/high-water-level"
	AnnotationScheduleCompensation string = "webhook-demo.com/schedule-compensation"
	OnDemandNodeLabelKey           string = "node.kubernetes.io/capacity"
	OnDemandValue                  string = "on-demand"
	SpotNodeLabelKey               string = "node.kubernetes.io/capacity"
	SpotValue                      string = "spot"
	PDC                            string = "controller.kubernetes.io/pod-deletion-cost"
)

Variables

This section is empty.

Functions

func GetWaterLevel

func GetWaterLevel(annotations map[string]string, key string) int

func ScheduleCompensation

func ScheduleCompensation(annotations map[string]string, key string) *bool

Types

type MutatingAdmission

type MutatingAdmission struct {
	Decoder admission.Decoder
	Client  *kubernetes.Clientset
}

MutatingAdmission mutates API request if necessary.

func (*MutatingAdmission) GetAnnotationsOfDeployment

func (a *MutatingAdmission) GetAnnotationsOfDeployment(ctx context.Context, pod *corev1.Pod) (*UserStrategy, error)

func (*MutatingAdmission) Handle

Handle yields a response to an AdmissionRequest.

type UserStrategy

type UserStrategy struct {
	LowWaterLevel        int
	HighWaterLevel       int
	ScheduleCompensation *bool
}

type ValidatingAdmission

type ValidatingAdmission struct {
	Decoder admission.Decoder
}

func (*ValidatingAdmission) Handle

Handle implements admission.Handler interface. It yields a response to an AdmissionRequest.

Jump to

Keyboard shortcuts

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