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

fix(k8s): pool size and autoscaling #498

Merged
merged 3 commits into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion scaleway/resource_k8s_pool_beta.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ func resourceScalewayK8SPoolBeta() *schema.Resource {
Computed: true,
Description: "The Kubernetes version of the pool",
},
"current_size": {
Type: schema.TypeInt,
Computed: true,
Description: "The actual size of the pool",
},
"nodes": {
Type: schema.TypeList,
Computed: true,
Expand Down Expand Up @@ -266,7 +271,10 @@ func resourceScalewayK8SPoolBetaRead(d *schema.ResourceData, m interface{}) erro
_ = d.Set("node_type", pool.NodeType)
_ = d.Set("autoscaling", pool.Autoscaling)
_ = d.Set("autohealing", pool.Autohealing)
_ = d.Set("size", pool.Size)
_ = d.Set("current_size", pool.Size)
if !pool.Autoscaling {
_ = d.Set("size", pool.Size)
}
_ = d.Set("version", pool.Version)
_ = d.Set("min_size", pool.MinSize)
_ = d.Set("max_size", pool.MaxSize)
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/k8s_pool_beta.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The following arguments are supported:
~> **Important:** Updates to this field will recreate a new resource.

- `size` - (Required) The size of the pool.
~> **Important:** This field will only be used at creation if autoscaling is enabled.

- `min_size` - (Defaults to `1`) The minimum size of the pool, used by the autoscaling feature.

Expand Down Expand Up @@ -83,6 +84,7 @@ In addition to all above arguments, the following attributes are exported:
- `created_at` - The creation date of the pool.
- `updated_at` - The last update date of the pool.
- `version` - The version of the pool.
- `current_size` - The size of the pool at the time the terraform state was updated.

## Import

Expand Down