Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aws/aws-node-termination-handler
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.13.1
Choose a base ref
...
head repository: aws/aws-node-termination-handler
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 10,001 additions and 24,281 deletions.
  1. +29 −0 .github/ISSUE_TEMPLATE/bug_report.md
  2. +17 −0 .github/ISSUE_TEMPLATE/feature_request.md
  3. +7 −2 .github/PULL_REQUEST_TEMPLATE.md
  4. +13 −0 .github/dependabot.yml
  5. +0 −54 .github/stale.yml
  6. +214 −0 .github/workflows/build-and-test.yaml
  7. +0 −187 .github/workflows/ci.yml
  8. +97 −0 .github/workflows/release.yaml
  9. +49 −0 .github/workflows/stale.yml
  10. +1 −0 .gitignore
  11. +0 −89 .travis.yml
  12. +23 −10 BUILD.md
  13. +4 −0 CODEOWNERS
  14. +9 −8 Dockerfile
  15. +2 −2 Dockerfile.windows
  16. +89 −53 Makefile
  17. +360 −109 README.md
  18. +0 −913 THIRD_PARTY_LICENSES
  19. +108 −0 THIRD_PARTY_LICENSES.md
  20. +126 −143 cmd/node-termination-handler.go
  21. +1 −0 config/helm/aws-node-termination-handler/.helmignore
  22. +15 −12 config/helm/aws-node-termination-handler/Chart.yaml
  23. +160 −143 config/helm/aws-node-termination-handler/README.md
  24. +5 −0 config/helm/aws-node-termination-handler/example-values-imds-linux.yaml
  25. +5 −0 config/helm/aws-node-termination-handler/example-values-imds-windows.yaml
  26. +13 −0 config/helm/aws-node-termination-handler/example-values-queue.yaml
  27. +8 −3 config/helm/aws-node-termination-handler/templates/NOTES.txt
  28. +54 −34 config/helm/aws-node-termination-handler/templates/_helpers.tpl
  29. +5 −0 config/helm/aws-node-termination-handler/templates/clusterrole.yaml
  30. +9 −5 config/helm/aws-node-termination-handler/templates/clusterrolebinding.yaml
  31. +182 −183 config/helm/aws-node-termination-handler/templates/daemonset.linux.yaml
  32. +178 −159 config/helm/aws-node-termination-handler/templates/daemonset.windows.yaml
  33. +192 −157 config/helm/aws-node-termination-handler/templates/deployment.yaml
  34. +14 −0 config/helm/aws-node-termination-handler/templates/pdb.yaml
  35. +18 −18 config/helm/aws-node-termination-handler/templates/podmonitor.yaml
  36. +12 −6 config/helm/aws-node-termination-handler/templates/psp.yaml
  37. +18 −0 config/helm/aws-node-termination-handler/templates/service.yaml
  38. +5 −5 config/helm/aws-node-termination-handler/templates/serviceaccount.yaml
  39. +29 −0 config/helm/aws-node-termination-handler/templates/servicemonitor.yaml
  40. +0 −175 config/helm/aws-node-termination-handler/test.yaml
  41. +221 −130 config/helm/aws-node-termination-handler/values.yaml
  42. +1 −2 config/helm/localstack/templates/deployment.yaml
  43. +1 −1 config/helm/localstack/templates/psp.yaml
  44. +2 −2 config/helm/localstack/values.yaml
  45. +0 −19 config/helm/prometheus-operator/Chart.yaml
  46. +0 −763 config/helm/prometheus-operator/README.md
  47. +0 −4,501 config/helm/prometheus-operator/crds/crd-alertmanager.yaml
  48. +0 −261 config/helm/prometheus-operator/crds/crd-podmonitor.yaml
  49. +0 −6,003 config/helm/prometheus-operator/crds/crd-prometheus.yaml
  50. +0 −92 config/helm/prometheus-operator/crds/crd-prometheusrules.yaml
  51. +0 −460 config/helm/prometheus-operator/crds/crd-servicemonitor.yaml
  52. +0 −4,726 config/helm/prometheus-operator/crds/crd-thanosrulers.yaml
  53. +0 −14 config/helm/prometheus-operator/templates/NOTES.txt
  54. +0 −93 config/helm/prometheus-operator/templates/_helpers.tpl
  55. +0 −49 config/helm/prometheus-operator/templates/prometheus-operator/cleanup-crds.yaml
  56. +0 −79 config/helm/prometheus-operator/templates/prometheus-operator/clusterrole.yaml
  57. +0 −17 config/helm/prometheus-operator/templates/prometheus-operator/clusterrolebinding.yaml
  58. +0 −6 config/helm/prometheus-operator/templates/prometheus-operator/crds.yaml
  59. +0 −142 config/helm/prometheus-operator/templates/prometheus-operator/deployment.yaml
  60. +0 −20 config/helm/prometheus-operator/templates/prometheus-operator/psp-clusterrole.yaml
  61. +0 −17 config/helm/prometheus-operator/templates/prometheus-operator/psp-clusterrolebinding.yaml
  62. +0 −51 config/helm/prometheus-operator/templates/prometheus-operator/psp.yaml
  63. +0 −53 config/helm/prometheus-operator/templates/prometheus-operator/service.yaml
  64. +0 −12 config/helm/prometheus-operator/templates/prometheus-operator/serviceaccount.yaml
  65. +0 −32 config/helm/prometheus-operator/templates/prometheus-operator/servicemonitor.yaml
  66. +0 −2,101 config/helm/prometheus-operator/values.yaml
  67. +1 −1 config/helm/squid/templates/psp.yaml
  68. +1 −2 config/helm/webhook-test-proxy/templates/daemonset.yaml
  69. +1 −1 config/helm/webhook-test-proxy/templates/psp.yaml
  70. +1 −2 config/helm/webhook-test-proxy/templates/regular-pod-test.yaml
  71. +85 −0 docs/cfn-template.yaml
  72. +103 −14 go.mod
  73. +285 −313 go.sum
  74. +182 −57 pkg/config/config.go
  75. +8 −8 pkg/config/config_internal_test.go
  76. +88 −66 pkg/config/config_test.go
  77. +98 −0 pkg/ec2helper/ec2helper.go
  78. +154 −0 pkg/ec2helper/ec2helper_test.go
  79. +51 −18 pkg/ec2metadata/ec2metadata.go
  80. +6 −4 pkg/ec2metadata/ec2metadata_internal_test.go
  81. +197 −33 pkg/ec2metadata/ec2metadata_test.go
  82. +155 −0 pkg/interruptionevent/asg/launch/handler.go
  83. +169 −0 pkg/interruptionevent/draincordon/handler.go
  84. +76 −0 pkg/interruptionevent/internal/common/handler.go
  85. +58 −2 pkg/interruptioneventstore/interruption-event-store.go
  86. +69 −0 pkg/logging/routing-integration_test.go
  87. +36 −0 pkg/logging/routing.go
  88. +100 −0 pkg/logging/routing_test.go
  89. +91 −0 pkg/logging/versioned.go
  90. +103 −0 pkg/monitor/asglifecycle/asg-lifecycle-monitor.go
  91. +99 −0 pkg/monitor/asglifecycle/asg-lifecycle-monitor_internal_test.go
  92. +125 −0 pkg/monitor/asglifecycle/asg-lifecycle-monitor_test.go
  93. +11 −9 pkg/monitor/rebalancerecommendation/rebalance-recommendation-monitor.go
  94. +4 −3 pkg/monitor/rebalancerecommendation/rebalance-recommendation-monitor_internal_test.go
  95. +6 −3 pkg/monitor/rebalancerecommendation/rebalance-recommendation-monitor_test.go
  96. +7 −6 pkg/monitor/scheduledevent/scheduled-event-monitor.go
  97. +25 −31 pkg/monitor/scheduledevent/scheduled-event-monitor_internal_test.go
  98. +21 −10 pkg/monitor/scheduledevent/scheduled-event-monitor_test.go
  99. +11 −9 pkg/monitor/spotitn/spot-itn-monitor.go
  100. +4 −3 pkg/monitor/spotitn/spot-itn-monitor_internal_test.go
  101. +8 −5 pkg/monitor/spotitn/spot-itn-monitor_test.go
  102. +216 −28 pkg/monitor/sqsevent/asg-lifecycle-event.go
  103. +13 −10 pkg/monitor/sqsevent/ec2-state-change-event.go
  104. +13 −10 pkg/monitor/sqsevent/rebalance-recommendation-event.go
  105. +126 −0 pkg/monitor/sqsevent/scheduled-change-event.go
  106. +14 −11 pkg/monitor/sqsevent/spot-itn-event.go
  107. +286 −122 pkg/monitor/sqsevent/sqs-monitor.go
  108. +140 −53 pkg/monitor/sqsevent/sqs-monitor_internal_test.go
  109. +366 −106 pkg/monitor/sqsevent/sqs-monitor_test.go
  110. +49 −0 pkg/monitor/sqsevent/sqs-retryer.go
  111. +116 −0 pkg/monitor/sqsevent/sqs-retryer_test.go
  112. +21 −0 pkg/monitor/types.go
  113. +336 −51 pkg/node/node.go
  114. +58 −59 pkg/node/node_internal_test.go
  115. +298 −96 pkg/node/node_test.go
  116. +122 −32 pkg/observability/k8s-events.go
  117. +157 −45 pkg/observability/opentelemetry.go
  118. +338 −0 pkg/observability/opentelemetry_test.go
  119. +5 −1 pkg/observability/probes.go
  120. +35 −6 pkg/test/aws-mocks.go
  121. +10 −0 pkg/test/helpers.go
  122. +2 −2 pkg/uptime/common.go
  123. +5 −4 pkg/uptime/common_test.go
  124. +12 −6 pkg/webhook/webhook.go
  125. +8 −6 pkg/webhook/webhook_test.go
  126. +4 −9 scripts/build-binaries
  127. +28 −18 scripts/build-docker-images
  128. +0 −28 scripts/draft-release-notes
  129. +5 −0 scripts/ecr-template-for-helm-chart.json
  130. +44 −25 scripts/generate-k8s-yaml
  131. +20 −0 scripts/helm-login
  132. +49 −0 scripts/install-amazon-ecr-credential-helper
  133. +4 −13 scripts/prepare-for-release
  134. +20 −3 scripts/push-docker-images
  135. +51 −0 scripts/push-helm-chart
  136. +16 −0 scripts/sync-catalog-information-for-helm-chart
  137. +0 −31 scripts/sync-readme-to-dockerhub
  138. +0 −162 scripts/sync-to-aws-eks-charts
  139. +22 −9 scripts/upload-resources-to-github
  140. +125 −0 scripts/upload-resources-to-github-windows.ps1
  141. +5 −0 templates/third-party-licenses.tmpl
  142. +509 −0 test/e2e/asg-launch-lifecycle-sqs-test
  143. +138 −0 test/e2e/asg-lifecycle-imds-test
  144. +228 −0 test/e2e/asg-lifecycle-sqs-heartbeat-test
  145. +13 −13 test/e2e/asg-lifecycle-sqs-test
  146. +10 −8 test/e2e/cordon-only-test
  147. +11 −11 test/e2e/ec2-state-change-sqs-test
  148. +125 −0 test/e2e/emit-events-test
  149. +11 −11 test/e2e/imds-v2-test
  150. +19 −18 test/e2e/maintenance-event-cancellation-test
  151. +11 −12 test/e2e/maintenance-event-dry-run-test
  152. +20 −19 test/e2e/maintenance-event-reboot-test
  153. +14 −13 test/e2e/maintenance-event-test
  154. +249 −0 test/e2e/prometheus-metrics-sqs-test
  155. +70 −49 test/e2e/prometheus-metrics-test
  156. +10 −9 test/e2e/rebalance-recommendation-drain-test
  157. +12 −11 test/e2e/rebalance-recommendation-dry-run-test
  158. +166 −0 test/e2e/rebalance-recommendation-sqs-node-not-found-test
  159. +21 −67 test/e2e/rebalance-recommendation-sqs-test
  160. +10 −11 test/e2e/rebalance-recommendation-test
  161. +214 −0 test/e2e/scheduled-change-event-sqs-test
  162. +11 −11 test/e2e/spot-interruption-dry-run-test
  163. +9 −9 test/e2e/spot-interruption-sqs-test
  164. +35 −17 test/e2e/spot-interruption-test
  165. +19 −18 test/e2e/spot-interruption-test-events-on
  166. +15 −14 test/e2e/spot-interruption-test-host-networking-off
  167. +23 −24 test/e2e/webhook-http-proxy-test
  168. +11 −11 test/e2e/webhook-secret-test
  169. +38 −31 test/e2e/webhook-test
  170. +5 −2 test/eks-cluster-test/cluster-spec.yaml
  171. +3 −3 test/eks-cluster-test/provision-cluster
  172. +5 −6 test/eks-cluster-test/run-test
  173. +0 −15 test/go-report-card-test/Dockerfile
  174. +0 −29 test/go-report-card-test/run-report-card-test.sh
  175. +0 −48 test/helm-sync-test/run-helm-sync-test
  176. +20 −22 test/helm/helm-lint
  177. +3 −18 test/helm/validate-chart-versions
  178. +3 −3 test/k8s-compatibility-test/run-k8s-compatibility-test.sh
  179. +27 −17 test/k8s-local-cluster-test/provision-cluster
  180. +32 −11 test/k8s-local-cluster-test/run-test
  181. +0 −9 test/license-test/Dockerfile
  182. +0 −13 test/license-test/gen-license-report.sh
  183. +0 −16 test/license-test/license-config.hcl
  184. +0 −12 test/license-test/run-license-test.sh
  185. +1 −1 test/readme-test/run-readme-spellcheck
  186. +2 −2 test/readme-test/spellcheck-Dockerfile
  187. +2 −2 test/webhook-test-proxy/Dockerfile
  188. +2 −2 test/webhook-test-proxy/Dockerfile.windows
  189. 0 test/webhook-test-proxy/{THIRD_PARTY_LICENSES → THIRD_PARTY_LICENSES.md}
  190. +0 −1 test/webhook-test-proxy/cmd/webhook-test-proxy.go
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A concise description of what the bug is.

