'What is the difference between machineType and mixedInstancesPolicy

Does anybody know when creating InstanceGroup using kops, why we set both machineType and mixedInstancesPolicy? Does machineType means kops will pick machineType by default but if no instance with machineType available it will pick one of the types from mixedInstancesPolicy?

The spec: https://kops.sigs.k8s.io/instance_groups/ shows: "A Mixed Instances Policy utilizing EC2 Spot and the capacity-optimized allocation strategy allows an EC2 Autoscaling Group to select the instance types with the highest capacity. This reduces the chance of a spot interruption on your instance group."

the spec does not show what machineType is and what is the difference of machineType and mixedInstancesPolicy.

apiVersion: kops.k8s.io/v1alpha2
kind: InstanceGroup
...
spec:
  image: kope.io/k8s-1.16-debian-...
  machineType: m5.xlarge
  maxSize: XX
  minSize: XX
  mixedInstancesPolicy:
    instances:
    - m4.xlarge
    - r4.xlarge
    - c4.xlarge


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source