mirror of https://github.com/kubernetes/kops.git
Add new CPUCredits field to instance group spec
This commit is contained in:
parent
c83d2346a3
commit
bfd3d8a96b
|
|
@ -101,6 +101,10 @@ spec:
|
|||
description: CompressUserData compresses parts of the user data to
|
||||
save space
|
||||
type: boolean
|
||||
cpuCredits:
|
||||
description: CPUCredits is the credit option for CPU Usage on burstable
|
||||
instance types (AWS only)
|
||||
type: string
|
||||
detailedInstanceMonitoring:
|
||||
description: DetailedInstanceMonitoring defines if detailed-monitoring
|
||||
is enabled (AWS only)
|
||||
|
|
|
|||
|
|
@ -129,6 +129,8 @@ type InstanceGroupSpec struct {
|
|||
MaxPrice *string `json:"maxPrice,omitempty"`
|
||||
// SpotDurationInMinutes reserves a spot block for the period specified
|
||||
SpotDurationInMinutes *int64 `json:"spotDurationInMinutes,omitempty"`
|
||||
// CPUCredits is the credit option for CPU Usage on burstable instance types (AWS only)
|
||||
CPUCredits *string `json:"cpuCredits,omitempty"`
|
||||
// AssociatePublicIP is true if we want instances to have a public IP
|
||||
AssociatePublicIP *bool `json:"associatePublicIp,omitempty"`
|
||||
// AdditionalSecurityGroups attaches additional security groups (e.g. i-123456)
|
||||
|
|
|
|||
|
|
@ -126,6 +126,8 @@ type InstanceGroupSpec struct {
|
|||
MaxPrice *string `json:"maxPrice,omitempty"`
|
||||
// SpotDurationInMinutes indicates this is a spot-block group, with the specified value as the spot reservation time
|
||||
SpotDurationInMinutes *int64 `json:"spotDurationInMinutes,omitempty"`
|
||||
// CPUCredits is the credit option for CPU Usage on burstable instance types (AWS only)
|
||||
CPUCredits *string `json:"cpuCredits,omitempty"`
|
||||
// AssociatePublicIP is true if we want instances to have a public IP
|
||||
AssociatePublicIP *bool `json:"associatePublicIp,omitempty"`
|
||||
// AdditionalSecurityGroups attaches additional security groups (e.g. i-123456)
|
||||
|
|
|
|||
|
|
@ -3860,6 +3860,7 @@ func autoConvert_v1alpha2_InstanceGroupSpec_To_kops_InstanceGroupSpec(in *Instan
|
|||
}
|
||||
out.MaxPrice = in.MaxPrice
|
||||
out.SpotDurationInMinutes = in.SpotDurationInMinutes
|
||||
out.CPUCredits = in.CPUCredits
|
||||
out.AssociatePublicIP = in.AssociatePublicIP
|
||||
out.AdditionalSecurityGroups = in.AdditionalSecurityGroups
|
||||
out.CloudLabels = in.CloudLabels
|
||||
|
|
@ -4011,6 +4012,7 @@ func autoConvert_kops_InstanceGroupSpec_To_v1alpha2_InstanceGroupSpec(in *kops.I
|
|||
}
|
||||
out.MaxPrice = in.MaxPrice
|
||||
out.SpotDurationInMinutes = in.SpotDurationInMinutes
|
||||
out.CPUCredits = in.CPUCredits
|
||||
out.AssociatePublicIP = in.AssociatePublicIP
|
||||
out.AdditionalSecurityGroups = in.AdditionalSecurityGroups
|
||||
out.CloudLabels = in.CloudLabels
|
||||
|
|
|
|||
|
|
@ -2061,6 +2061,11 @@ func (in *InstanceGroupSpec) DeepCopyInto(out *InstanceGroupSpec) {
|
|||
*out = new(int64)
|
||||
**out = **in
|
||||
}
|
||||
if in.CPUCredits != nil {
|
||||
in, out := &in.CPUCredits, &out.CPUCredits
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.AssociatePublicIP != nil {
|
||||
in, out := &in.AssociatePublicIP, &out.AssociatePublicIP
|
||||
*out = new(bool)
|
||||
|
|
|
|||
|
|
@ -79,6 +79,10 @@ func awsValidateInstanceGroup(ig *kops.InstanceGroup, cloud awsup.AWSCloud) fiel
|
|||
allErrs = append(allErrs, awsValidateInstanceMetadata(field.NewPath("spec", "instanceMetadata"), ig.Spec.InstanceMetadata)...)
|
||||
}
|
||||
|
||||
if ig.Spec.CPUCredits != nil {
|
||||
allErrs = append(allErrs, awsValidateCPUCredits(field.NewPath("spec"), &ig.Spec, cloud)...)
|
||||
}
|
||||
|
||||
return allErrs
|
||||
}
|
||||
|
||||
|
|
@ -277,3 +281,10 @@ func awsValidateLoadBalancerSubnets(fieldPath *field.Path, spec kops.ClusterSpec
|
|||
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func awsValidateCPUCredits(fieldPath *field.Path, spec *kops.InstanceGroupSpec, cloud awsup.AWSCloud) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
|
||||
allErrs = append(allErrs, IsValidValue(fieldPath.Child("cpuCredits"), spec.CPUCredits, []string{"standard", "unlimited"})...)
|
||||
return allErrs
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2227,6 +2227,11 @@ func (in *InstanceGroupSpec) DeepCopyInto(out *InstanceGroupSpec) {
|
|||
*out = new(int64)
|
||||
**out = **in
|
||||
}
|
||||
if in.CPUCredits != nil {
|
||||
in, out := &in.CPUCredits, &out.CPUCredits
|
||||
*out = new(string)
|
||||
**out = **in
|
||||
}
|
||||
if in.AssociatePublicIP != nil {
|
||||
in, out := &in.AssociatePublicIP, &out.AssociatePublicIP
|
||||
*out = new(bool)
|
||||
|
|
|
|||
Loading…
Reference in New Issue