profile
viewpoint

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.

kubernetes/kops

Answer questions m0rganic

see https://github.com/kubernetes/kops/blob/1564a6746134935ca0de7ec3815d18f4bb271fb3/pkg/apis/kops/validation/instancegroup.go#L143

useful!

Related questions

Unable to use a local filesystem state store hot 2
Kops 1.12-beta.2 won't/can't bring up etcd server, manager or kube-api hot 1
kube controller manager refuses to connect after upgrading from 1.10.6 to 1.11.7 hot 1
Missing kops controller support for cloudproviders hot 1
InstanceGroup not found (for etcd ap-southeast-2a/main): "ap-southeast-2a" hot 1
Rolling-update fails due to calico-node with 1.12.0-beta.2 hot 1
Kubelet Unable To Apply Reserved Cgroup Limits because Cgroup does not exist hot 1
etcd3 and kube-apiserver fail on terraform apply after terraform destroying w/ kops generated config hot 1
Upgrade from Kops 1.11 to 1.12 has failed. hot 1
Couldn't find key etcd_endpoints in ConfigMap kube-system/calico-config hot 1
Protokube has sustained cpu usage above 100% hot 1
kubectl command: Unable to connect to the server: EOF hot 1
DNS record for public API address not updated hot 1
etcd3 and kube-apiserver fail on terraform apply after terraform destroying w/ kops generated config hot 1
Issues encountered deploying to OpenStack hot 1
source:https://uonfu.com/
Github User Rank List