apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: node-termination-handler
spec:
  selector:
    matchLabels:
      app: node-termination-handler
  template:
    spec:
      serviceAccountName: node-termination-handler
      containers:
      - name: node-termination-handler
        image: amazon/aws-node-termination-handler:v1.0.0
        imagePullPolicy: Always
        env:
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: SPOT_POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        resources:
          requests:
            memory: "64Mi"
            cpu: "50m"
          limits:
            memory: "128Mi"
            cpu: "100m"
