diff --git a/README.md b/README.md
index 8512ec18..c29dca86 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ integration with the kOps api:
... just **pure go code.**
-Currently using kOps `v1.25.1` and compatible with terraform `0.15` and higher.
+Currently using kOps `v1.25.2` and compatible with terraform `0.15` and higher.
**NOTES**
- For now, provisioning the network is not supported. The network must
diff --git a/docs/data-sources/cluster.md b/docs/data-sources/cluster.md
index 9a8339bb..e4688a2d 100644
--- a/docs/data-sources/cluster.md
+++ b/docs/data-sources/cluster.md
@@ -1774,6 +1774,8 @@ The following arguments are supported:
- `skip_nodes_with_local_storage` - (Computed) - Bool - SkipNodesWithLocalStorage makes cluster autoscaler skip scale-down of nodes with local storage.
Default: true.
- `new_pod_scale_up_delay` - (Computed) - String - NewPodScaleUpDelay causes cluster autoscaler to ignore unschedulable pods until they are a certain "age", regardless of the scan-interval
Default: 0s.
- `scale_down_delay_after_add` - (Computed) - String - ScaleDownDelayAfterAdd determines the time after scale up that scale down evaluation resumes
Default: 10m0s.
+- `scale_down_unneeded_time` - (Computed) - String - scaleDownUnneededTime determines the time a node should be unneeded before it is eligible for scale down
Default: 10m0s.
+- `scale_down_unready_time` - (Computed) - String - ScaleDownUnreadyTime determines the time an unready node should be unneeded before it is eligible for scale down
Default: 20m0s.
- `cordon_node_before_terminating` - (Computed) - Bool - CordonNodeBeforeTerminating should CA cordon nodes before terminating during downscale process
Default: false.
- `image` - (Computed) - String - Image is the docker container used.
Default: the latest supported image for the specified kubernetes version.
- `memory_request` - (Computed) - Quantity - MemoryRequest of cluster autoscaler container.
Default: 300Mi.
diff --git a/docs/index.md b/docs/index.md
index d6e1a14d..95cddc8a 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -9,7 +9,7 @@ integration with the kOps api:
... just **pure go code.**
-Currently using kOps `v1.25.1` and compatible with terraform `0.15` and higher.
+Currently using kOps `v1.25.2` and compatible with terraform `0.15` and higher.
~> For now, provisioning the network is not supported. The network must
be created separately and given to the provider through cluster attribute
diff --git a/docs/resources/cluster.md b/docs/resources/cluster.md
index dab657e4..31d39d1c 100644
--- a/docs/resources/cluster.md
+++ b/docs/resources/cluster.md
@@ -1860,6 +1860,8 @@ The following arguments are supported:
- `skip_nodes_with_local_storage` - (Required) - Bool - SkipNodesWithLocalStorage makes cluster autoscaler skip scale-down of nodes with local storage.
Default: true.
- `new_pod_scale_up_delay` - (Optional) - String - NewPodScaleUpDelay causes cluster autoscaler to ignore unschedulable pods until they are a certain "age", regardless of the scan-interval
Default: 0s.
- `scale_down_delay_after_add` - (Optional) - String - ScaleDownDelayAfterAdd determines the time after scale up that scale down evaluation resumes
Default: 10m0s.
+- `scale_down_unneeded_time` - (Optional) - String - scaleDownUnneededTime determines the time a node should be unneeded before it is eligible for scale down
Default: 10m0s.
+- `scale_down_unready_time` - (Optional) - String - ScaleDownUnreadyTime determines the time an unready node should be unneeded before it is eligible for scale down
Default: 20m0s.
- `cordon_node_before_terminating` - (Optional) - Bool - CordonNodeBeforeTerminating should CA cordon nodes before terminating during downscale process
Default: false.
- `image` - (Optional) - String - Image is the docker container used.
Default: the latest supported image for the specified kubernetes version.
- `memory_request` - (Optional) - Quantity - MemoryRequest of cluster autoscaler container.
Default: 300Mi.
diff --git a/pkg/schemas/kops/DataSource_ClusterAutoscalerConfig.generated.go b/pkg/schemas/kops/DataSource_ClusterAutoscalerConfig.generated.go
index f9dec9e6..64616c19 100644
--- a/pkg/schemas/kops/DataSource_ClusterAutoscalerConfig.generated.go
+++ b/pkg/schemas/kops/DataSource_ClusterAutoscalerConfig.generated.go
@@ -23,6 +23,8 @@ func DataSourceClusterAutoscalerConfig() *schema.Resource {
"skip_nodes_with_local_storage": ComputedBool(),
"new_pod_scale_up_delay": ComputedString(),
"scale_down_delay_after_add": ComputedString(),
+ "scale_down_unneeded_time": ComputedString(),
+ "scale_down_unready_time": ComputedString(),
"cordon_node_before_terminating": ComputedBool(),
"image": ComputedString(),
"memory_request": ComputedQuantity(),
@@ -211,6 +213,44 @@ func ExpandDataSourceClusterAutoscalerConfig(in map[string]interface{}) kops.Clu
}(string(ExpandString(in)))
}(in)
}(in["scale_down_delay_after_add"]),
+ ScaleDownUnneededTime: func(in interface{}) *string {
+ if in == nil {
+ return nil
+ }
+ if reflect.DeepEqual(in, reflect.Zero(reflect.TypeOf(in)).Interface()) {
+ return nil
+ }
+ return func(in interface{}) *string {
+ if in == nil {
+ return nil
+ }
+ if _, ok := in.([]interface{}); ok && len(in.([]interface{})) == 0 {
+ return nil
+ }
+ return func(in string) *string {
+ return &in
+ }(string(ExpandString(in)))
+ }(in)
+ }(in["scale_down_unneeded_time"]),
+ ScaleDownUnreadyTime: func(in interface{}) *string {
+ if in == nil {
+ return nil
+ }
+ if reflect.DeepEqual(in, reflect.Zero(reflect.TypeOf(in)).Interface()) {
+ return nil
+ }
+ return func(in interface{}) *string {
+ if in == nil {
+ return nil
+ }
+ if _, ok := in.([]interface{}); ok && len(in.([]interface{})) == 0 {
+ return nil
+ }
+ return func(in string) *string {
+ return &in
+ }(string(ExpandString(in)))
+ }(in)
+ }(in["scale_down_unready_time"]),
CordonNodeBeforeTerminating: func(in interface{}) *bool {
if in == nil {
return nil
@@ -401,6 +441,26 @@ func FlattenDataSourceClusterAutoscalerConfigInto(in kops.ClusterAutoscalerConfi
}(*in)
}(in)
}(in.ScaleDownDelayAfterAdd)
+ out["scale_down_unneeded_time"] = func(in *string) interface{} {
+ return func(in *string) interface{} {
+ if in == nil {
+ return nil
+ }
+ return func(in string) interface{} {
+ return FlattenString(string(in))
+ }(*in)
+ }(in)
+ }(in.ScaleDownUnneededTime)
+ out["scale_down_unready_time"] = func(in *string) interface{} {
+ return func(in *string) interface{} {
+ if in == nil {
+ return nil
+ }
+ return func(in string) interface{} {
+ return FlattenString(string(in))
+ }(*in)
+ }(in)
+ }(in.ScaleDownUnreadyTime)
out["cordon_node_before_terminating"] = func(in *bool) interface{} {
return func(in *bool) interface{} {
if in == nil {
diff --git a/pkg/schemas/kops/DataSource_ClusterAutoscalerConfig.generated_test.go b/pkg/schemas/kops/DataSource_ClusterAutoscalerConfig.generated_test.go
index e095466c..7923dc8b 100644
--- a/pkg/schemas/kops/DataSource_ClusterAutoscalerConfig.generated_test.go
+++ b/pkg/schemas/kops/DataSource_ClusterAutoscalerConfig.generated_test.go
@@ -30,6 +30,8 @@ func TestExpandDataSourceClusterAutoscalerConfig(t *testing.T) {
"skip_nodes_with_local_storage": nil,
"new_pod_scale_up_delay": nil,
"scale_down_delay_after_add": nil,
+ "scale_down_unneeded_time": nil,
+ "scale_down_unready_time": nil,
"cordon_node_before_terminating": nil,
"image": nil,
"memory_request": nil,
@@ -62,6 +64,8 @@ func TestFlattenDataSourceClusterAutoscalerConfigInto(t *testing.T) {
"skip_nodes_with_local_storage": nil,
"new_pod_scale_up_delay": nil,
"scale_down_delay_after_add": nil,
+ "scale_down_unneeded_time": nil,
+ "scale_down_unready_time": nil,
"cordon_node_before_terminating": nil,
"image": nil,
"memory_request": nil,
@@ -183,6 +187,28 @@ func TestFlattenDataSourceClusterAutoscalerConfigInto(t *testing.T) {
},
want: _default,
},
+ {
+ name: "ScaleDownUnneededTime - default",
+ args: args{
+ in: func() kops.ClusterAutoscalerConfig {
+ subject := kops.ClusterAutoscalerConfig{}
+ subject.ScaleDownUnneededTime = nil
+ return subject
+ }(),
+ },
+ want: _default,
+ },
+ {
+ name: "ScaleDownUnreadyTime - default",
+ args: args{
+ in: func() kops.ClusterAutoscalerConfig {
+ subject := kops.ClusterAutoscalerConfig{}
+ subject.ScaleDownUnreadyTime = nil
+ return subject
+ }(),
+ },
+ want: _default,
+ },
{
name: "CordonNodeBeforeTerminating - default",
args: args{
@@ -272,6 +298,8 @@ func TestFlattenDataSourceClusterAutoscalerConfig(t *testing.T) {
"skip_nodes_with_local_storage": nil,
"new_pod_scale_up_delay": nil,
"scale_down_delay_after_add": nil,
+ "scale_down_unneeded_time": nil,
+ "scale_down_unready_time": nil,
"cordon_node_before_terminating": nil,
"image": nil,
"memory_request": nil,
@@ -393,6 +421,28 @@ func TestFlattenDataSourceClusterAutoscalerConfig(t *testing.T) {
},
want: _default,
},
+ {
+ name: "ScaleDownUnneededTime - default",
+ args: args{
+ in: func() kops.ClusterAutoscalerConfig {
+ subject := kops.ClusterAutoscalerConfig{}
+ subject.ScaleDownUnneededTime = nil
+ return subject
+ }(),
+ },
+ want: _default,
+ },
+ {
+ name: "ScaleDownUnreadyTime - default",
+ args: args{
+ in: func() kops.ClusterAutoscalerConfig {
+ subject := kops.ClusterAutoscalerConfig{}
+ subject.ScaleDownUnreadyTime = nil
+ return subject
+ }(),
+ },
+ want: _default,
+ },
{
name: "CordonNodeBeforeTerminating - default",
args: args{
diff --git a/pkg/schemas/kops/DataSource_ClusterSpec.generated.go b/pkg/schemas/kops/DataSource_ClusterSpec.generated.go
index e5039d5e..0a2a1fcd 100644
--- a/pkg/schemas/kops/DataSource_ClusterSpec.generated.go
+++ b/pkg/schemas/kops/DataSource_ClusterSpec.generated.go
@@ -1323,7 +1323,7 @@ func FlattenDataSourceClusterSpecInto(in kops.ClusterSpec, out map[string]interf
keys = append(keys, key)
}
sort.SliceStable(keys, func(i, j int) bool {
- return keys[i] > keys[j]
+ return keys[i] < keys[j]
})
var out []interface{}
for _, key := range keys {
diff --git a/pkg/schemas/kops/DataSource_ContainerdConfig.generated.go b/pkg/schemas/kops/DataSource_ContainerdConfig.generated.go
index 8552392e..5b64e8f6 100644
--- a/pkg/schemas/kops/DataSource_ContainerdConfig.generated.go
+++ b/pkg/schemas/kops/DataSource_ContainerdConfig.generated.go
@@ -295,7 +295,7 @@ func FlattenDataSourceContainerdConfigInto(in kops.ContainerdConfig, out map[str
keys = append(keys, key)
}
sort.SliceStable(keys, func(i, j int) bool {
- return keys[i] > keys[j]
+ return keys[i] < keys[j]
})
var out []interface{}
for _, key := range keys {
diff --git a/pkg/schemas/kops/DataSource_KubeDNSConfig.generated.go b/pkg/schemas/kops/DataSource_KubeDNSConfig.generated.go
index e38faa5f..ad4f9dd3 100644
--- a/pkg/schemas/kops/DataSource_KubeDNSConfig.generated.go
+++ b/pkg/schemas/kops/DataSource_KubeDNSConfig.generated.go
@@ -283,7 +283,7 @@ func FlattenDataSourceKubeDNSConfigInto(in kops.KubeDNSConfig, out map[string]in
keys = append(keys, key)
}
sort.SliceStable(keys, func(i, j int) bool {
- return keys[i] > keys[j]
+ return keys[i] < keys[j]
})
var out []interface{}
for _, key := range keys {
diff --git a/pkg/schemas/kops/Resource_ClusterAutoscalerConfig.generated.go b/pkg/schemas/kops/Resource_ClusterAutoscalerConfig.generated.go
index 20f9e9fc..76a5b115 100644
--- a/pkg/schemas/kops/Resource_ClusterAutoscalerConfig.generated.go
+++ b/pkg/schemas/kops/Resource_ClusterAutoscalerConfig.generated.go
@@ -23,6 +23,8 @@ func ResourceClusterAutoscalerConfig() *schema.Resource {
"skip_nodes_with_local_storage": RequiredBool(),
"new_pod_scale_up_delay": OptionalString(),
"scale_down_delay_after_add": OptionalString(),
+ "scale_down_unneeded_time": OptionalString(),
+ "scale_down_unready_time": OptionalString(),
"cordon_node_before_terminating": OptionalBool(),
"image": OptionalString(),
"memory_request": OptionalQuantity(),
@@ -199,6 +201,44 @@ func ExpandResourceClusterAutoscalerConfig(in map[string]interface{}) kops.Clust
}(string(ExpandString(in)))
}(in)
}(in["scale_down_delay_after_add"]),
+ ScaleDownUnneededTime: func(in interface{}) *string {
+ if in == nil {
+ return nil
+ }
+ if reflect.DeepEqual(in, reflect.Zero(reflect.TypeOf(in)).Interface()) {
+ return nil
+ }
+ return func(in interface{}) *string {
+ if in == nil {
+ return nil
+ }
+ if _, ok := in.([]interface{}); ok && len(in.([]interface{})) == 0 {
+ return nil
+ }
+ return func(in string) *string {
+ return &in
+ }(string(ExpandString(in)))
+ }(in)
+ }(in["scale_down_unneeded_time"]),
+ ScaleDownUnreadyTime: func(in interface{}) *string {
+ if in == nil {
+ return nil
+ }
+ if reflect.DeepEqual(in, reflect.Zero(reflect.TypeOf(in)).Interface()) {
+ return nil
+ }
+ return func(in interface{}) *string {
+ if in == nil {
+ return nil
+ }
+ if _, ok := in.([]interface{}); ok && len(in.([]interface{})) == 0 {
+ return nil
+ }
+ return func(in string) *string {
+ return &in
+ }(string(ExpandString(in)))
+ }(in)
+ }(in["scale_down_unready_time"]),
CordonNodeBeforeTerminating: func(in interface{}) *bool {
if in == nil {
return nil
@@ -389,6 +429,26 @@ func FlattenResourceClusterAutoscalerConfigInto(in kops.ClusterAutoscalerConfig,
}(*in)
}(in)
}(in.ScaleDownDelayAfterAdd)
+ out["scale_down_unneeded_time"] = func(in *string) interface{} {
+ return func(in *string) interface{} {
+ if in == nil {
+ return nil
+ }
+ return func(in string) interface{} {
+ return FlattenString(string(in))
+ }(*in)
+ }(in)
+ }(in.ScaleDownUnneededTime)
+ out["scale_down_unready_time"] = func(in *string) interface{} {
+ return func(in *string) interface{} {
+ if in == nil {
+ return nil
+ }
+ return func(in string) interface{} {
+ return FlattenString(string(in))
+ }(*in)
+ }(in)
+ }(in.ScaleDownUnreadyTime)
out["cordon_node_before_terminating"] = func(in *bool) interface{} {
return func(in *bool) interface{} {
if in == nil {
diff --git a/pkg/schemas/kops/Resource_ClusterAutoscalerConfig.generated_test.go b/pkg/schemas/kops/Resource_ClusterAutoscalerConfig.generated_test.go
index 2a144f6a..adc9830d 100644
--- a/pkg/schemas/kops/Resource_ClusterAutoscalerConfig.generated_test.go
+++ b/pkg/schemas/kops/Resource_ClusterAutoscalerConfig.generated_test.go
@@ -30,6 +30,8 @@ func TestExpandResourceClusterAutoscalerConfig(t *testing.T) {
"skip_nodes_with_local_storage": nil,
"new_pod_scale_up_delay": nil,
"scale_down_delay_after_add": nil,
+ "scale_down_unneeded_time": nil,
+ "scale_down_unready_time": nil,
"cordon_node_before_terminating": nil,
"image": nil,
"memory_request": nil,
@@ -62,6 +64,8 @@ func TestFlattenResourceClusterAutoscalerConfigInto(t *testing.T) {
"skip_nodes_with_local_storage": nil,
"new_pod_scale_up_delay": nil,
"scale_down_delay_after_add": nil,
+ "scale_down_unneeded_time": nil,
+ "scale_down_unready_time": nil,
"cordon_node_before_terminating": nil,
"image": nil,
"memory_request": nil,
@@ -183,6 +187,28 @@ func TestFlattenResourceClusterAutoscalerConfigInto(t *testing.T) {
},
want: _default,
},
+ {
+ name: "ScaleDownUnneededTime - default",
+ args: args{
+ in: func() kops.ClusterAutoscalerConfig {
+ subject := kops.ClusterAutoscalerConfig{}
+ subject.ScaleDownUnneededTime = nil
+ return subject
+ }(),
+ },
+ want: _default,
+ },
+ {
+ name: "ScaleDownUnreadyTime - default",
+ args: args{
+ in: func() kops.ClusterAutoscalerConfig {
+ subject := kops.ClusterAutoscalerConfig{}
+ subject.ScaleDownUnreadyTime = nil
+ return subject
+ }(),
+ },
+ want: _default,
+ },
{
name: "CordonNodeBeforeTerminating - default",
args: args{
@@ -272,6 +298,8 @@ func TestFlattenResourceClusterAutoscalerConfig(t *testing.T) {
"skip_nodes_with_local_storage": nil,
"new_pod_scale_up_delay": nil,
"scale_down_delay_after_add": nil,
+ "scale_down_unneeded_time": nil,
+ "scale_down_unready_time": nil,
"cordon_node_before_terminating": nil,
"image": nil,
"memory_request": nil,
@@ -393,6 +421,28 @@ func TestFlattenResourceClusterAutoscalerConfig(t *testing.T) {
},
want: _default,
},
+ {
+ name: "ScaleDownUnneededTime - default",
+ args: args{
+ in: func() kops.ClusterAutoscalerConfig {
+ subject := kops.ClusterAutoscalerConfig{}
+ subject.ScaleDownUnneededTime = nil
+ return subject
+ }(),
+ },
+ want: _default,
+ },
+ {
+ name: "ScaleDownUnreadyTime - default",
+ args: args{
+ in: func() kops.ClusterAutoscalerConfig {
+ subject := kops.ClusterAutoscalerConfig{}
+ subject.ScaleDownUnreadyTime = nil
+ return subject
+ }(),
+ },
+ want: _default,
+ },
{
name: "CordonNodeBeforeTerminating - default",
args: args{
diff --git a/pkg/schemas/kops/Resource_ClusterSpec.generated.go b/pkg/schemas/kops/Resource_ClusterSpec.generated.go
index fc6e902a..b4be3f04 100644
--- a/pkg/schemas/kops/Resource_ClusterSpec.generated.go
+++ b/pkg/schemas/kops/Resource_ClusterSpec.generated.go
@@ -1241,7 +1241,7 @@ func FlattenResourceClusterSpecInto(in kops.ClusterSpec, out map[string]interfac
keys = append(keys, key)
}
sort.SliceStable(keys, func(i, j int) bool {
- return keys[i] > keys[j]
+ return keys[i] < keys[j]
})
var out []interface{}
for _, key := range keys {
diff --git a/pkg/schemas/kops/Resource_ContainerdConfig.generated.go b/pkg/schemas/kops/Resource_ContainerdConfig.generated.go
index d71a0566..5283dcee 100644
--- a/pkg/schemas/kops/Resource_ContainerdConfig.generated.go
+++ b/pkg/schemas/kops/Resource_ContainerdConfig.generated.go
@@ -295,7 +295,7 @@ func FlattenResourceContainerdConfigInto(in kops.ContainerdConfig, out map[strin
keys = append(keys, key)
}
sort.SliceStable(keys, func(i, j int) bool {
- return keys[i] > keys[j]
+ return keys[i] < keys[j]
})
var out []interface{}
for _, key := range keys {
diff --git a/pkg/schemas/kops/Resource_KubeDNSConfig.generated.go b/pkg/schemas/kops/Resource_KubeDNSConfig.generated.go
index ab87c63c..83c5fe8e 100644
--- a/pkg/schemas/kops/Resource_KubeDNSConfig.generated.go
+++ b/pkg/schemas/kops/Resource_KubeDNSConfig.generated.go
@@ -283,7 +283,7 @@ func FlattenResourceKubeDNSConfigInto(in kops.KubeDNSConfig, out map[string]inte
keys = append(keys, key)
}
sort.SliceStable(keys, func(i, j int) bool {
- return keys[i] > keys[j]
+ return keys[i] < keys[j]
})
var out []interface{}
for _, key := range keys {