Skip to content

Commit 819f5b2

Browse files
bwagner5jillmon
authored andcommitted
Release v1.1.0 (#41)
* add helm chart * test to check if helm chart is up-to-date with eks charts * prepare helm for v1.1.0 release
1 parent 2a16b56 commit 819f5b2

File tree

14 files changed

+495
-1
lines changed

14 files changed

+495
-1
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ matrix:
2323
if: type = push AND branch = master AND env(GITHUB_TOKEN) IS present
2424
script: test/license-test/run-license-test.sh
2525
env: LICENSE_TEST=true
26+
- stage: Test
27+
script: make helm-sync-test
28+
env: HELM_SYNC_TEST=true
2629
- stage: Deploy
2730
if: type = push AND tag =~ /^v\d+\.\d+(\.\d+)?(-\S*)?$/ AND env(DOCKER_USERNAME) IS present
2831
script: make docker-build && make docker-push

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,7 @@ license-test:
4141
go-report-card-test:
4242
test/go-report-card-test/run-report-card-test.sh
4343

44-
test: e2e-test compatibility-test license-test go-report-card-test
44+
helm-sync-test:
45+
test/helm-sync-test/run-helm-sync-test
46+
47+
test: e2e-test compatibility-test license-test go-report-card-test helm-sync-test
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj
22+
.vscode/
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: v1
2+
name: aws-node-termination-handler
3+
description: A Helm chart for the AWS Node Termination Handler
4+
version: 0.4.0
5+
appVersion: 1.1.0
6+
home: https://github.com/aws/eks-charts
7+
icon: https://raw.githubusercontent.com/aws/eks-charts/master/docs/logo/aws.png
8+
sources:
9+
- https://github.com/aws/eks-charts
10+
maintainers:
11+
- name: Nicholas Turner
12+
url: https://github.com/nckturner
13+
14+
- name: Stefan Prodan
15+
url: https://github.com/stefanprodan
16+
17+
- name: Jillian Montalvo
18+
url: https://github.com/jillmon
19+
20+
- name: Matthew Becker
21+
url: https://github.com/mattrandallbecker
22+
23+
keywords:
24+
- eks
25+
- ec2
26+
- node-termination
27+
- spot
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# AWS Node Termination Handler
2+
3+
AWS Node Termination Handler Helm chart for Kubernetes. For more information on this project see the project repo at https://github.com/aws/aws-node-termination-handler.
4+
5+
## Prerequisites
6+
7+
* Kubernetes >= 1.11
8+
9+
## Installing the Chart
10+
11+
Add the EKS repository to Helm:
12+
```sh
13+
helm repo add eks https://aws.github.io/eks-charts
14+
```
15+
Install AWS Node Termination Handler:
16+
To install the chart with the release name aws-node-termination-handler and default configuration:
17+
18+
```sh
19+
helm install --name aws-node-termination-handler \
20+
--namespace kube-system eks/aws-node-termination-handler
21+
```
22+
23+
To install into an EKS cluster where the Node Termination Handler is already installed, you can run:
24+
25+
```sh
26+
helm upgrade --install --recreate-pods --force \
27+
aws-node-termination-handler --namespace kube-system eks/aws-node-termination-handler
28+
```
29+
30+
If you receive an error similar to `Error: release aws-node-termination-handler
31+
failed: <resource> "aws-node-termination-handler" already exists`, simply rerun
32+
the above command.
33+
34+
The [configuration](#configuration) section lists the parameters that can be configured during installation.
35+
36+
## Uninstalling the Chart
37+
38+
To uninstall/delete the `aws-node-termination-handler` deployment:
39+
40+
```sh
41+
helm delete --purge aws-node-termination-handler
42+
```
43+
44+
The command removes all the Kubernetes components associated with the chart and deletes the release.
45+
46+
## Configuration
47+
48+
The following tables lists the configurable parameters of the chart and their default values.
49+
50+
Parameter | Description | Default
51+
--- | --- | ---
52+
`image.repository` | image repository | `amazon/aws-node-termination-handler`
53+
`image.tag` | image tag | `<VERSION>`
54+
`image.pullPolicy` | image pull policy | `IfNotPresent`
55+
`deleteLocalData` | Tells kubectl to continue even if there are pods using emptyDir (local data that will be deleted when the node is drained). | `false`
56+
`gracePeriod` | (DEPRECATED: Renamed to podTerminationGracePeriod) The time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used. | `30`
57+
`podTerminationGracePeriod` | The time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used. | `30`
58+
`nodeTerminationGracePeriod` | Period of time in seconds given to each NODE to terminate gracefully. Node draining will be scheduled based on this value to optimize the amount of compute time, but still safely drain the node before an event. | `120`
59+
`ignoreDaemonsSets` | Causes kubectl to skip daemon set managed pods | `true`
60+
`instanceMetadataURL` | The URL of EC2 instance metadata. This shouldn't need to be changed unless you are testing. | `http://169.254.169.254:80`
61+
`affinity` | node/pod affinities | None
62+
`podSecurityContext` | Pod Security Context | `{}`
63+
`podAnnotations` | annotations to add to each pod | `{}`
64+
`priorityClassName` | Name of the priorityClass | `system-node-critical`
65+
`resources` | Resources for the pods | `requests.cpu: 50m, requests.memory: 64Mi, limits.cpu: 100m, limits.memory: 128Mi`
66+
`securityContext` | Container Security context | `privileged: true`
67+
`nodeSelector` | Tells the daemon set where to place the node-termination-handler pods. For example: `lifecycle: "Ec2Spot"`, `on-demand: "false"`, `aws.amazon.com/purchaseType: "spot"`, etc. Value must be a valid yaml expression. | `{}`
68+
`tolerations` | list of node taints to tolerate | `[]`
69+
`rbac.create` | if `true`, create and use RBAC resources | `true`
70+
`rbac.pspEnabled` | If `true`, create and use a restricted pod security policy | `false`
71+
`serviceAccount.create` | If `true`, create a new service account | `true`
72+
`serviceAccount.name` | Service account to be used | None
73+
`serviceAccount.annotations` | Specifies the annotations for ServiceAccount | `{}`
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{ .Release.Name }} has been installed or updated. To check the status of pods, run:
2+
3+
kubectl get pods --namespace {{ .Values.namespace }}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{{/* vim: set filetype=mustache: */}}
2+
{{/*
3+
Expand the name of the chart.
4+
*/}}
5+
{{- define "aws-node-termination-handler.name" -}}
6+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
8+
9+
{{/*
10+
Create a default fully qualified app name.
11+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
12+
If release name contains chart name it will be used as a full name.
13+
*/}}
14+
{{- define "aws-node-termination-handler.fullname" -}}
15+
{{- if .Values.fullnameOverride -}}
16+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
17+
{{- else -}}
18+
{{- $name := default .Chart.Name .Values.nameOverride -}}
19+
{{- if contains $name .Release.Name -}}
20+
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
21+
{{- else -}}
22+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
23+
{{- end -}}
24+
{{- end -}}
25+
{{- end -}}
26+
27+
{{/*
28+
Common labels
29+
*/}}
30+
{{- define "aws-node-termination-handler.labels" -}}
31+
app.kubernetes.io/name: {{ include "aws-node-termination-handler.name" . }}
32+
helm.sh/chart: {{ include "aws-node-termination-handler.chart" . }}
33+
app.kubernetes.io/instance: {{ .Release.Name }}
34+
k8s-app: aws-node-termination-handler
35+
{{- if .Chart.AppVersion }}
36+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
37+
{{- end }}
38+
app.kubernetes.io/managed-by: {{ .Release.Service }}
39+
{{- end -}}
40+
41+
{{/*
42+
Create chart name and version as used by the chart label.
43+
*/}}
44+
{{- define "aws-node-termination-handler.chart" -}}
45+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
46+
{{- end -}}
47+
48+
{{/*
49+
Create the name of the service account to use
50+
*/}}
51+
{{- define "aws-node-termination-handler.serviceAccountName" -}}
52+
{{- if .Values.serviceAccount.create -}}
53+
{{ default (include "aws-node-termination-handler.fullname" .) .Values.serviceAccount.name }}
54+
{{- else -}}
55+
{{ default "default" .Values.serviceAccount.name }}
56+
{{- end -}}
57+
{{- end -}}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
kind: ClusterRole
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
metadata:
4+
name: {{ include "aws-node-termination-handler.fullname" . }}
5+
rules:
6+
- apiGroups:
7+
- ""
8+
resources:
9+
- nodes
10+
verbs:
11+
- get
12+
- patch
13+
- update
14+
- apiGroups:
15+
- ""
16+
resources:
17+
- pods
18+
verbs:
19+
- list
20+
- apiGroups:
21+
- ""
22+
resources:
23+
- pods/eviction
24+
verbs:
25+
- create
26+
- apiGroups:
27+
- extensions
28+
resources:
29+
- replicasets
30+
- daemonsets
31+
verbs:
32+
- get
33+
- apiGroups:
34+
- apps
35+
resources:
36+
- daemonsets
37+
verbs:
38+
- get
39+
- delete
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
kind: ClusterRoleBinding
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
metadata:
4+
name: {{ include "aws-node-termination-handler.fullname" . }}
5+
subjects:
6+
- kind: ServiceAccount
7+
name: {{ template "aws-node-termination-handler.serviceAccountName" . }}
8+
namespace: {{ .Release.Namespace }}
9+
roleRef:
10+
kind: ClusterRole
11+
name: {{ include "aws-node-termination-handler.fullname" . }}
12+
apiGroup: rbac.authorization.k8s.io
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: {{ include "aws-node-termination-handler.fullname" . }}
5+
labels:
6+
{{ include "aws-node-termination-handler.labels" . | indent 4 }}
7+
spec:
8+
updateStrategy:
9+
{{ toYaml .Values.updateStrategy | indent 4 }}
10+
selector:
11+
matchLabels:
12+
app.kubernetes.io/name: {{ include "aws-node-termination-handler.name" . }}
13+
app.kubernetes.io/instance: {{ .Release.Name }}
14+
template:
15+
metadata:
16+
{{- if .Values.podAnnotations }}
17+
annotations:
18+
{{- range $key, $value := .Values.podAnnotations }}
19+
{{ $key }}: {{ $value | quote }}
20+
{{- end }}
21+
{{- end }}
22+
labels:
23+
app.kubernetes.io/name: {{ include "aws-node-termination-handler.name" . }}
24+
app.kubernetes.io/instance: {{ .Release.Name }}
25+
k8s-app: aws-node-termination-handler
26+
spec:
27+
priorityClassName: "{{ .Values.priorityClassName }}"
28+
affinity:
29+
nodeAffinity:
30+
# NOTE(jaypipes): Change when we complete
31+
# https://github.com/aws/aws-node-termination-handler/issues/8
32+
requiredDuringSchedulingIgnoredDuringExecution:
33+
nodeSelectorTerms:
34+
- matchExpressions:
35+
- key: "beta.kubernetes.io/os"
36+
operator: In
37+
values:
38+
- linux
39+
- key: "beta.kubernetes.io/arch"
40+
operator: In
41+
values:
42+
- amd64
43+
serviceAccountName: {{ template "aws-node-termination-handler.serviceAccountName" . }}
44+
containers:
45+
- name: {{ include "aws-node-termination-handler.name" . }}
46+
image: {{ .Values.image.repository}}:{{ .Values.image.tag }}
47+
imagePullPolicy: {{ .Values.image.pullPolicy }}
48+
env:
49+
- name: NODE_NAME
50+
valueFrom:
51+
fieldRef:
52+
fieldPath: spec.nodeName
53+
- name: POD_NAME
54+
valueFrom:
55+
fieldRef:
56+
fieldPath: metadata.name
57+
- name: NAMESPACE
58+
valueFrom:
59+
fieldRef:
60+
fieldPath: metadata.namespace
61+
- name: SPOT_POD_IP
62+
valueFrom:
63+
fieldRef:
64+
fieldPath: status.podIP
65+
- name: DELETE_LOCAL_DATA
66+
value: {{ .Values.deleteLocalData | quote }}
67+
- name: IGNORE_DAEMON_SETS
68+
value: {{ .Values.ignoreDaemonSets | quote }}
69+
- name: GRACE_PERIOD
70+
value: {{ .Values.gracePeriod | quote }}
71+
- name: POD_TERMINATION_GRACE_PERIOD
72+
value: {{ .Values.podTerminationGracePeriod | quote }}
73+
- name: INSTANCE_METADATA_URL
74+
value: {{ .Values.instanceMetadataURL | quote }}
75+
- name: NODE_TERMINATION_GRACE_PERIOD
76+
value: {{ .Values.nodeTerminationGracePeriod | quote }}
77+
resources:
78+
{{- toYaml .Values.resources | nindent 12 }}
79+
securityContext:
80+
{{- toYaml .Values.securityContext | nindent 12 }}
81+
{{- with .Values.nodeSelector }}
82+
nodeSelector:
83+
{{- toYaml . | nindent 8 }}
84+
{{- end }}
85+
{{- with .Values.affinity }}
86+
affinity:
87+
{{- toYaml . | nindent 8 }}
88+
{{- end }}
89+
{{- with .Values.tolerations }}
90+
tolerations:
91+
{{- toYaml . | nindent 8 }}
92+
{{- end }}

0 commit comments

Comments
 (0)