kops/pkg/nodeidentity
Panagiotis Atmatzidis 31acabf8cd
Add EC2 instance lifecycle label to nodes
When using a "mixed instance policy"[1] instance group spot and onDemand nodes are part of the same
ASG. The ASG handles the percentage of spot vs onDemand instances. There are no annotations, EC2 tags or labels to identify which
instances are onDemand vs spot. There is a field called `InstanceLifecycle` accessible through `EC2.DescribeInstances`.

The field `InstanceLifecycle` is available only in `spot` and
`scheduled` AWS EC2 instance types.

This PR introduces a new label to be attached on AWS EC2 spot nodes.

The label is:

```
node-role.kubernetes.io/spot-worker: "true"
```

or

```
node-role.kubernetes.io/scheduled-worker: "true"
```

[^1]: https://github.com/kubernetes/kops/blob/master/docs/instance_groups.md#mixedinstancepolicy-aws-only
2020-05-15 09:33:37 +03:00
..
aws Add EC2 instance lifecycle label to nodes 2020-05-15 09:33:37 +03:00
do nodeup/pkg/ pkg/ staticcheck 2019-12-31 15:03:39 +08:00
gce Migrates GCE sdk from v0.beta to v1 2020-04-24 10:54:19 -07:00
openstack fixes auth problem in case of openstack kops-controller 2020-04-07 08:11:45 +03:00
BUILD.bazel Fill out kops controller functionality 2019-09-25 12:04:34 -04:00
interfaces.go Add EC2 instance lifecycle label to nodes 2020-05-15 09:33:37 +03:00