I followed this documentation: https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/spot-instances.md
and successfully provisioned An EKS cluster.
I asked kubectl to describe the node and got:
➜ ~ kubectl describe node ip-10-0-1-205.us-east-2.compute.internal
Name: ip-10-0-1-205.us-east-2.compute.internal
Roles: <none>
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/instance-type=t2.medium
beta.kubernetes.io/os=linux
failure-domain.beta.kubernetes.io/region=us-east-2
failure-domain.beta.kubernetes.io/zone=us-east-2a
kubernetes.io/arch=amd64
kubernetes.io/hostname=ip-10-0-1-205.us-east-2.compute.internal
kubernetes.io/os=linux
node.kubernetes.io/instance-type=t2.medium
node.kubernetes.io/lifecycle=spot
prefer=bot
topology.kubernetes.io/region=us-east-2
topology.kubernetes.io/zone=us-east-2a
Annotations: node.alpha.kubernetes.io/ttl: 0
volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp: Sun, 06 Dec 2020 18:09:26 +0200
Taints: <none>
Unschedulable: false
Lease:
HolderIdentity: ip-10-0-1-205.us-east-2.compute.internal
AcquireTime: <unset>
RenewTime: Sun, 06 Dec 2020 21:03:06 +0200
Conditions:
Type Status LastHeartbeatTime LastTransitionTime Reason Message
---- ------ ----------------- ------------------ ------ -------
MemoryPressure False Sun, 06 Dec 2020 20:59:07 +0200 Sun, 06 Dec 2020 18:09:25 +0200 KubeletHasSufficientMemory kubelet has sufficient memory available
DiskPressure False Sun, 06 Dec 2020 20:59:07 +0200 Sun, 06 Dec 2020 18:09:25 +0200 KubeletHasNoDiskPressure kubelet has no disk pressure
PIDPressure False Sun, 06 Dec 2020 20:59:07 +0200 Sun, 06 Dec 2020 18:09:25 +0200 KubeletHasSufficientPID kubelet has sufficient PID available
Ready True Sun, 06 Dec 2020 20:59:07 +0200 Sun, 06 Dec 2020 18:09:56 +0200 KubeletReady kubelet is posting ready status
Addresses:
InternalIP: 10.0.1.205
Hostname: ip-10-0-1-205.us-east-2.compute.internal
InternalDNS: ip-10-0-1-205.us-east-2.compute.internal
Capacity:
attachable-volumes-aws-ebs: 39
cpu: 2
ephemeral-storage: 104845292Ki
hugepages-2Mi: 0
memory: 4037584Ki
pods: 17
Allocatable:
attachable-volumes-aws-ebs: 39
cpu: 1930m
ephemeral-storage: 95551679124
hugepages-2Mi: 0
memory: 3482576Ki
pods: 17
System Info:
Machine ID: 4283642d849e48e7ac935e6a6574599a
System UUID: EC22BB5A-0463-5D55-ECDD-49865E6294F9
Boot ID: b568afc1-96f2-4669-895e-b3586b7758df
Kernel Version: 4.14.203-156.332.amzn2.x86_64
OS Image: Amazon Linux 2
Operating System: linux
Architecture: amd64
Container Runtime Version: docker://19.3.6
Kubelet Version: v1.18.9-eks-d1db3c
Kube-Proxy Version: v1.18.9-eks-d1db3c
ProviderID: aws:///us-east-2a/i-045333340f54ac375
Non-terminated Pods: (5 in total)
Namespace Name CPU Requests CPU Limits Memory Requests Memory Limits AGE
--------- ---- ------------ ---------- --------------- ------------- ---
kube-system aws-node-9bp6w 10m (0%) 0 (0%) 0 (0%) 0 (0%) 173m
kube-system kube-proxy-52l4m 100m (5%) 0 (0%) 0 (0%) 0 (0%) 173m
monitoring prometheus-kube-prometheus-operator-576f4bf45b-wgz5v 0 (0%) 0 (0%) 0 (0%) 0 (0%) 166m
monitoring prometheus-prometheus-node-exporter-tnh6h 0 (0%) 0 (0%) 0 (0%) 0 (0%) 166m
wielder-services bot-b5f557cc-d7b74 1600m (82%) 0 (0%) 1600Mi (47%) 0 (0%) 155m
Allocated resources:
(Total limits may be over 100 percent, i.e., overcommitted.)
Resource Requests Limits
-------- -------- ------
cpu 1710m (88%) 0 (0%)
memory 1600Mi (47%) 0 (0%)
ephemeral-storage 0 (0%) 0 (0%)
hugepages-2Mi 0 (0%) 0 (0%)
attachable-volumes-aws-ebs 0 0
Events: <none>
The Only indication I could detect of the node being a spot instance in this description is the tag I created node.kubernetes.io/lifecycle=spot
In the AWS console looking at the node information I find:
Termination protection Disabled
Lifecycle normal
How do I know for sure I have provisioned a spot instance?
If I haven't provisioned a spot instance how do I go about doing it?
Lifecycle Normal
means on-demand. It would sayLifecycle Spot
for spot. You need to set a bid price in your launch config for spot to be provisioned instead of on-demand – jordanm