Skip to content

Commit

Permalink
listen scheduled events for all nodes in cluster (#56)
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Paskal <[email protected]>
  • Loading branch information
maksim-paskal authored Jul 31, 2023
1 parent 5a48478 commit d4338e4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ This tool ensures that kubernetes cluster responds appropriately to events that

Based on [Azure Scheduled Events](https://docs.microsoft.com/en-us/azure/virtual-machines/linux/scheduled-events) and [Safely Drain a Node](https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/)

## Create Azure Kubernetes Cluster with Spot Virtual Machines

[Create an AKS cluster](https://learn.microsoft.com/en-us/azure/aks/learn/quick-kubernetes-deploy-cli) and at least one [Azure Spot node pool](https://learn.microsoft.com/en-us/azure/aks/spot-node-pool), [Azure Scheduled Events](https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-terminate-notification#get-terminate-notifications) will automatically enabled for all Spot Virtual Machines in Azure Kubernetes Cluster.
## Create Azure Kubernetes Cluster

<details>
<summary>Create basic AKS cluster with Azure CLI</summary>

```bash
# https://learn.microsoft.com/en-us/azure/aks/learn/quick-kubernetes-deploy-cli

# Azure CLI version is 2.50.0
az --version

Expand All @@ -24,7 +24,7 @@ az group create \
--name test-aks-group-eastus \
--location eastus

# Create aks cluster, with at least one system node
# Create aks cluster, with not spot instances
az aks create \
--resource-group test-aks-group-eastus \
--name MyManagedCluster \
Expand All @@ -50,9 +50,9 @@ az aks nodepool add \
# Get config to connect to cluster
az aks get-credentials \
--resource-group test-aks-group-eastus \
--name MyManagedCluster \
--file=~/.kube/config
--name MyManagedCluster
```

</details>

## Installation
Expand Down
2 changes: 1 addition & 1 deletion charts/aks-node-termination-handler/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
icon: https://helm.sh/img/helm.svg
name: aks-node-termination-handler
version: 1.0.9
version: 1.1.0
description: Gracefully handle Azure Virtual Machines shutdown within Kubernetes
maintainers:
- name: maksim-paskal # Maksim Paskal
Expand Down
6 changes: 4 additions & 2 deletions charts/aks-node-termination-handler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ tolerations:
value: "spot"
effect: "NoSchedule"

nodeSelector:
kubernetes.azure.com/scalesetpriority: spot
nodeSelector: {}
# if you want handle events only from spot instances
# nodeSelector:
# kubernetes.azure.com/scalesetpriority: spot

resources:
limits:
Expand Down

0 comments on commit d4338e4

Please sign in to comment.