Documentation ¶
Index ¶
Constants ¶
const ( PodInteractionTimestampLabel = "box.com/podInitialInteractionTimestamp" PodInteractorLabel = "box.com/podInteractorUsername" PodTTLDurationLabel = "box.com/podTTLDuration" )
These labels are set when a Pod interaction occurs and not supposed to change after.
const ( PodExtendDurationAnnotate = "box.com/podExtendedDuration" PodExtendRequesterAnnotate = "box.com/podExtensionRequester" PodTerminationTimeAnnotate = "box.com/podTerminationTime" )
These annotations are set when requesting extended termination time to an interacted Pod.
Variables ¶
var ( PodInteractionCh chan PodInteraction PodExtensionUpdateCh chan PodExtensionUpdate )
Channels for handling new Pod interactions and their extension updates.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller ensures that interacted Pods are in the desired state.
func NewController ¶
func NewController(kubeClient kubernetes.Interface, ttlSeconds int) Controller
NewController creates a new Controller with all required components set.
func (*Controller) CheckPodExtensionUpdate ¶
func (c *Controller) CheckPodExtensionUpdate()
CheckPodExtensionUpdate checks Pod extension update received from the channel.
func (*Controller) CheckPodInteraction ¶
func (c *Controller) CheckPodInteraction()
CheckPodInteraction checks both previously existed Pod interactions at startup and all new interactions received from the channel with exponential backoff.
type PodExtensionUpdate ¶
PodExtensionUpdate contains an updated Pod object and a username who requests the update.
type PodInteraction ¶
type PodInteraction struct { PodName string PodNamespace string ContainerName string Username string Commands []string InitTime time.Time }
PodInteraction contains information about a Pod interaction occurrence.
func (*PodInteraction) MarshalLogObject ¶
func (pi *PodInteraction) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject makes PodInteraction struct loggable.