Add externalloadbalanceripaddress and enablecsi to kubernetes_cluster resource - #322
Open
sureshanaparti wants to merge 2 commits into
Open
Add externalloadbalanceripaddress and enablecsi to kubernetes_cluster resource#322sureshanaparti wants to merge 2 commits into
sureshanaparti wants to merge 2 commits into
Conversation
… resource Adds support for two missing parameters in the cloudstack_kubernetes_cluster Terraform resource: - externalloadbalanceripaddress: Enables HA clusters (multiple control nodes) on Shared networks by allowing specification of the external load balancer IP - enablecsi: Enables CloudStack CSI (Container Storage Interface) for cluster storage management Both parameters are optional and marked as ForceNew since they must be set at cluster creation time per the CloudStack API. Fixes: #275
sureshanaparti
requested review from
sudo87 and
vishesh92
and
a lite review from Copilot
August 17, 2026 10:55
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the cloudstack_kubernetes_cluster Terraform resource to support two additional CloudStack Kubernetes cluster parameters so they can be configured and reflected in state.
Changes:
- Adds
externalloadbalanceripaddressandenablecsito the resource schema. - Sets the new fields on
CreateKubernetesClusterParamsduring resource creation. - Reads the new fields back from the CloudStack API and stores them in Terraform state.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+361
to
+363
| if enableCSI, ok := d.GetOk("enablecsi"); ok { | ||
| p.SetEnablecsi(enableCSI.(bool)) | ||
| } |
Comment on lines
+357
to
+363
| if externalLoadBalancerIPAddress, ok := d.GetOk("externalloadbalanceripaddress"); ok { | ||
| p.SetExternalloadbalanceripaddress(externalLoadBalancerIPAddress.(string)) | ||
| } | ||
|
|
||
| if enableCSI, ok := d.GetOk("enablecsi"); ok { | ||
| p.SetEnablecsi(enableCSI.(bool)) | ||
| } |
Comment on lines
+218
to
+230
| "externalloadbalanceripaddress": { | ||
| Type: schema.TypeString, | ||
| Optional: true, | ||
| ForceNew: true, | ||
| Description: "The external load balancer IP address for HA clusters (multiple control nodes) on Shared networks", | ||
| }, | ||
|
|
||
| "enablecsi": { | ||
| Type: schema.TypeBool, | ||
| Optional: true, | ||
| ForceNew: true, | ||
| Description: "Enable CloudStack CSI (Container Storage Interface) for the Kubernetes cluster", | ||
| }, |
- Use snake_case for attribute names: external_load_balancer_ip_address and enable_csi (consistent with resource naming convention) - Use GetOkExists for boolean field to properly handle explicit false values (GetOk cannot distinguish between unset and set-to-false) - Update cloudstack-go dependency to v2.20.0 to include new KubernetesCluster fields (Externalloadbalanceripaddress, Enablecsi)
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
go.mod:22
- go.mod now requires github.com/apache/cloudstack-go/v2 v2.20.0, but go.sum still only contains checksums for v2.19.1. This will cause the next
gocommand to modify go.sum (and can break CI/builds that enforce a clean worktree or module checksum consistency). Commit the updated go.sum after runninggo mod tidy/go mod download.
require (
github.com/apache/cloudstack-go/v2 v2.20.0
github.com/go-ini/ini v1.67.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for two missing parameters in the cloudstack_kubernetes_cluster Terraform resource.
NOTE: Merge this after the cloudstack-go PR (and tag updated in the terraform) - apache/cloudstack-go#163