From 7d0bd56c8a2321edc7b021e4daace66fcd370855 Mon Sep 17 00:00:00 2001 From: Sergey Baranov <37897781+skarj@users.noreply.github.com> Date: Mon, 29 Jul 2019 12:05:55 +0300 Subject: [PATCH] Add possibility to set NOTICE_URL environment variable (#15927) Signed-off-by: skarj --- stable/k8s-spot-termination-handler/Chart.yaml | 2 +- stable/k8s-spot-termination-handler/README.md | 1 + stable/k8s-spot-termination-handler/templates/daemonset.yaml | 4 ++++ stable/k8s-spot-termination-handler/values.yaml | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/stable/k8s-spot-termination-handler/Chart.yaml b/stable/k8s-spot-termination-handler/Chart.yaml index 4520457d49..b4a88101e6 100644 --- a/stable/k8s-spot-termination-handler/Chart.yaml +++ b/stable/k8s-spot-termination-handler/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.13.0-1" description: The K8s Spot Termination handler handles draining AWS Spot Instances in response to termination requests. name: k8s-spot-termination-handler -version: 1.4.0 +version: 1.4.1 keywords: - spot - termination diff --git a/stable/k8s-spot-termination-handler/README.md b/stable/k8s-spot-termination-handler/README.md index df56479f29..1549b0b971 100644 --- a/stable/k8s-spot-termination-handler/README.md +++ b/stable/k8s-spot-termination-handler/README.md @@ -29,6 +29,7 @@ Parameter | Description | Default `image.repository` | container image repository | `kubeaws/kube-spot-termination-notice-handler` `image.tag` | container image tag | `1.13.0-1` `image.pullPolicy` | container image pull policy | `IfNotPresent` +`noticeUrl` | the URL of EC2 spot instance termination notice endpoint | `http://169.254.169.254/latest/meta-data/spot/termination-time` `pollInterval` | the interval in seconds between attempts to poll EC2 metadata API for termination events | `"5"` `verbose` | Enable verbose | _not defined_ `slackUrl` | Slack webhook URL to send messages when a termination notice is received | _not defined_ diff --git a/stable/k8s-spot-termination-handler/templates/daemonset.yaml b/stable/k8s-spot-termination-handler/templates/daemonset.yaml index 65c70a3b8c..4dbcfb94ae 100644 --- a/stable/k8s-spot-termination-handler/templates/daemonset.yaml +++ b/stable/k8s-spot-termination-handler/templates/daemonset.yaml @@ -37,6 +37,10 @@ spec: - name: VERBOSE value: {{ . | quote }} {{- end }} + {{- with .Values.noticeUrl }} + - name: NOTICE_URL + value: {{ . | quote }} + {{- end }} {{- if not .Values.enableLogspout }} - name: LOGSPOUT value: "ignore" diff --git a/stable/k8s-spot-termination-handler/values.yaml b/stable/k8s-spot-termination-handler/values.yaml index 2c1e2e947a..6d3d4de63b 100644 --- a/stable/k8s-spot-termination-handler/values.yaml +++ b/stable/k8s-spot-termination-handler/values.yaml @@ -17,6 +17,9 @@ image: tag: 1.13.0-1 pullPolicy: IfNotPresent +# URL of EC2 spot instance termination notice endpoint +noticeUrl: http://169.254.169.254/latest/meta-data/spot/termination-time + # Poll the metadata every pollInterval seconds for termination events: pollInterval: 5