Ask questionsAllow just one instance type in mixedInstancesPolicy
1. What kops version are you running? The command kops version, will display
this information.
$ kops version
Version 1.12.2 (git-3fc9bc486)
2. What Kubernetes version are you running? kubectl version will print the
version if a cluster is running or provide the Kubernetes version specified as
a kops flag.
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.10", GitCommit:"7a578febe155a7366767abce40d8a16795a96371", GitTreeState:"clean", BuildDate:"2019-05-01T04:14:38Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.10", GitCommit:"7a578febe155a7366767abce40d8a16795a96371", GitTreeState:"clean", BuildDate:"2019-05-01T04:05:01Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"}
3. What cloud provider are you using?
AWS
4. What commands did you run? What is the simplest way to reproduce this issue?
given:
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
creationTimestamp: 2019-05-22T20:15:04Z
name: nodes
spec:
additionalSecurityGroups:
- sg-06e162cfc3871dfe2
image: kope.io/k8s-1.11-debian-stretch-amd64-hvm-ebs-2018-08-17
machineType: c5.18xlarge
maxSize: 10
minSize: 4
mixedInstancesPolicy:
instances:
- c5.18xlarge
- c5d.18xlarge
onDemandAboveBase: 80
onDemandBase: 4
role: Node
subnets:
- utility-2a
- utility-2c
$ kops edit ig nodes
apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
creationTimestamp: 2019-05-22T20:15:04Z
name: nodes
spec:
additionalSecurityGroups:
- sg-06e162cfc3871dfe2
image: kope.io/k8s-1.11-debian-stretch-amd64-hvm-ebs-2018-08-17
machineType: c5.18xlarge
maxSize: 10
minSize: 4
mixedInstancesPolicy:
instances:
- c5.18xlarge
onDemandAboveBase: 80
onDemandBase: 4
role: Node
subnets:
- utility-2a
- utility-2c
nodes.instances: Invalid value: []string{"c5.18xlarge"}: must be 2 or more instance types
5. What happened after the commands executed?
got error message preventing just one instance type
nodes.instances: Invalid value: []string{"c5.18xlarge"}: must be 2 or more instance types
6. What did you expect to happen?
Be able to specify just one instance type. The main driver for me to using the spot fleets is to get some guarantee of on-demand instance but ultimately leverage a cheaper price using spots for a percentage of the instance in this group.. but my service needs to run on a specific instance size.
Answer
questions
m0rganic
see https://github.com/kubernetes/kops/blob/1564a6746134935ca0de7ec3815d18f4bb271fb3/pkg/apis/kops/validation/instancegroup.go#L143
Related questions