-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsimple-windows-spot-nodes.yaml
77 lines (68 loc) · 3.42 KB
/
simple-windows-spot-nodes.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: simplewinspot
region: us-east-1
version: "1.23"
iam:
withOIDC: true
vpc:
# When we don't put in any subnet data, EKSCTL will create a new VPC and subnets automatically
clusterEndpoints:
publicAccess: true
privateAccess: true
nodeGroups:
# eksctl create nodegroup --config-file=./simple-windows-spot-nodes.yaml --include "windows-2019-spot-ue1a-v1"
# eksctl delete nodegroup --config-file=./simple-windows-spot-nodes.yaml --include "windows-2019-spot-ue1a-v1"
# Windows Spot Nodes, Volume Encryption and Root Volume Size 100GB
- name: windows-2019-spot-ue1a-v1
# Items for this node group only
availabilityZones: ["us-east-1a"]
# Items for the primary on-demand instances
<<: &primarySpotInstanceConfiguration
# Windows container uses this AMI family, note 2022 exists also if needed
amiFamily: WindowsServer2019FullContainer
labels:
role: windows
os-release: WindowsServer2019Datacenter
instance-type: spot
spot: "true"
minSize: 1
desiredCapacity: 1
maxSize: 10
instancesDistribution:
# This maxPrice should be (imho) just above the most expensive hourly on-demand cost for the below instanceTypes. Ref: http://ec2instances.info
# NOTE: Windows pricing is different than Linux! So this Windows one must be adjusted accordingly!!!
instanceTypes: ["t3.xlarge", "t3a.xlarge", "m5a.xlarge", "m6a.xlarge"] # 16GB - 4 CPU - 35 pods max
maxPrice: 0.34
onDemandBaseCapacity: 0
onDemandPercentageAboveBaseCapacity: 0
spotAllocationStrategy: price-capacity-optimized # New feature in EKS and in EKSCTL as of release 0.124
privateNetworking: true
volumeSize: 100
volumeEncrypted: true
asgSuspendProcesses:
- AZRebalance # This makes sure we don't kill instances for rebalancing, bad practice in Kubernetes, although because we use one az-per asg shouldn't matter. But specify this just incase
tags:
k8s.io/cluster-autoscaler/node-template/label/lifecycle: Ec2Spot
k8s.io/cluster-autoscaler/node-template/label/aws.amazon.com/spot: "true"
k8s.io/cluster-autoscaler/enabled: "true"
k8s.io/cluster-autoscaler/simplewinspot: "true"
kubernetes.io/cluster/simplewinspot: "owned"
iam:
attachPolicyARNs:
# These first two are required and are defined by default, but you must put them here
- arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy # Two foundationally required for EKS to function
- arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy # Two foundationally required for EKS to function
- arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly # Required to pull containers with zero additional effort/secrets
# eksctl create nodegroup --config-file=./simple-windows-spot-nodes.yaml --include "primary-on-demand-ue1b-v1"
# eksctl delete nodegroup --config-file=./simple-windows-spot-nodes.yaml --include "primary-on-demand-ue1b-v1"
- name: windows-2019-spot-ue1b-v1
# Items for this node group only
availabilityZones: ["us-east-1b"]
# Import all defaults from above
<<: *primarySpotInstanceConfiguration
# Valid entries are: "api", "audit", "authenticator", "controllerManager", "scheduler", "all", "*".
cloudWatch:
clusterLogging:
enableTypes: ["api", "authenticator"]