Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with LaunchTemplate and SpotPrice #7049

Closed
fvasco opened this issue May 22, 2019 · 2 comments · Fixed by #7066
Closed

Issue with LaunchTemplate and SpotPrice #7049

fvasco opened this issue May 22, 2019 · 2 comments · Fixed by #7066

Comments

@fvasco
Copy link
Contributor

fvasco commented May 22, 2019

1. What kops version are you running? The command kops version, will display
this information.

Version 1.12.1 (git-e1c317f9c)

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.

Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2", GitCommit:"66049e3b21efe110454d67df4fa62b08ea79a19b", GitTreeState:"clean", BuildDate:"2019-05-16T16:23:09Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.7", GitCommit:"6f482974b76db3f1e0f5d24605a9d1d38fad9a2b", GitTreeState:"clean", BuildDate:"2019-03-25T02:41:57Z", 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?

I wish to lunch a instance group with a single spot instance.

command: kops edit ig devops

apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  creationTimestamp: 2018-01-24T08:18:43Z
  labels:
    kops.k8s.io/cluster: devops.XXX
  name: devops
spec:
  cloudLabels:
    Stack: DevOps
  image: kope.io/k8s-1.12-debian-stretch-amd64-hvm-ebs-2019-05-13
  machineType: t3a.small
  maxPrice: "0.02"
  maxSize: 1
  minSize: 1
  mixedInstancesPolicy:
    instances:
    - t2.small
    - t3.small
    onDemandAboveBase: 0
    spotInstancePools: 1
  nodeLabels:
    group: devops
    kops.k8s.io/instancegroup: devops
  role: Node
  rootVolumeSize: 20
  rootVolumeType: gp2
  subnets:
  - us-east-1a
  - us-east-1c

command: kops update cluster --yes

5. What happened after the commands executed?

It prints Cluster changes have been applied to the cloud.

6. What did you expect to happen?

I run the command kops update cluster, the result is:

Will modify resources:
LaunchTemplate/devops.devops.XXX
SpotPrice                 -> 0.02
LaunchTemplate/devops2.devops.XXX
SpotPrice                 -> 0.035
Must specify --yes to apply change

LaunchTemplate misses of spot max price.

I hope the issue is reproducible, otherwise I will provide further informations.

@rifelpet
Copy link
Member

Just to be clear, is the spot price actually getting set in AWS when you run kops update cluster --yes ? Its only that subsequent kops update cluster commands report a change in the SpotPrice field?

or is Kops not actually setting the value in AWS at all?

@fvasco
Copy link
Contributor Author

fvasco commented May 24, 2019

I created a test ig:

apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  creationTimestamp: 2019-05-24T08:02:18Z
  labels:
    kops.k8s.io/cluster: XXX
  name: test
spec:
  image: kope.io/k8s-1.12-debian-stretch-amd64-hvm-ebs-2019-05-13
  machineType: t2.medium
  maxPrice: "0.01"
  maxSize: 0
  minSize: 0
  mixedInstancesPolicy:
    instances:
    - t2.small
    - t3.small
    onDemandAboveBase: 0
    spotInstancePools: 1
  nodeLabels:
    kops.k8s.io/instancegroup: test
  role: Node
  subnets:
  - us-east-1a
  - us-east-1b
  - us-east-1c
  - us-east-1d
  - us-east-1e
  - us-east-1f

using the commands:

vasco@neon:~ develop+ 1 ± kops create ig test
Using cluster from kubectl context: XXX
vasco@neon:~ develop+ 1m0s ± kops update cluster
Using cluster from kubectl context: XXX
I0524 10:02:33.327822   28125 executor.go:103] Tasks: 0 done / 105 total; 42 can run
I0524 10:02:34.395668   28125 executor.go:103] Tasks: 42 done / 105 total; 27 can run
I0524 10:02:35.317477   28125 executor.go:103] Tasks: 69 done / 105 total; 25 can run
I0524 10:02:37.776116   28125 executor.go:103] Tasks: 94 done / 105 total; 11 can run
I0524 10:02:38.335214   28125 executor.go:103] Tasks: 105 done / 105 total; 0 can run
Will create resources:
AutoscalingGroup/test.XXX
Granularity             1Minute
LaunchTemplate          name:test.XXX
MaxSize                 0
Metrics                 [GroupDesiredCapacity, GroupInServiceInstances, GroupMaxSize, GroupMinSize, GroupPendingInstances, GroupStandbyInstances, GroupTerminatingInstances, GroupTotalInstances]
MinSize                 0
MixedInstanceOverrides  [t2.small, t3.small]
MixedOnDemandAboveBase  0
MixedSpotInstancePools  1
Subnets                 [...]
SuspendProcesses        []
Tags                    {...}
LaunchTemplate/test.XXX
AssociatePublicIP       true
IAMInstanceProfile      name:nodes.XXX id:nodes.XXX
ImageID                 kope.io/k8s-1.12-debian-stretch-amd64-hvm-ebs-2019-05-13
InstanceType            t2.medium
RootVolumeSize          128
RootVolumeType          gp2
SSHKey                  name:...
SecurityGroups          [...]
SpotPrice               0.01
Must specify --yes to apply changes
63% vasco@neon:~ develop+ 14s ± kops update cluster --yes
Using cluster from kubectl context: XXX
I0524 10:03:07.263786   28367 executor.go:103] Tasks: 0 done / 105 total; 42 can run
I0524 10:03:08.547841   28367 executor.go:103] Tasks: 42 done / 105 total; 27 can run
I0524 10:03:09.834882   28367 executor.go:103] Tasks: 69 done / 105 total; 25 can run
I0524 10:03:12.816636   28367 executor.go:103] Tasks: 94 done / 105 total; 11 can run
I0524 10:03:15.260395   28367 executor.go:103] Tasks: 105 done / 105 total; 0 can run
I0524 10:03:15.260461   28367 dns.go:153] Pre-creating DNS records
I0524 10:03:16.797814   28367 update_cluster.go:291] Exporting kubecfg for cluster
kops has set your kubectl context to XXX
Cluster changes have been applied to the cloud.
Changes may require instances to restart: kops rolling-update cluster
78% vasco@neon:~ develop+ 23s ± kops update cluster
Using cluster from kubectl context: XXX
I0524 10:03:30.905066   28531 executor.go:103] Tasks: 0 done / 105 total; 42 can run
I0524 10:03:32.259233   28531 executor.go:103] Tasks: 42 done / 105 total; 27 can run
I0524 10:03:33.301505   28531 executor.go:103] Tasks: 69 done / 105 total; 25 can run
I0524 10:03:36.481253   28531 executor.go:103] Tasks: 94 done / 105 total; 11 can run
I0524 10:03:37.497587   28531 executor.go:103] Tasks: 105 done / 105 total; 0 can run
Will modify resources:
LaunchTemplate/test.XXX
SpotPrice                 -> 0.01
Must specify --yes to apply changes

The "Adavanced details" of "Launch Template" are:

EC2 Dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants