Skip to content

Add externalloadbalanceripaddress and enablecsi to kubernetes_cluster resource - #322

Open
sureshanaparti wants to merge 2 commits into
mainfrom
feature/issue-275-kubernetes-cluster-params
Open

Add externalloadbalanceripaddress and enablecsi to kubernetes_cluster resource#322
sureshanaparti wants to merge 2 commits into
mainfrom
feature/issue-275-kubernetes-cluster-params

Conversation

@sureshanaparti

@sureshanaparti sureshanaparti commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

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

… 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 externalloadbalanceripaddress and enablecsi to the resource schema.
  • Sets the new fields on CreateKubernetesClusterParams during 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)
Copilot AI review requested due to automatic review settings August 17, 2026 17:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 go command to modify go.sum (and can break CI/builds that enforce a clean worktree or module checksum consistency). Commit the updated go.sum after running go mod tidy/go mod download.
require (
	github.com/apache/cloudstack-go/v2 v2.20.0
	github.com/go-ini/ini v1.67.0

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 this pull request may close these issues.

Kubernetes Cluster resource missing externalloadbalanceripaddress and enablecsi parameters

2 participants