**Steps to reproduce**
A step-by-step description on how to reproduce the problem.

**Expected outcome**
A concise description of what you expected to happen.

**Application Logs**
The log output when experiencing the issue.


**Environment**

* NTH App Version:
* NTH Mode (IMDS/Queue processor):
* OS/Arch:
* Kubernetes version:
* Installation method:
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest a feature/enhancement for this project
title: ''
labels: enhancement
assignees: ''

---

**Describe the feature**
A concise description of the feature and desired behavior.

**Is the feature request related to a problem?**
A description of what the problem is. For example: I'm frustrated when [...]

**Describe alternatives you've considered**
A description of any alternative solutions or features you've considered.
9 changes: 7 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Issue #, if available:
**Issue #, if available:**

**Description of changes:**

**How you tested your changes:**
Environment (Linux / Windows):
Kubernetes Version:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: "gomod"
allow:
- dependency-name: "github.com/aws/aws-sdk-go"
- dependency-name: "k8s.io/*"
dependency-type: "direct"
directory: "/"
schedule:
interval: "weekly"
day: "tuesday"
time: "09:00"
timezone: "America/Chicago"
54 changes: 0 additions & 54 deletions .github/stale.yml

This file was deleted.

214 changes: 214 additions & 0 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
name: Build and Test

