Documentation ¶
Index ¶
- Constants
- func DidPodHaveServicesTargetTypeIP(ctx context.Context, client client.Client, pod *corev1.Pod) (bool, error)
- func IsPodInDrainingNode(ctx context.Context, client client.Client, pod *corev1.Pod) (bool, error)
- func IsPodReady(pod *corev1.Pod) bool
- type AdmissionResponse
- type DelayedTask
- type DelayedTaskId
- type Delayer
- type EvictionResponse
- type InterceptedAdmissionResponse
- type Interceptor
- type PodDeletionDelayInfo
- type PodGracefulDrain
- type PodGracefulDrainConfig
- type PodMutator
Constants ¶
View Source
const ( GracefulDrainPrefix = "pod-graceful-drain" WaitLabelKey = GracefulDrainPrefix + "/wait" DeleteAtAnnotationKey = GracefulDrainPrefix + "/deleteAt" OriginalLabelsAnnotationKey = GracefulDrainPrefix + "/originalLabels" )
View Source
const (
// Prefix for TargetHealth pod condition type.
TargetHealthPodConditionTypePrefix = "target-health.elbv2.k8s.aws"
)
Variables ¶
This section is empty.
Functions ¶
func IsPodInDrainingNode ¶
func IsPodReady ¶
Types ¶
type AdmissionResponse ¶
func (AdmissionResponse) GetAdmissionResponse ¶
func (r AdmissionResponse) GetAdmissionResponse() admission.Response
type DelayedTask ¶
type DelayedTaskId ¶
type DelayedTaskId int64
type Delayer ¶
type Delayer interface { NewTask(duration time.Duration, task func(context.Context, bool) error) DelayedTask Stop(drain time.Duration, cleanup time.Duration) }
func NewDelayer ¶
type EvictionResponse ¶
type EvictionResponse struct {
Operations []jsonpatch.Operation
}
func NewEvictionResponse ¶
func NewEvictionResponse(eviction *policyv1.Eviction) (EvictionResponse, error)
func (EvictionResponse) GetAdmissionResponse ¶
func (r EvictionResponse) GetAdmissionResponse() admission.Response
type Interceptor ¶
type Interceptor struct {
// contains filtered or unexported fields
}
func NewInterceptor ¶
func NewInterceptor(drain *PodGracefulDrain, k8sClient client.Client) Interceptor
func (*Interceptor) InterceptPodDeletion ¶
func (i *Interceptor) InterceptPodDeletion(ctx context.Context, req *admission.Request, pod *corev1.Pod) (InterceptedAdmissionResponse, error)
func (*Interceptor) InterceptPodEviction ¶
func (i *Interceptor) InterceptPodEviction(ctx context.Context, req *admission.Request, eviction *policyv1.Eviction) (InterceptedAdmissionResponse, error)
type PodDeletionDelayInfo ¶
func GetPodDeletionDelayInfo ¶
func GetPodDeletionDelayInfo(pod *corev1.Pod) (PodDeletionDelayInfo, error)
func (*PodDeletionDelayInfo) GetRemainingTime ¶
func (i *PodDeletionDelayInfo) GetRemainingTime(now time.Time) time.Duration
type PodGracefulDrain ¶
type PodGracefulDrain struct {
// contains filtered or unexported fields
}
func NewPodGracefulDrain ¶
func NewPodGracefulDrain(k8sClient client.Client, logger logr.Logger, config *PodGracefulDrainConfig) PodGracefulDrain
func (*PodGracefulDrain) DelayPodDeletion ¶
func (d *PodGracefulDrain) DelayPodDeletion(ctx context.Context, pod *corev1.Pod) (InterceptedAdmissionResponse, error)
func (*PodGracefulDrain) DelayPodEviction ¶
type PodGracefulDrainConfig ¶
type PodGracefulDrainConfig struct { DeleteAfter time.Duration NoDenyAdmission bool IgnoreError bool }
func (*PodGracefulDrainConfig) BindFlags ¶
func (c *PodGracefulDrainConfig) BindFlags(fs *flag.FlagSet)
func (*PodGracefulDrainConfig) Validate ¶
func (c *PodGracefulDrainConfig) Validate() error
type PodMutator ¶
type PodMutator struct {
// contains filtered or unexported fields
}
func NewPodMutator ¶
func NewPodMutator(client client.Client, pod *corev1.Pod) *PodMutator
func (*PodMutator) DisableWaitLabelAndDelete ¶
func (m *PodMutator) DisableWaitLabelAndDelete(ctx context.Context) error
func (*PodMutator) WithLogger ¶
func (m *PodMutator) WithLogger(logger logr.Logger) *PodMutator
Click to show internal directories.
Click to hide internal directories.