Skip to content

Commit

Permalink
Merge pull request #16009 from voriol/master
Browse files Browse the repository at this point in the history
 If specified, posts event data to URL upon instance interruption action.
  • Loading branch information
k8s-ci-robot authored Feb 13, 2024
2 parents b8603a2 + f1bc9a4 commit 5a3b1e2
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ spec:
enableSQSTerminationDraining: true
managedASGTag: "aws-node-termination-handler/managed"
prometheusEnable: true
webhookURL: "https://hooks.slack.com/services/YOUR/SLACK/URL"
```

##### Queue Processor Mode
Expand Down
2 changes: 2 additions & 0 deletions docs/releases/1.29-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ have a security group attached. These security groups are used for security grou
allowing incoming traffic to the NLBs as well as traffic between the NLBs and their target
instances.

* Posts event data to URL upon instance interruption action in aws-node-termination-handler with `WEBHOOK_URL`.

## GCP

* As of Kubernetes version 1.29, credentials for private GCR/AR repositories will be handled by the out-of-tree credential provider. This is an additional binary that each instance downloads from the assets repository.
Expand Down
4 changes: 4 additions & 0 deletions k8s/crds/kops.k8s.io_clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5857,6 +5857,10 @@ spec:
version:
description: Version is the container image tag used.
type: string
webhookURL:
description: If specified, posts event data to URL upon instance
interruption action.
type: string
type: object
nonMasqueradeCIDR:
description: MasterIPRange string `json:",omitempty"`
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/kops/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,9 @@ type NodeTerminationHandlerSpec struct {
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
// Version is the container image tag used.
Version *string `json:"version,omitempty"`

// If specified, posts event data to URL upon instance interruption action.
WebhookURL *string `json:"webhookURL,omitempty"`
}

func (n *NodeTerminationHandlerSpec) IsQueueMode() bool {
Expand Down
3 changes: 3 additions & 0 deletions pkg/apis/kops/v1alpha2/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,9 @@ type NodeTerminationHandlerSpec struct {
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
// Version is the container image tag used.
Version *string `json:"version,omitempty"`

// If specified, posts event data to URL upon instance interruption action.
WebhookURL *string `json:"webhookURL,omitempty"`
}

// NodeProblemDetector determines the node problem detector configuration.
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions pkg/apis/kops/v1alpha3/componentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,9 @@ type NodeTerminationHandlerSpec struct {
CPURequest *resource.Quantity `json:"cpuRequest,omitempty"`
// Version is the container image tag used.
Version *string `json:"version,omitempty"`

// If specified, posts event data to URL upon instance interruption action.
WebhookURL *string `json:"webhookURL,omitempty"`
}

// NodeProblemDetector determines the node problem detector configuration.
Expand Down
2 changes: 2 additions & 0 deletions pkg/apis/kops/v1alpha3/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/v1alpha3/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/apis/kops/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ spec:
value: "{{ DefaultQueueName }}"
- name: WORKERS
value: "10"
{{ if .WebhookURL }}
- name: WEBHOOK_URL
value: {{ .WebhookURL }}
{{ end }}
ports:
- name: liveness-probe
protocol: TCP
Expand Down

0 comments on commit 5a3b1e2

Please sign in to comment.