Documentation ¶
Index ¶
Constants ¶
View Source
const ( EnvKeyMyPodName = "MY_POD_NAME" EnvKeyMyPodNamespace = "MY_POD_NAMESPACE" )
Variables ¶
This section is empty.
Functions ¶
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ShouldDefer ¶
ShouldDefer finds corresponding DrainerConfig for the POD it's running in and checks if node in current POD is drained yet. If DrainerConfig doesn't exist or doesn't have Drained or Timeout condition, node termination should be deferred.
Current POD name and namespace are picked from environment variables with corresponding keys defined in constants EnvKeyMyPodName & EnvKeyMyPodNamespace. Defining these env variables is most conveniently achieved by utilizing Kubernetes Downward API: https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/
Click to show internal directories.
Click to hide internal directories.