Skip to content

Spot-termination-handler app watches EC2 metadata for spot termination

Notifications You must be signed in to change notification settings

wandera/spot-termination-handler

Repository files navigation

Welcome to spot-termination-handler

Docker Docker Pulls

Description

Spot-termination-handler app monitors EC2 spot instance for termination event.

Docker image

wanderadock/spot-termination-handler:latest

Deployment

The suggested deployment method is a DaemonSet running only on spot nodes. Check examples folder.

Configuration

  • POD_NAME - Name of the Pod running the termination handler (itself), source for K8s events (required)
  • NODE_NAME - Node name on which the termination handler is running (required)
  • FORCE - If to force Pod deletion (default: true)
  • DELETE_EMPTY_DIR - If to delete empty dirs (default: true)
  • IGNORE_DAEMONSETS - If to ignore daemonset pods during drain (default: true)
  • GRACE_PERIOD - Grace period (in seconds) given to each pod (default: 120)
  • DEV_MODE - Dev mode for local development (default: false)
  • LOG_LEVEL - Log level (default: DEBUG)

Development environment prerequisites

  • Go >= 1.16
  • Docker (optional)

Prepare environment properties

  • configure NODE_NAME - name of the node that will be drained
    • NODE_NAME=kind-control-plane
  • configure POD_NAME - id of the spot-termination-handler pod
    • POD_NAME=spot-termination-handler

Starting the application

  • build and start app make run