on:
push:
branches:
- main
tags-ignore:
- "v*.*.*"
pull_request:
workflow_dispatch:
# Run M-F at 2pm CDT
schedule:
- cron: '0 19 * * 1-5'

env:
DEFAULT_GO_VERSION: ^1.22.0
GITHUB_USERNAME: ${{ secrets.EC2_BOT_GITHUB_USERNAME }}
GITHUB_TOKEN: ${{ secrets.EC2_BOT_GITHUB_TOKEN }}
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}

jobs:
fastTests:
name: Fast Test
runs-on: ubuntu-24.04
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Restore go mod cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin/
key: gocache

- name: Unit Tests
run: make unit-test

- name: Lints
run: make spellcheck shellcheck helm-lint

- name: License Check
run: make license-test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Generate K8s YAML
run: make generate-k8s-yaml

golangci:
# this action needs to run in its own job per setup
name: Lint Eastwood
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2

- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}
cache: false

- name: Set up golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=5m
skip-cache: true

buildLinux:
name: Build Linux Binaries
runs-on: ubuntu-24.04
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Restore go mod cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin/
key: gocache

- name: Build Linux Binaries
run: make build-binaries

buildLinuxDocker:
name: Build Linux Docker Images
runs-on: ubuntu-24.04
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}

- name: Restore go mod cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin/
key: gocache

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Build Linux Docker Images
run: make build-docker-images

buildWindows:
name: Build Windows Binaries
strategy:
matrix:
version: [2019, 2022]
runs-on: windows-${{matrix.version}}
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Restore go mod cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin/
key: gocache

- name: Build Windows Binaries
run: |
$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.."
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
refreshenv
choco install make && choco install zip && make build-binaries-windows-${{matrix.version}}
buildWindowsDocker:
name: Build Windows Docker Images
strategy:
matrix:
version: [2019, 2022]
runs-on: windows-${{matrix.version}}
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Restore go mod cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin/
key: gocache

- name: Build Windows Docker Images
run: |
$env:ChocolateyInstall = Convert-Path "$((Get-Command choco).Path)\..\.."
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
refreshenv
choco install make && make build-docker-images-windows-${{matrix.version}}
e2e:
name: E2E Tests
runs-on: ubuntu-24.04
strategy:
matrix:
k8sVersion: ["1.29", "1.30", "1.31", "1.32"]
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ env.DEFAULT_GO_VERSION }}

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Restore go mod cache
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
~/go/bin/
key: gocache

- name: E2E Tests
run: test/k8s-local-cluster-test/run-test -v ${{ matrix.k8sVersion }}
Loading